Created
November 6, 2018 00:32
-
-
Save ru2fac/76f85c24b688eb30b5ed7e2ce38bcf5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="pdopage"> | |
| <div class="rows"> | |
| [[!pdoPage? | |
| &parents=`0` | |
| &level=`0` | |
| &limit=`6` | |
| &where=`{"modResource.parent:!=":0}` | |
| &sortby=`{"p_menuindex":"ASC", "publishedon":"DESC"}` | |
| &ajaxMode=`default` | |
| &leftJoin=`{ | |
| "Parent":{"class":"modResource", "on":"Parent.id = modResource.parent"} | |
| }` | |
| &select=`{ | |
| "modResource":"*", | |
| "Parent":"Parent.id as pid, Parent.pagetitle as parent_pagetitle, Parent.uri as p_uri, Parent.menuindex as p_menuindex" | |
| }` | |
| &tpl=`@INLINE <h3 class="parent-title parent-{$pid}" data-pid="{$pid}">{$parent_pagetitle}</h3> | |
| <p>{$pagetitle}</p>` | |
| ]] | |
| </div> | |
| [[!+page.nav]] | |
| </div> | |
| <script> | |
| function hideTitles() { | |
| $('.parent-title').hide(); | |
| $('.parent-title').each(function(){ | |
| $('.parent-' + $(this).data('pid')).first().show(); | |
| }); | |
| } | |
| hideTitles() | |
| $(document).on('pdopage_load', function(e, config, response) { | |
| hideTitles() | |
| }); | |
| </script> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Взято тут: https://ilyaut.ru/cheats/a-breakdown-of-the-categories-parents/