Page 1 of 1

sitemap tag

Posted: Wed Jun 20, 2007 7:36 am
by soulja90
Can I use the sitemap tag just show it shows all the links under a particular category?

Re: sitemap tag

Posted: Wed Jun 20, 2007 8:59 am
by Pierre M.
Hello,

Admin panel -> Extensions -> Tags.
See the sitemap line, clic "help". It shows :

What does this do?

Prints out a sitemap.
How do I use it?

Just insert the tag into your template/page like: {sitemap}
What parameters does it take?

    * (optional) class - A css_class for the ul-tag which includes the complete sitemap.
    * (optional) start_element - The hierarchy of your element (ie : 1.2 or 3.5.1 for example). This parameter sets the root of the menu. You can use the page alias instead of hierarchy.
    * (optional) number_of_levels - An integer, the number of levels you want to show in your menu. Should be set to 2 using a delimiter.
    * (optional) delimiter - Text to separate entries not on depth 1 of the sitemap (i.e. 1.1, 1.2). This is helpful for showing entries on depth 2 beside each other (using css display:inline).
    * (optional) initial 1/0 - If set to 1, begin also the first entries not on depth 1 with a delimiter (i.e. 1.1, 2.1).
    * (optional) relative 1/0 - We are not going to show current page (with the sitemap) - we'll show only his childs.
    * (optional) showall 1/0 - We are going to show all pages if showall is enabled, else we'll only show pages with active menu entries.
    * (optional) add_elements - A comma separated list of alias names which will be added to the shown pages with active menu entries (showall not enabled).

I bet start_element and number_of_levels are your friends.

Pierre M.

Re: sitemap tag

Posted: Wed Jun 20, 2007 10:22 am
by soulja90
Thanks Pierre,

Can you roll that into an example for this newbie please:)

Like how would I use that tag?

Can you show some examples please. Thansk

JB

Re: sitemap tag

Posted: Wed Jun 20, 2007 10:31 am
by Pierre M.
something like {sitemap start_element="2.2" number_of_levels="3"}
or {sitemap start_element="aboutus" number_of_levels="3"}

Pierre M.

Re: sitemap tag

Posted: Wed Jun 20, 2007 2:46 pm
by RonnyK
I use

Code: Select all

{sitemap start_element="uitslagen-standen" relative=1}
to start at the content-page="uitslagen-standen" and relative=1 to only show the children and NOT the parent "uitslagen-standen" as well.

Ronny

Re: sitemap tag

Posted: Thu Feb 28, 2008 9:02 pm
by scoutman57
Is there a ways to set a limit range on the sitemap tag?

i.e:
i want all elements from 1.1 - 3.5.2
{sitemap start_element="1.1" end_element="3.5.2"}
and then i want to new sitemap
5.1 - everything remaining.
{sitemap start_element="5.1"}


I am trying to exclude 4.1 - 4.3.1 (the start of 4 to the end of the deepest level in 4
{sitemap start_element="2.2"}

I know end_element is not a tag, but used it for a example of what I would like to do.

Re: sitemap tag

Posted: Fri Feb 29, 2008 3:50 pm
by Pierre M.
Hello,

workaround : put 4 {sitemap ...} tags, one for 1, one for 2, one for 3 and 1 for 5, hence excluding 4.

Pierre M.

Re: sitemap tag

Posted: Tue Mar 04, 2008 8:28 pm
by scoutman57
I have written a function for this that removes everything starting at the keyword you put in the end_element parameter. This works after the sitemap is converted to html and right before the return $menu.

I have not figured out how to do this before while its in the array, like the number_of_levels and start_element. Still learning how those functions work. Have not worked with smarty to much.

Re: sitemap tag

Posted: Wed Mar 05, 2008 9:59 pm
by scoutman57
Well the function i had only works for if you want to end the site map as a set function, but will not allow you to use multi sitemap functions in one page

Pierre M. suggested using 4 sitemap calls and
{sitemap start_element1}
{sitemap start_element2}
{sitemap start_element4}
{sitemap start_element5}

This does not work because none of them have a end element so it would just repeat the sitemap over and over just at different start points.

What would be nice is a feature that allowed you to exclude parents or childs from the site map. Or a true end_element. Then using the 4 sitemap functions could work.

I am new to smarty and to cms made simple so its taking some time to figure out, or I would just have it written.

This feature would come in handy to hide things like all the child links in the Media Releases Parent Link.

Does anyone have  a work around for this?

Re: sitemap tag

Posted: Thu Mar 06, 2008 3:55 pm
by Pierre M.
The {menu ...} tag has exclude and deals within a branch of the hierarchy. May be you can make {sitemap2 ...} from it ?

Pierre M.

Re: sitemap tag

Posted: Thu Mar 06, 2008 4:39 pm
by calguy1000
The sitemap plugin is irrelevant.... all of its functionality can be mimicked, and done better by using the {menu} module and custom menu templates.

It just takes some time.