How to get the current topic link inside [page-list] block
Permalink 2 users found helpful
The topic list is new and missed docs. I want to create a custom "page-list" template (for each page in the list print topic: name + url)
** Example (each topic in page-list is clickable to the "topic category")
http://www.sitepoint.com/
** Example (each topic in page-list is clickable to the "topic category")
http://www.sitepoint.com/
Hi siton,
Here is something you can try for adding topics and their links in page list items without overriding or modifying the Page List controller:
In your Page List block custom template, this code would go inside your "foreach ($pages as $page)" loop. I have commented the code and will create a tutorial for it soon.
It should handle Hebrew and other languages.
Here is something you can try for adding topics and their links in page list items without overriding or modifying the Page List controller:
<?php /*Display page topics and topic links for filtering the page list*/ // get the current page list item topics for a specific topic tree $topics = $page->getAttribute('blog_entry_topics'); // if $topics is true, loop through each topic // - var_dump(is_object($topics)); is false if ($topics) { // topics wrapper container (optional) echo '<div class="ccm-block-topics-wrapper">'; foreach ($topics as $topic) { // get the tree node ID $treeNodeID = $topic->getTreeNodeID(); // get the tree node name $treeNodeName = $topic->getTreeNodeDisplayName(); // make the tree node name ready for use in a URL
Viewing 15 lines of 47 lines. View entire code block.
In your Page List block custom template, this code would go inside your "foreach ($pages as $page)" loop. I have commented the code and will create a tutorial for it soon.
It should handle Hebrew and other languages.
Thanks MrKDilkinton. Was just looking for this in a project I'm working on.
The steps:
1)I copy and paste the function getTopicLink from "topiclist" controller to "pagelist" controller (in the future i will create custom controller)
2)Inside foreach ($pages as $page): --- i added this code:
The output for "pagelist" item with : #animation #css topics activate.
***no checking "if" "$topics" is object. This is partly code