Is there a better way of getting the path in my layouts? Most of the examples just path out the assets but that won’t work for ses urls so I am just wondering if there is a better approach.
Catalog Admin LayoutOne option is to build that functionality into your request context decorator.
Then in your views, you could do something like
<link rel="stylesheet"
href="#event.getSESBaseURL()#includes/css/blueprint/screen.css"
type="text/css" media="screen, projection">
That way, the logic is encapsulated in in your request context.
- Gabriel
Ahh, makes sense, thank you!
Is this a Module or standard convention?
Modules you can use the getModuleRoot().
Regards,
Andrew Scott
Andy…this is a regular layout, I found the getModuleRoot() for the modules!
Thanks
I will have to try that in a sec…does that get html or ses url?
Andy - I couldn’t find a getBaseURL() there is a htmlBaseURL() and sesBaseURL though so my layout looks like this. Is that others are doing?
<cfif event.isSES()>
I'd move whatever logic you need to the request context decorator.
Then you can do something like:
<link rel="stylesheet"
href="#event.myGetBaseURLFunction()#includes/css/blueprint/screen.css"
type="text/css" media="screen, projection">
where myGetBaseURLFunction() has whatever logic you need.
- Gabriel
Your speaking over my head now Andy
Lol, I went looking for your original question here. But can’t seem to find it.
Can you remind me what it was you are trying to do again.
Regards,
Andrew Scott
This is what I am doing in my layout so that my paths are right for all assets… is there a better way to do this
<cfif event.isSES()>
I would have thought this would be sufficient
<cfset baseURL = getSetting(‘htmlBaseURL’) />
Regards,
Andrew Scott
I was just trying to make it dynamic so you could switch back and forth if need be