Display a chosen topic name in the Page List block
Permalink 1 user found helpful
Hey all - Wondering if anyone has done this in 5.7.
If you use a topic list to filter a page list, is it possible (or fairly easy to do) to display the name of the chosen topic as a header/title in the Page List that gets filtered?
Any help appreciated.
If you use a topic list to filter a page list, is it possible (or fairly easy to do) to display the name of the chosen topic as a header/title in the Page List that gets filtered?
Any help appreciated.
I mocked up what I'm trying to accomplish. It seems like a no-brainer. See attached Image.
@juddc
The "archive" custom template for the Page Title block can be customized to do this. An example of its use is in the blog page of the sample content.
- copy archive.php
concrete\blocks\page_title\templates\archive.php
- paste it into application\blocks\page_title\templates
application\blocks\page_title\templates\archive.php
- change the name of archive.php to "topic_title.php"
application\blocks\page_title\templates\topic_title.php
- open topic_title.php and change one line of code
from:
to:
Add the Page Title block, with the Topic Title custom template, above the Page List block that is filtering the topics. It should list the current topic being filtered.
The "archive" custom template for the Page Title block can be customized to do this. An example of its use is in the blog page of the sample content.
- copy archive.php
concrete\blocks\page_title\templates\archive.php
- paste it into application\blocks\page_title\templates
application\blocks\page_title\templates\archive.php
- change the name of archive.php to "topic_title.php"
application\blocks\page_title\templates\topic_title.php
- open topic_title.php and change one line of code
from:
$title = t('Topic Archives: %s', $currentTopic->getTreeNodeDisplayName());
to:
$title = t('%s', $currentTopic->getTreeNodeDisplayName());
Add the Page Title block, with the Topic Title custom template, above the Page List block that is filtering the topics. It should list the current topic being filtered.
That works brilliantly - Thank you.
Very good topic. thanks.
Are you looking to do something similar to the Portfolio page in the Elemental sample content? If not, can you include more information and a mockup of what you are trying to make.