• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [SOLVED] Multiple menus with use_hierarchy set to true
PostPosted: Wed Jul 07, 2010 7:27 pm 
Offline
Forum Members
Forum Members

Joined: Wed Oct 07, 2009 10:01 pm
Posts: 16
I have a question now when use_hierarchy is removed from config.php and instead always is set to "true" in version 1.8.

From reading this forum I've learned to create additional menus by creating a new page (with alias "menu2" in my example), disable "Show in Menu" for it and then create the menu items/pages as sub-pages. The additional menu is then showed by using a tag similar to {menu template="menu2template" start_page="menu2" start_level="2"}. After upgrading to version 1.8 and thus getting use_hierarchy=true, the urls to these menu items got an unwanted prefix, i.e. /menu2/. The same goes for urls in sitemap.xml created by the SiteMapMadeSimple module.

One could use the same method to create special listings, e.g. a travel directory that has a list of countries and possibly cities in a sub-level. All these listings are affected by the use_hierarchy=true as prefixes are added to the urls.

What is the solution to this new issue that was introduced in version 1.8?


Last edited by wiseguy on Sun Aug 15, 2010 12:20 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Wed Jul 07, 2010 7:48 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
to be honest I don't know why you’re doing it that way.. but.. here is a nifty thing to note and may help save your established sites..

http://localhost/sandy_1-8-beta/how-cms ... heets.html
http://localhost/sandy_1-8-beta/templat ... heets.html

that is the same thing... try it out..

so you could just add |replace:'how-cmsms-works/':'' and that would knock it out.. Just a thought.. but I would think you need to rethink how your are approaching  your menus... I use submenus all the time and don't have this issue FWIW... hope this helps .. Cheers -Jeremy

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Wed Jul 07, 2010 8:04 pm 
Offline
Forum Members
Forum Members

Joined: Wed Oct 07, 2009 10:01 pm
Posts: 16
JeremyBASS wrote:
to be honest I don't know why you’re doing it that way..


Interesting, I had no clue that would work. So to "convert" pre-1.8 sites to 1.8 I could modify the menu templates somehow to strip out the /menu2/ part from the urls? And what about sitemap.xml generated by SiteMapMadeSimple?

Also, if you could please enlighten me with how you create your own sub-menus.

Thanks!


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Wed Jul 07, 2010 11:54 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
I'm short on time.. so let’s do it the fast way.. Can you just send screen shots of the page list expanded out.. and some samples of what your menus are now as output.. Then you can see may-be an alt way to create the same thing that works more inline with the system?  That work.. I don't have much time to spear so may-be someone else can jump in too, but menus can be pretty powerfully and flexible.  Cheers -Jeremy

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Thu Jul 08, 2010 1:28 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
ha.. is it that easy :D

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Thu Jul 08, 2010 2:28 am 
Offline
Forum Members
Forum Members

Joined: Wed Oct 07, 2009 10:01 pm
Posts: 16
Dr.CSS wrote:
Have you tried putting this back in your config file?...

$config['use_hierarchy'] = false;


I've tried it now without success, cleared cache as well.


JeremyBASS: Thanks for being helpful.

So far I've mainly used the described multiple menus method for creating footer menus which point to pages that should not be shown in the main menu, and the menus also differs in styling, e.g. horizontal with dash as separator instead of the vertical main menu.

For a project which I hope to start this week, I was about to use the same method for creating listings of countries and cities where some code and of course content will the unique for each page. I was also going to ask the forum how to sort the listings in alphabetic order, probably adding some sorting function into the menu template. And the urls should be like site.com/madrid/ or possibly site.com/spain/madrid/ but not e.g. site.com/destinations/spain/madrid/.

The more flexibility and choices you have to format the urls, the better. There's a reason behind why seo plugins are so popular for other cmses as well.


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Tue Jul 13, 2010 4:17 am 
Offline
New Member

