CMS Made Simple Forums
https://forum.cmsmadesimple.org/

Option to hide pages from Site Mapper
https://forum.cmsmadesimple.org/viewtopic.php?f=16&t=56606
Page 1 of 2

Author:  gocreative [ Tue Sep 06, 2011 2:23 am ]
Post subject:  Option to hide pages from Site Mapper

I'd like to see an option on each page titled 'Show in site map' (checked by default).

I have several 'Thank you' pages on my site which I want to be 'active' so that they can be seen after submitting the relevant form, but I don't want to display them in the primary navigation. I can achieve both of these things with the current settings, however they then appear in the site map using {site_mapper}.

At present there's no way to hide certain pages from the site mapper except for manually entering the page alias and using some Smarty logic. This is obviously not ideal.

Author:  uniqu3 [ Tue Sep 06, 2011 5:46 am ]
Post subject:  Re: Option to hide pages from Site Mapper

site_mapper is MenuManager basically, so if a page is set to "Show in menu" it is shown in site_mapper.
If parameter "showall" is enabled all pages will be shown, means also pages that have option "Show in menu" unchecked.

The tag {site_mapper} might sound as some standalone module but basically you don't have to use that tag as it is the same as if you were using {menu} and following MenuManager help and parameter options.

Author:  gocreative [ Tue Sep 06, 2011 5:53 am ]
Post subject:  Re: Option to hide pages from Site Mapper

But doesn't that mean there should be a better way? The only way I thought of doing it was adding a bit of text (e.g. 'hide') into one of the 'Extra1/2/3' attributes, but that means you can't use those fields for other information.

Anyway, it's just an annoyance of mine that there's no quick way to generate a site map and hide particular pages from it, but keep them active and/or in the site navigation.

Author:  uniqu3 [ Tue Sep 06, 2011 6:04 am ]
Post subject:  Re: Option to hide pages from Site Mapper

Yes, extra attributes would be an option for that.
You might want to submit a FR in Forge and see what happens.

Persoanlly i wasn't in a situation where i had to hide a page in Sitemap which was marked as "show in menu" but you could have a valid point.

Author:  gocreative [ Tue Sep 06, 2011 6:15 am ]
Post subject:  Re: Option to hide pages from Site Mapper

It's more about the pages that aren't in the menu, but are active (thank you pages, generally). Therefore I don't want them in the site map, even though users can see them after they submit forms.

Author:  uniqu3 [ Tue Sep 06, 2011 6:26 am ]
Post subject:  Re: Option to hide pages from Site Mapper

As mentioned above {site_mapper} has the same behavior as {menu} so if a page is set to "show in menu" it will appear in sitemap else not.

With parameter show_all="1" pages that were set to not show in menu will still be shown, if set to "0" then behavior should be the same as {menu}.
Active/Inactive pages should not show at all, no matter of Menu or Sitemap setting.

Author:  gocreative [ Tue Sep 06, 2011 6:46 am ]
Post subject:  Re: Option to hide pages from Site Mapper

I'm possibly just confusing myself here, but I've got some pages with the following settings:

Show in menu: No
Active: Yes
Display on site map: Yes (e.g. a campaign page that users should only find via search engines/advertising)

Then I also have some other pages with:

Show in menu: No
Active: Yes
Display on site map: No (e.g. the site map itself)

How would I approach this?

Author:  uniqu3 [ Tue Sep 06, 2011 6:50 am ]
Post subject:  Re: Option to hide pages from Site Mapper

Did you try with {menu show_all="0" template="site-map"}?

Author:  gocreative [ Tue Sep 06, 2011 6:51 am ]
Post subject:  Re: Option to hide pages from Site Mapper

uniqu3 wrote:
Did you try with {menu show_all="0" template="site-map"}?

Sorry, I've edited my message...

Author:  uniqu3 [ Tue Sep 06, 2011 6:57 am ]
Post subject:  Re: Option to hide pages from Site Mapper

{site_mapper show_all='1' exculdeprefix='sitemap'}

Author:  gocreative [ Tue Sep 06, 2011 7:04 am ]
Post subject:  Re: Option to hide pages from Site Mapper

There are multiple pages that will need to be selectively hidden, and multiple that will need to selectively be shown.

I'm sure this isn't a scenario that comes up often, but it's still not easy. Plus, it would be a lot easier to simply check a box than have to edit the function call every time I create/edit/change the alias of a page.

Author:  uniqu3 [ Tue Sep 06, 2011 7:10 am ]
Post subject:  Re: Option to hide pages from Site Mapper

Quote:
I'm sure this isn't a scenario that comes up often, but it's still not easy


Exactly thats why i hardly can see it comming into core, it is not common and i didn't see anyone else asking for it.
You can still try to submit a FR and see if it makes into core.

Quote:
Plus, it would be a lot easier to simply check a box than have to edit the function call every time I create/edit/change the alias of a page.


Alias shouldn't be changed that offten (think of SEO and Search engine indexing, then you need to redirect that page every time you change it's alias), but still you can use "content_id" that way no matter what you alias is, content id number will never change.
When you edit a page you will see content id in the url bar or when hovering over a page link in backend, so simply enter exculdeprefix='32' for example.

Author:  gocreative [ Tue Sep 06, 2011 7:20 am ]
Post subject:  Re: Option to hide pages from Site Mapper

Yeah, I was mainly thinking about my scenario and whether others would have the same problem. Imagine a site with 200 pages and more created every day, having to go and add that page ID to the list rather than just ticking a box when creating the page.

Author:  cpansewicz [ Thu Jun 21, 2012 12:36 am ]
Post subject:  Re: Option to hide pages from Site Mapper

Is this something that you figured out at all? I would like to be able to do this as well.

Author:  gocreative [ Thu Jun 21, 2012 12:48 am ]
Post subject:  Re: Option to hide pages from Site Mapper

I never found a simple solution, but I worked around it by using

Code:
{site_mapper show_all="1"}

and manually entering page aliases into the menu template like this:

Code:
{if $node->alias neq "search-results" && $node->alias neq "site-map" && $node->alias neq "thank-you1" && $node->alias neq "thank-you2" && $node->alias neq "thank-you3"}

   <li><a href="{$node->url}"><span>{$node->menutext}</span></a>

{/if}

Page 1 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/