Read More
module_read_more
The Read More module progressively reveals part of a content block. It can be used on any landing page built with the subpage_layout system.
The module was originally built for the Better Taxes FAQs page, where each FAQ can show an introductory answer and let visitors reveal the remaining detail. It is not limited to FAQs and can be used for any long-form landing-page content.
#Setup
- Create a Basic subpage underneath the landing page that has the
subpage_layouttag. - Add the tag
module_read_moreto the Basic subpage. - Add the content to the module page's WYSIWYG editor, or add published Basic child pages underneath the module page when you need multiple items.
- Insert an inline horizontal rule (
<hr>) at the point where the content should be hidden.
The module page and its child pages must be published so that the subpage_layout system can render them.
How the reveal works
For each content block, the first <hr> found in the WYSIWYG content is replaced with a Read more button:
- Content before the
<hr>is visible when the page loads. - Everything after the
<hr>is hidden initially. - Clicking Read more reveals the hidden content.
- The button is replaced by the revealed content; this is a one-way reveal and does not add a “Read less” control.
If a content block does not contain an <hr>, it renders normally without a Read more button.
WYSIWYG example
Add content in this order:
<p>A short introduction or summary that is visible immediately.</p>
<hr>
<p>Additional detail that visitors can reveal by selecting Read more.</p>
<p>This can include the rest of the formatted WYSIWYG content.</p>
The <hr> is a divider, not content: it is replaced by the button when the page is rendered.
Single or multiple items
Single item
Use the module page's own headline and Basic content for one Read More item. The headline is optional. Add an <hr> to the Basic content wherever the reveal should begin.
Multiple items
Add published Basic child pages underneath the tagged module page. Each Basic child becomes a separate item:
- Item heading = child page headline
- Item content = child page WYSIWYG content
- Read more trigger = the first
<hr>in that child's content
Each child page is processed independently, so every item can have a different amount of visible and hidden content. If the module page also has its own headline or content, that content is rendered as an additional item before the child items.