Diagram Template tags that can go anywhere in a template..
all this method are int the class DiagramTag
diagram
get the current page diagram
<?php
echo DiagramTag::diagram()->id; // get current diagram id
echo DiagramTag::diagram()->title; // get current diagram title
echo DiagramTag::diagram()->uri; // get current diagram uri
echo DiagramTag::diagram()->content; // get current diagram content
?>
you can also get the diagram you want
<?php
echo DiagramTag::diagram(array('uri'=>'about'))->id; // get the diagram by uri
echo DiagramTag::diagram(array('uri'=>'about'))->title;
echo DiagramTag::diagram(array('id'=>2))->content; // get the diagram by id
?>mainmenu_as_ul
get the site mainmenu as ul
<?php
echo DiagramTag::mainmenu_as_ul();
?>
it will output:
<ul>
<li><a href="/">Home</a></li>
<li class="selected"><a href="/about">About</a></li>
<li><a href="/news">News</a></li>
</ul>
mainmenu_as_array
get the mainmenu as array
<?php
foreach(DiagramTag::mainmenu_as_array() as $menu) {
echo $menu->title;
}
?>submenu_as_ul
get the current diagram's submenu as ul
<?php
echo DiagramTag::submenu_as_ul();
?>
it will output:
<ul>
<li class="selected"><a href="/about">About</a></li>
<li><a href="/contact">contact</a></li>
</ul>
submenu_as_array
get the current diagram's submenu as array
<?php
foreach(DiagramTag::submenu_as_array() as $submenu) {
echo $submenu->title;
}
?>position_as_span
get the user current position of this site
<?php
echo DiagramTag::position_as_span();
?>
it will output:
<span id="position" class="position"><span id="position_title" class="position_title">current position:</span><a href="/index.php/">Home</a> > <a href="/index.php/about">About</a> > <a href="/index.php/about">About us</a></span>
all_as_ul
output the whole diagram list as ul
lazy_content
output current page content as a lazy way it will automatic judge whether this page is a list , a page or a post, and output this content.
is_page
check current page is a valid page
is_diagram
check current page is a valid diagram