Tag that would return page name/id/url ?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
booo9
Forum Members
Forum Members
Posts: 20
Joined: Tue Jan 01, 2013 8:26 pm

Tag that would return page name/id/url ?

Post by booo9 »

In my page template (for all pages of my site) I created some custom javascript that needs to know page context, that is the page id or page alias or page URL, so the script can do different things depending on which page the script is executed.

Is there any {} tag that would insert page URL or page alias or page ID ?

e.g,

<span id="pageid">{page-alias}</span>
or
<span id="pageid">{page-ur}</span>

that would expand to
<span id="pageid">about</span>
<span id="pageid">http://mysite.com/index.php?page=about</span>

then in my script I could use jquery to get the value of #pageid element to establish the page context for the script.

cheers.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Tag that would return page name/id/url ?

Post by Wishbone »

page alias: {$page_alias}
current URL: {cms_selflink href=$page_alias}
booo9
Forum Members
Forum Members
Posts: 20
Joined: Tue Jan 01, 2013 8:26 pm

[solved] Tag that would return page name/id/url ?

Post by booo9 »

{cms_selflink href=$page_alias} <= that is beautiful !

thanks wishbone
Post Reply

Return to “Modules/Add-Ons”