Displaying page links only on pages with descriptions with Page List Block.
Permalink
In C5 8.5.2, I'm using the page list block to create a list of jobs. Only some of the jobs pages have descriptions since I'm using there parent pages as job section titles. I only want the jobs with page descriptions to display when I select the "Different Link than Page Name" option in the edit page list popup box.
I have created my own custom page template and I'm currently looking at the section post below to get my logic correct.
What should be my logic to get this working.
I have created my own custom page template and I'm currently looking at the section post below to get my logic correct.
<?php if (isset($includeDate) && $includeDate) { ?> <div class="ccm-block-page-list-date"><?php echo h($date) ?></div> <?php } ?> <?php if (isset($includeDescription) && $includeDescription) { ?> <div class="ccm-block-page-list-description"><?php echo h($description) ?></div> <?php } ?> <?php if (isset($useButtonForLink) && $useButtonForLink) { ?> <div class="ccm-block-page-list-page-entry-read-more"> <a href="<?php echo h($url) ?>" target="<?php echo h($target) ?>" class="<?php echo h($buttonClasses) ?>"><?php echo h($buttonLinkText) ?></a>
Viewing 15 lines of 18 lines. View entire code block.
What should be my logic to get this working.
I figured out the answer but now my problem is the children pages in the Page List block do not follow the sitemap order at all.
$pages->sortByDisplayOrder();
Your problem is that display order is only relative to the immediate parent, and not a global sequence.