sitemap tag

General project discussion. NOT for help questions.
Post Reply
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

sitemap tag

Post by soulja90 »

Can I use the sitemap tag just show it shows all the links under a particular category?
Pierre M.

Re: sitemap tag

Post 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.
soulja90
Forum Members
Forum Members
Posts: 83
Joined: Tue Mar 13, 2007 10:56 pm

Re: sitemap tag

Post 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
Pierre M.

Re: sitemap tag

Post 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.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: sitemap tag

Post 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
scoutman57
New Member
New Member
Posts: 5
Joined: Tue Jan 22, 2008 9:13 pm

Re: sitemap tag

Post 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.
Pierre M.

Re: sitemap tag

Post 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.
scoutman57
New Member
New Member
Posts: 5
Joined: Tue Jan 22, 2008 9:13 pm

Re: sitemap tag

Post 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.
scoutman57
New Member
New Member
Posts: 5
Joined: Tue Jan 22, 2008 9:13 pm

Re: sitemap tag

Post 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?
Pierre M.

Re: sitemap tag

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: sitemap tag

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “General Discussion”