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.

<?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>


What should be my logic to get this working.

stewblack23
 
stewblack23 replied on at Permalink Reply
stewblack23
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.
linuxoid replied on at Permalink Reply
linuxoid
$pages->sortByDisplayOrder();
JohntheFish replied on at Permalink Reply
JohntheFish
Your problem is that display order is only relative to the immediate parent, and not a global sequence.