Creating a XML file as output, but page links are written as site://

ediego's Avatar

ediego

15 Apr, 2015 11:33 PM

I an generating a XML file that contains the contents of an index block. It contains a list of all the news items on our site that I am using for Ajax calls and rss feeds.
The links are getting written to the file as
<link>site://ACAD-COMM-news.miami.ed/stories/2015/04/um-alumnus-rubio-runs-for-nations-highest-office</link>
instead of the full URL.

Here are the relevant sections of the format:
## Get all the news items
#set ($xNewsItems = $_XPathTool.selectNodes($contentRoot, "//system-page"))

## loop through all the news items
#foreach ($xNewsItem in $xNewsItems)
    ## Get the link to the article
    #set ($sLink = $_EscapeTool.xml($xNewsItem.getChild("link").value))

    <link>$sLink</link>
    ...
#end

I am attaching a full copy of the format and the index block for reference if needed.

  1. 1 Posted by Ryan Griffith on 16 Apr, 2015 01:09 PM

    Ryan Griffith's Avatar

    Hi,

    It sounds as though Cascade is not tracking the links. When you have a moment, try surrounding the value of the link with [system-asset] pseudo tags and re-publish. For example:

    ## loop through all the news items 
    #foreach ($xNewsItem in $xNewsItems) 
        ## Get the link to the article 
        #set ($sLink = $_EscapeTool.xml($xNewsItem.getChild("link").value))
    
        <link>[system-asset]${sLink}[/system-asset]</link> 
        ... 
    #end
    

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by ediego on 16 Apr, 2015 01:28 PM

    ediego's Avatar

    That helped a little, its coming out like this now
    <link>/stories/2015/04/studying-how-species-evolve.html</link>

    Is there anyway to make if the full URL like
    <link>http://news.miami.edu/stories/2015/04/studying-how-species-evolve.html</link>

    Some of these might be pointing to other sites.

  3. 3 Posted by ediego on 17 Apr, 2015 12:52 PM

    ediego's Avatar

    Any ideas on if its possible to get the full URL for these links ?

  4. 4 Posted by Ryan Griffith on 17 Apr, 2015 02:17 PM

    Ryan Griffith's Avatar

    Hi,

    Currently, the only way to accomplish this is to manually append the hostname information onto the front of the link for assets that are within the same Site. Assets from other Sites will have the Site URL appended onto the front automatically.

    We do have a couple of related suggestions on our Idea Exchange. I highly recommend voting them up if you would like to see any of them implemented in a future release.

    A workaround clients have used is to name their Sites based on the domain and append http:// and the Site name onto the front. For example, if you were to name the Site news.miami.edu you could do something like the following:

    ## loop through all the news items 
    #foreach ($xNewsItem in $xNewsItems) 
        ## Get the link to the article 
        #set ($sLink = $_EscapeTool.xml($xNewsItem.getChild("link").value))
    
        ## Get the Site name
        #set ($sSite = $xNewsItem.getChild("site").value)
    
        <link>http://${sSite}[system-asset]${sLink}[/system-asset]</link> 
        ... 
    #end
    

    Please let me know if you have any questions.

    Thanks!

  5. 5 Posted by ediego on 19 Apr, 2015 12:32 AM

    ediego's Avatar

    ok, thanks.

  6. 6 Posted by Ryan Griffith on 20 Apr, 2015 11:54 AM

    Ryan Griffith's Avatar

    Not a problem at all, my apologies for not being able to provide a simple solution. Definitely vote up those suggestions if you would like to see them implemented.

    I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.

    Have a great day!

  7. Ryan Griffith closed this discussion on 20 Apr, 2015 11:54 AM.

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

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM