system-asset tag issue
Hi,
I have a block that contains a bunch of html link elements (for css files), and it's added to the head of all pages in a site through a template region. I have all the links using the site path, however I also need it to have the site's destination as well. For example, I have a link like so:
<system-xml>
<link href="/path/to/asset.css" rel="stylesheet" />
</system-xml>
I need to append the site destination to the beginning of every link in the block, like so:
<system-xml>
<link href="/parent/folder/path/then/path/to/asset.css" rel="stylesheet" />
</system-xml>
I know the [system-asset] tag does this, however it doesn't seem to work when I have the block inside the site I have the links pointing to. Is there any way around this issue, or will I need to hard code all the links?
Thanks!
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Tim on 12 Aug, 2016 08:55 PM
Hi Adam,
Are you just looking for an absolute link as opposed to a relative one? If so, try editing one of your Pages containing these links and click on the System pane. Under it, check the 'Maintain absolute links when publishing' check box and then click Submit.
Then, try publishing that Page and let me know if those types of links are what you're looking for.
Thanks
2 Posted by Adam on 12 Aug, 2016 09:05 PM
Thanks for the quick reply Tim!
I have tried what you suggested, however it's outputing:
instead of:
Support Staff 3 Posted by Tim on 12 Aug, 2016 09:10 PM
Ah, OK. It sounds like this feature describes the functionality you're looking for. Can you confirm?
If that is indeed the case, I do think you'll need to hard code those values.
Let me know.
Thanks
4 Posted by Adam on 15 Aug, 2016 12:17 PM
Yeah, unfortunately, that's the functionality I was looking for. I've hardcoded all the links, however because of that, none of the css renders inside cascade. I have tried this:
However it doesn't appear to work, does the [system-view] tag not work inside an href?
Thanks!
Support Staff 5 Posted by Tim on 15 Aug, 2016 01:21 PM
For the CSS to work inside Cascade, you can use a combination of both tags. For example, try something like this:
This should force the system to use the normal rewriting process internally, but use your fully qualified path once published.Give that a shot and let me know if it helps.
Thanks!
6 Posted by Adam on 15 Aug, 2016 03:02 PM
I knew that was possible, and it does works. I was hoping I wouldn't have to have two links for each css file, but that seems like the only way to get the css to render inside cascade and on the server.
Thanks for the help Tim!
Support Staff 7 Posted by Tim on 15 Aug, 2016 03:03 PM
You bet, Adam! Have a good one.
Tim closed this discussion on 15 Aug, 2016 03:03 PM.