Hi
I am trying to create mini sub sites with their own domain names which I have done using mod rewrite. In the template there is a base href with the sub sites domain name so that all content links which are relative work fine and keep the sub sites domain name in the browsers address bar. The problem is with the menu manager as it writes it's URL's as absolute and takes the root url from the config.php file which cannot be changed otherwise the system doesn't work.
Does anyone know the best way to overcome this presumably one can edit the way menu manager works so that it does not use absolute URL's but relative ones?
All and any help much appreciated.
[SOLVED] How To Change Menu Manager To Write Links As Relative URL's ?
[SOLVED] How To Change Menu Manager To Write Links As Relative URL's ?
Last edited by applejack on Thu Sep 27, 2007 2:53 pm, edited 1 time in total.
Re: How To Change Menu Manager To Write Links As Relative URL's ?
Another option would be to do a pattern replace in the menu manager template something like below but I do not know how or where to write this correctly as I am not a PHP coder.
$node->url = str_replace('http://domain_name/',"'', "$node->url")
$node->url = str_replace('http://domain_name/',"'', "$node->url")
Re: How To Change Menu Manager To Write Links As Relative URL's ?
Try with:applejack wrote: Another option would be to do a pattern replace in the menu manager template something like below but I do not know how or where to write this correctly as I am not a PHP coder.
$node->url = str_replace('http://domain_name/',"'', "$node->url")
{$node->url|replace:'http://domain_name/':''}
Alby
Re: How To Change Menu Manager To Write Links As Relative URL's ?
Hi Alby
Thanks, where do I write this in the menu manager template as it works in that it does strip out the domain name but shows up on the page as text.
Thanks, where do I write this in the menu manager template as it works in that it does strip out the domain name but shows up on the page as text.
Re: How To Change Menu Manager To Write Links As Relative URL's ?
Alby
P.S. OK I have manged to sort it out. Thanks for your help.
P.S. OK I have manged to sort it out. Thanks for your help.
Re: [SOLVED] How To Change Menu Manager To Write Links As Relative URL's ?
Dear Applejack or others,
Could you please elaborate a bit more about how you have solved this issue?
thx Niels
Could you please elaborate a bit more about how you have solved this issue?
thx Niels
Re: [SOLVED] How To Change Menu Manager To Write Links As Relative URL's ?
Hello,
it is a use of a Smarty operator in the menu template if I have understood well.
Smarty : Smarty doc.
Menu template : CMSms doc.
Hope it helps and is true
Pierre M.
it is a use of a Smarty operator in the menu template if I have understood well.
Smarty : Smarty doc.
Menu template : CMSms doc.
Hope it helps and is true

Pierre M.
Re: [SOLVED] How To Change Menu Manager To Write Links As Relative URL's ?
In the menu manger where it has href="{$node->url}" do href="{$node->url|replace:'http://domain_name/':''}" this will then replace the absolute URL i.e. the domain name with an empty string therefore giving you a relative URL.
Re: [SOLVED] How To Change Menu Manager To Write Links As Relative URL's ?
Thanks guys,
Strange but i changed the href="{$node->url}" to href="{$node->url|replace:'http://domain_name/':''}" but nothing happens
. I did it in my active menu template (simple_menu.tpl) is that ok?
Any help is very much appreciated..
Cheers Niels
Strange but i changed the href="{$node->url}" to href="{$node->url|replace:'http://domain_name/':''}" but nothing happens

Any help is very much appreciated..

Cheers Niels