if page alias is not working

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.
Locked
jollyoner3
New Member
New Member
Posts: 9
Joined: Wed Feb 13, 2019 12:46 pm

if page alias is not working

Post by jollyoner3 »

Hi guys, trying to use a javascript on certain pages, inserted into the "head" template file which is used on every page.

I tried :

Code: Select all

{if $page_alias = 'about-us'}
But it posts to every page regardless, am i missing something?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: if page alias is not working

Post by calguy1000 »

Code: Select all

{if $page_alias == 'about-us'}
WOOT
{/if}
== is a comparison operator = is an assignment operator.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
jollyoner3
New Member
New Member
Posts: 9
Joined: Wed Feb 13, 2019 12:46 pm

Re: if page alias is not working

Post by jollyoner3 »

Thankyou very much for the reply!

It works when i use single alias, how would i do something like this :

Code: Select all

{if $page_alias == 'about-us, home, contact-us'}
MantaPro
Forum Members
Forum Members
Posts: 97
Joined: Sun Feb 03, 2008 8:14 pm

Re: if page alias is not working

Post by MantaPro »

Code: Select all

{if $page_alias == 'about-us' || $page_alias == 'home || $page_alias == 'contact-us'}
https://www.smarty.net/docs/en/language.function.if.tpl
Last edited by MantaPro on Wed Apr 17, 2019 9:53 pm, edited 1 time in total.
jollyoner3
New Member
New Member
Posts: 9
Joined: Wed Feb 13, 2019 12:46 pm

[SOLVED]Re: if page alias is not working

Post by jollyoner3 »

Thankyou! :) Sorted it
Locked

Return to “CMSMS Core”