Joined: Mon May 10, 2010 11:24 pm
Posts: 4
Hey,

I'm having the same problem, I used the same method for multiple menus and now it is showing all the children in the URL.

JeremyBASS, if you have time could you briefly explain how you avoid this issue? Or perhaps recommend a good site to read up on it?

Thanks!


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Tue Jul 13, 2010 2:36 pm 
Offline
Forum Members
Forum Members

Joined: Wed Oct 07, 2009 10:01 pm
Posts: 16
I posted a code change that works for my sites, and asked for comments on it, but the whole post was quickly removed by some anonymous moderator.

Please, can anyone here at least tell me what's wrong with discussing possible solutions?


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Tue Jul 13, 2010 2:41 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 5954
Location: Fernie British Columbia, Canada
See what's in the forum rules.

_________________
Follow me on twitter
For quality help follow these instructions:
a) Think about the problem for an hour
b) research the problem for an hour
c) spend 1/2 an hour explaining it and providing as much information as you can muster
(too much information is okay, not enough information may get your question ignored).
--
if you can't bother explaining your problem well, why should we bother helping with it.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Tue Jul 13, 2010 4:03 pm 
Offline
Forum Members
Forum Members

Joined: Wed Oct 07, 2009 10:01 pm
Posts: 16
calguy1000 wrote:
See what's in the forum rules.


All right, got it. We're not allowed to discuss code examples in the forum, at least not if it has to do with the core.

It would be highly appreciated if anyone can suggest a pragmatic approach for finding an alternative non-hierarchical url solution (which does not require changes to the core).


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Fri Jul 16, 2010 7:41 pm 
Offline
New Member

Joined: Mon May 10, 2010 11:24 pm
Posts: 4
Hey, did you solve the problem? I'm still stuck on this.


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Fri Jul 16, 2010 11:31 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Sat Aug 25, 2007 9:55 am
Posts: 1176
Location: Berlin
i had the idea of a walkaround for this issue. in your menutemplate, replace
Code:
href="{$node->url}"

with
Code:
href="{$node->alias}.html"


modify file prefix.
i would recommend the use of canonical urls:
Code:
{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{root_url}/{$content_obj->mAlias}.html" />{/if}

because both, the hierarchy urls and the new urls still coexists. and therefore you have to tell google the right url! this is canonical url!

hope this helps!

_________________
follow me on twitter
---
find great code snippets at i-do-this blog
---
powerful templates for cms made simple


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Mon Jul 26, 2010 3:20 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Oct 17, 2007 6:09 pm
Posts: 227
Location: the world
This workaround mind be Ok for the Menus.
However, the {cms_selflink} tag used in the content of the pages will produce not-wanted URLs

_________________
http://FollowTheRoad.com/ - living on the road...
http://www.kligys.com/ - asmeninis blog'as...


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Mon Jul 26, 2010 1:39 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Jul 27, 2007 4:15 pm
Posts: 118
Location: Canada
I have read the few other threads about this.

Besides the issue of hacking core files is this the best way? what about other instances of href="{$node->url}" and in other places/templates?

or is there 'more official' way of having www.mydomain.com/alias.php


Top
 Profile  
 
 Post subject: Re: Multiple menus with use_hierarchy set to true
PostPosted: Sat Aug 07, 2010 9:31 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Oct 19, 2005 1:13 pm
Posts: 432
Location: Germany - Nbg.
An unofficial, but easier way is the usage of a smarty output filter, which deletes the unwanted hierarchy from the html code. I don´t know how long this will work with new cmsms versions and I don´t know which modules should be defined as exceptions, but you can download a beta version of the plugin from my german (commercial) website. A short english readme.txt is in the zip-file.

At the moment I only couldn´t find a solution for my xml-sitemap (gsitemap.php) as it doesn´t use smarty.


Last edited by LeisureLarry on Sat Aug 07, 2010 12:39 pm, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: misstheresa2009


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner