Geting url data Topic is solved

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
andrewvideouk
Forum Members
Forum Members
Posts: 155
Joined: Thu Aug 20, 2020 10:49 pm

Geting url data

Post by andrewvideouk »

I have a created a page in CMSMS and I would like to get information from the URL for example

I have a page at https://www.website.com/page

I have noiced if I do something like https://www.website.com/page?#44faa6d7 is still go the page. That all good.

I want to get the ?#44faa6d7 part or url and add it to a variable so I can use it in a template.

What is the best way of doing this.

Thank you and happy new year
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1610
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Geting url data

Post by DIGI3 »

It's hard to tell if you're trying to get a url parameter or an anchor, as your example seems to be a mix of both. For a url parameter (?foo=bar) you can use {$smarty.get.foo}

If you're trying to get the anchor (#foo) then you'll probably need to use javascript as that information isn't sent to the server.

url parameters can't contain '#', that's reserved for anchors.
Not getting the answer you need? CMSMS support options
andrewvideouk
Forum Members
Forum Members
Posts: 155
Joined: Thu Aug 20, 2020 10:49 pm

Re: Geting url data

Post by andrewvideouk »

Thank you very much, That worked,
Post Reply

Return to “CMSMS Core”