How To Change Home Button URL

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
grumpy
New Member
New Member
Posts: 3
Joined: Wed Apr 26, 2023 4:42 pm

How To Change Home Button URL

Post by grumpy »

I am struggling with trying to change the URL of the top menu home button. In Other CMS systems, such as Joomla, this is very simple to do, as you can directly edit the link that is associated with any button, but with CMSMS you seemly need to jump through hoops to make this change, as all of the links are relative to the document root that you set in the config.php file. In this case, the site in question is a subdomain, and I need to have the HOME button return users to the top level site, not the document root of the subdomain. Can someone provide very specific instructions on how to accomplish this change?

Many thanks in advance for any assistance in resolving this.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1630
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: How To Change Home Button URL

Post by DIGI3 »

If I'm understanding your issue correctly, this is more a functionality of pretty urls than the cms, which is usually handled in your .htaccess file. This is from the sample htaccess provided in the docs folder:

# If your CMSMS installation is in a subdirectory of your domain, you need to specify the relative path (from the root of the domain) here.
# In example: RewriteBase /[subdirectory name]
RewriteBase /
Not getting the answer you need? CMSMS support options
grumpy
New Member
New Member
Posts: 3
Joined: Wed Apr 26, 2023 4:42 pm

Re: How To Change Home Button URL

Post by grumpy »

Thank you for your response. Your understanding is correct that the site in question is a subdomain of my TLD domain.com and it physically resides as a sub-directory of the document root of the TLD domain on the server, ie. /mytld.com/mysubdomain. Unfortunately, your suggestion does not seem to have any impact whatsoever on the url associated with the home button located in the top menu bar of the subdomain. If I hover over that home button, the associated link is https://subdomain/mytld.com, and having made your suggested entry in the .htaccess file located in the document root for the subdomain, when I click on the home button it does not rewrite that URL in any way.

As a possible solution for this as well as for future reference, how would one go about hard coding a fully qualified URL for a menu button to a URL that was a 3rd party site for a menu button or page in CMSMS? For example, if I wanted to have a menu button point to https://google.com, how would I do that? This sort of thing really aught to be very simple, and is, with other CMS systems that I am familiar with, but thus far I have failed to find any easy way to accomplish this with CMSMS, short of actually changing code that would no doubt get overwritten the first time you save something from the GUI.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1630
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: How To Change Home Button URL

Post by DIGI3 »

The navigation, assuming you're using Navigator or Menu Manager, is generated from the pages in Content Manager. So to have a link to an external site (such as google.com) you'd create a page with the content type "Redirecting link". This will give you some basic, self-explanatory fields. The generated menu respects the hierarchy in Content Manager, so reorder the pages to where you want them to appear in the navigation.

Edit: I just reread your original question and my apologies, I misunderstood it the first time. Although that change will help with the pretty urls of the internal page links, the above is what you want for an external link (the site in the parent folder is considered external).
Not getting the answer you need? CMSMS support options
grumpy
New Member
New Member
Posts: 3
Joined: Wed Apr 26, 2023 4:42 pm

Re: How To Change Home Button URL

Post by grumpy »

No worries, and thank you for confirming my suspicions. From the beginning I suspected that owing to the way that CMSMS uses links relative to the document root that is set in config.php, that it would be necessary to treat anything outside of that document root as an external site.
Post Reply

Return to “CMSMS Core”