hi people.
i just need a children list. it should work like list of childs that shown in a content area of a parent page if it has any children.
may be it is already done, but i didn't find. all the existing plugins are about menus but not about children list. may be it is possible to create children-only list with i18n menus, but...
so i've created my own php-snippet. and i want to place it on certain blocks of my template, or in a age conent area. existing components system is good but it is only for html code snippets.
so the question is: where i can save my php-snippets and easily connect them to certain pages.
now i just wrote this code in first lines of my template to colect children in a variable special_content. i want to place it to a snippet somehow:
it's probably could be done with i18n-menu plugin, but anyway. ehat if i have some code and i want it to be a pluggable chunk. like in mod-x evolution.
i just need a children list. it should work like list of childs that shown in a content area of a parent page if it has any children.
may be it is already done, but i didn't find. all the existing plugins are about menus but not about children list. may be it is possible to create children-only list with i18n menus, but...
so i've created my own php-snippet. and i want to place it on certain blocks of my template, or in a age conent area. existing components system is good but it is only for html code snippets.
so the question is: where i can save my php-snippets and easily connect them to certain pages.
now i just wrote this code in first lines of my template to colect children in a variable special_content. i want to place it to a snippet somehow:
Code:
$parents=array('izdeliya','sertifikaty');
$cur_slug=return_page_slug();
if (in_array($cur_slug,$parents)){
$P=array();
$i='0';
foreach(menu_data() as $el){
if($el['parent_slug']==$cur_slug){
$P[$i]['id'] = $el['menu_priority'];
$P[$i]['title'] = $el['title'];
$P[$i]['url'] = $el['url'];
$P[$i]['slug'] = $el['slug'];
}
$i+=1;
}
rsort($P);
$special_content='<div id="content" class="innerBlock">';
foreach($P as $pbl) {
$special_content.='<ul>';
$special_content.='<li><a href="'.$pbl['slug'].'">'.$pbl['title'].'</a></li>';
$special_content.='</ul>';
}
$special_content.='</div>';
it's probably could be done with i18n-menu plugin, but anyway. ehat if i have some code and i want it to be a pluggable chunk. like in mod-x evolution.