Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ru2fac/76f85c24b688eb30b5ed7e2ce38bcf5d to your computer and use it in GitHub Desktop.

Select an option

Save ru2fac/76f85c24b688eb30b5ed7e2ce38bcf5d to your computer and use it in GitHub Desktop.
<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>
@ru2fac

ru2fac commented Nov 6, 2018

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment