Is it possible to create a custom system variable that can be used in any page template?
Announcement
Collapse
No announcement yet.
How to create a custom system variable
Collapse
X
-
I'm just wondering if you mean a global variable versus a system variable as they have different scope and availability?
Brennan - Can he create system variables from global headers, htaccess or miva_config?
Comment
-
Thanks the responses. I was looking for a way to remove a repetitive IF statement. Rendering a global variable in the head tag doesn't work because I need to call this before the global header is called.
Code:<mvt:if expr="s.http_host EQ 'www.domain.com'"> <mvt:assign name="l.useURL" value="'https://www.otherDomain.com/miva/'" /> <mvt:else> <mvt:assign name="l.useURL" value="'https://dev.otherDomain.com/miva/'" /> </mvt:if> <mvt:call ACTION="l.useURL $ 'template/' $ l.settings:page:code $ '/' $ g.objectId" METHOD="'GET'"> <mvt:assign name="g.jsonData" value="s.callvalue" /> </mvt:call>
Comment
-
Code:<mvt:assign name="g.http_host" value="s.http_host" /> <mvt:if expr="g.http_host EQ 'www.domain.com'"> <mvt:assign name="l.useURL" value="'https://www.otherDomain.com/miva/'" /> <mvt:else> <mvt:assign name="l.useURL" value="'https://dev.otherDomain.com/miva/'" /> </mvt:if> <mvt:call ACTION="l.useURL $ 'template/' $ l.settings:page:code $ '/' $ g.objectId" METHOD="'GET'"> <mvt:assign name="g.jsonData" value="g.jsonData $ s.callvalue" /> </mvt:call>
Comment
-
and use the HTML Profile section for stuff like this, just make sure if AFTER the doctype.
the Head template, <head> gets appended with a bunch of stuff before the Head Template is rendered.Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
Comment