Sortable page list help
Permalink
Hi there....there is an awesome way I saw to sort pages based on some sort of tagging. The code that works is:
...but in the theme I am using, only the alphabetical sorting works, NOT the customized page list (above, based on .PSD .HTML ,etc..)
The code that I have is:
...Below that is some linkages to the isotope framework, etc. The only difference I can see is the reference to $cats, but I am unfamiliar with PHP enough to not understand what is going on. I would assume that each page needs a custom attribute or tag, but I would need to add those in somewhere. I guess I am trying to figure out where "data-option-value" refers to?
Thanks for any advice...This sortable page list is pretty cool in that it is animated, etc.
<div class="ccm-page-list-sortable ccm-page-list-column ccm-page-list-two-column"> <div class="filter-panel col_12 margin_bottom_30"> <ul class="option-set" data-option-key="filter"> <li>Display : </li> <li><a href="#show-all" data-option-value="*" class="selected rounded">show all</a></li> <li><a class="rounded" href="#HTML" data-option-value=".HTML">HTML</a></li> <li><a class="rounded" href="#PHP" data-option-value=".PHP">PHP</a></li> <li><a class="rounded" href="#PSD" data-option-value=".PSD">PSD</a></li> <li><a class="rounded" href="#CSS" data-option-value=".CSS">CSS</a></li> <li><a class="rounded" href="#INDD" data-option-value=".INDD">INDD</a></li> </ul> <ul class="option-set" data-option-key="sortBy"> <li>Sort : </li> <li><a href="#original" data-option-value="original-order" class="selected rounded">original</a></li> <li><a href="#alphabetical" data-option-value="alphabetical" class="rounded">alphabetical</a></li>
Viewing 15 lines of 17 lines. View entire code block.
...but in the theme I am using, only the alphabetical sorting works, NOT the customized page list (above, based on .PSD .HTML ,etc..)
The code that I have is:
<div class="ccm-page-list-sortable ccm-page-list-column ccm-page-list-two-column"> <div class="filter-panel col_12 margin_bottom_30"> <?php if (count($cats) && $t->__sort_category) : ?> <ul class="option-set" data-option-key="filter"> <li><?php echo t('Display :')?> </li> <li><a href="#show-all" data-option-value="*" class="selected rounded"><?php echo t('show all')?></a></li> <?php foreach ($cats as $cat): ?> <li><a class="rounded" href="#<?php echo $th->entities($cat)?>" data-option-value=".<?php echo $th->entities($cat)?>"><?php echo $th->entities($cat)?></a></li> <?php endforeach ?> </ul> <?php endif ?> <?php if ($t->__sort_alphabetical) : ?> <ul class="option-set" data-option-key="sortBy"> <li><?php echo t('Sort :')?> </li> <li><a href="#original" data-option-value="original-order" class="selected rounded"><?php echo t('original')?></a></li>
Viewing 15 lines of 19 lines. View entire code block.
...Below that is some linkages to the isotope framework, etc. The only difference I can see is the reference to $cats, but I am unfamiliar with PHP enough to not understand what is going on. I would assume that each page needs a custom attribute or tag, but I would need to add those in somewhere. I guess I am trying to figure out where "data-option-value" refers to?
Thanks for any advice...This sortable page list is pretty cool in that it is animated, etc.
I think the majority of the logic is in the controller not in the view of that file. I'm not sure I'm following you exactly on sorting issue. Could you try explaining it in a different way.
As for page list sorting by attribute in PHP/concrete5 here's a link that talks about it pretty well(scroll down for the better answer/explanation).
Best Wishes,
Mike