Using perch:related in a block proof of concept.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<perch:block type="related_article_block" label="Related Articles"> | |
<perch:template path="content/blocks/related_article_block.html" /> | |
</perch:block> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As an experiment I tested to see if I could use perch:related in a block to enhance an article but include related content in the body of the article. The experiment was a success. Here is a simple example of what I did
First create a template that references the collection you would like to related, naturally using the perch:related
The template could look sometime like this.
Then in the page where you want to insert the block you would add
So far, I've tested it successfully linking multiple collections each with its own template and each referenced with its own block in the main page template.
Of course, this being Perch, the markup can be customized to fit your design, but I was happy to see that it worked. It opens up many creative possiblities