Losing asset links after publish.

dburfield's Avatar

dburfield

10 Aug, 2010 01:11 PM

We took the 2 day Cascade Server training last month. I’m wrapping up my first project in the CMS and am having a difficult time setting the asset links to all my assets in the “_files” folder. I’ve been appending the templates which contain the CSS and JS references with some code I found in the HH help pages.

Our CMS site(s) are set up with our base folder which includes all the assets and templates as well as some test pages. The client is creating a new “site” per each department in their college. A completed site I’m using for reference has each department in the same site but individual folders. Their reference links assets work.

So we decided to replicate the assets and move them to a global assets “site” so that all sites could reference them globally. The client is creating the sites and pages via templates in the base site and then publishing them to their server destination.

Here is an example of the asset links I’ve passed and what the CMS appends the string to upon a publish.

Same links per 2 sites:

<link href="/_files/css/uwScreen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="site://CMS-INCLUDES/_files/css/uwScreen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="[system-asset:local]/_files/css/uwScreen.css[/system-asset:local]" media="screen" rel="stylesheet" type="text/css"/>
<link href="site://[CMS-INCLUDES]/_files/css/uwScreen.css[/CMS-INCLUDES]" media="screen" rel="stylesheet" type="text/css"/>

When I published a page residing in our base site (same site containing the templates), "www.uwyo.edu" here are the paths the system wrote:

<link href="../_files/css/uwScreen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="D:\WEBSERVERS\CMS-INCLUDES/_files/css/uwScreen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="../_files/css/uwScreen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="_files/css/uwScreen.css[/CMS-INCLUDES]" media="screen" rel="stylesheet" type="text/css"/>

When I published a page from CMST1TEST using the templates from our base site, "www.uwyo.edu", here are the paths the system wrote:

<link href="www.uwyo.edu/_files/css/uwScreen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="D:\WEBSERVERS\CMS-INCLUDES/_files/css/uwScreen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="" media="screen" rel="stylesheet" type="text/css"/>
<link href="_files/css/uwScreen.css[/CMS-INCLUDES]" media="screen" rel="stylesheet" type="text/css"/>
  1. Support Staff 1 Posted by Tim on 10 Aug, 2010 01:17 PM

    Tim's Avatar

    Hi Dan,

    Try editing your comment, then find your code and use the formatting available to you. You will need to indent any code sections with 4 spaces.

    EDIT Dan, I went ahead and modified your comment for you.

  2. 2 Posted by Penny on 10 Aug, 2010 02:08 PM

    Penny's Avatar

    Hey Dan,

    I see a few possible issues here. But for clarification, I am assuming that the first code block provided is what you have in Cascade. The second code block is from pages after being published from your "base site". The third code block is from pages after being published from your "CMST1TEST" site.

    I believe that for the first link, the URL in the Site Management section on your "base site" needs to be updated to "http://www.uwyo.edu". If you are test publishing this to another location and need to test the cross site linking, you will need to temporarily change this field to that test path of where your Base Site contents is publishing. Be sure to put http:// if that is in the address bar. This field is used to append to any urls in a different site than the file.

    On the second link, I am guessing the URL in the Site Management section for CMS-INCLUDES site is entered as "D:\Webservers\CMS-INCLUDES", this will need to be updated to the URL of where ever you are actually publishing these files if D:\Webservers\CMS-INCLUDES is not correct.

    On the third link, you use the "system-asset:local" tags. This means that that particular file needs to be within each specific site. I am guessing that in CMST1TEST, that "/_files/css/uwScreen.css" does not exist. That is why Cascade would resolve the link to nothing in your CMST1TEST pages. I am guessing it exists in your "base site" only.

    As for the fourth link, I think there may be a syntax error here. I have never seen a "CMS-INCLUDES" tag for Cascade.

    I hope this helps. I would also suggest reviewing the following page in the knowledge base which deals with the system-asset:local tag: http://www.hannonhill.com/kb/Linking/

  3. 3 Posted by dburfield on 11 Aug, 2010 07:52 PM

    dburfield's Avatar

    Thank you for your reply. This is basically what we're trying to achieve:
    I have a base site where I created assets, templates and some test pages. When I publish any page from within this site, the assets are linked and everything looks as it should.

    Client is creating hundreds of new sites and pages within those sites which are using my base site templates and assets. It looks fine to them in the CMS but upon publish, the assets disappear and aren't linked. I went through the help files and found no documentation directing me how to achieve this. I posted the several ways I've tested and the several outputs Cascade has appended my links.

    The client is publishing to different servers for the testing. On these servers I have published the assets. We have even attempted a global assets site called CMS-INCLUDES to point to in hopes an asset link could be achieved. I have found that editing the link to the relative path, "/_files/css..." would work but every time I publish, Cascade prefixes with the base site "www.uwyo.edu" and it fails.

    Thoughts?

  4. 4 Posted by Penny on 11 Aug, 2010 08:31 PM

    Penny's Avatar

    If it works in Cascade and breaks on Publish there is an issue with the URL provided in the Site Management section to where you are publishing your "base site" and/or the file does not exist where the system is looking for it.

    For the first scenario: the URL provided is pre-pended to links in your Additional sites that reference another Site's CSS and other files. That is why your 1st link is rewritten to "www.uwyo.edu/_files/css/uwScreen.css" in your additional Site. I just checked through my browser and your CSS is not located there. So you will need to update your URL from "www.uwyo.edu" to whereever you are currently publishing it. We generally do this when publishing to a test site.

    In order to change the URL being prepended, in the top left of Cascade, you should see a swirly icon button. Click on that - > Click on Site Management -> Click on the base site from the list - > Click Edit. Update the URL field to be where you are test publishing your base site. Click Submit.

    Republish your Additional site. If you filled in "http://your/test/site/url" to your URL field, the links should be rewritten something like "http://your/test/site/url/_files/css/uwScreen.css". Be sure to include the "http://" or "https://" part as necessary.

    Once you get that 1st link rewritten properly, I think you will be on your way to having your published site working.

    As for the 3rd link, it is disappearing most likely b/c it does not exist in your Additional site as implied by the system-asset:local tag. system-asset:local tags were meant so that a template can be used across multiple sites with multiple different CSS files named the same thing and relatively in each Site at the same location.

    For instance:
    In Site A, you have a template and you have "/files/css/uwScreen.css" . In Site B, you want the same basic layout but different banners and font colors. So you want to use the same template but would like to use Site B's css file that exists within Site B at relatively the same path "/files/css/uwScreen.css". So to be able to use Site A's template in Site B without having to change anything, you would use the system-asset:local tag around the path to the CSS.

    If all of your css files and images will be remaining inside your base site, then there is no need to use the system-asset:local tags. The 1st link should be sufficient.

    I hope this helps and makes sense.

  5. 5 Posted by dburfield on 12 Aug, 2010 01:55 PM

    dburfield's Avatar

    Thank you! I set up my base site many weeks ago, forgot to go back and set the path in site management. That's all it took.

  6. Tim closed this discussion on 12 Aug, 2010 01:57 PM.

Comments are currently closed for this discussion. You can start a new one.

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