cross site linking not outputting link with correct .html extension

lauren.fraser's Avatar

lauren.fraser

31 Dec, 2013 03:24 PM

We're working on implementing the Calendar module and are very close. If you look at the link below, we have a registration link that goes back to our main site. If you click on the registration link on this page, you get a 404 error because the url in the link does not have the .html extension.

http://www.citizensmemorial.com/1calendar/2014/01/childbirth-the-bi...

The page we are trying to link to has been published and can be accessed at this url:
http://www.citizensmemorial.com/hospital-services/birth-place1/regi...

Any ideas?

  1. 1 Posted by Ryan Griffith on 31 Dec, 2013 04:40 PM

    Ryan Griffith's Avatar

    Hi Lauren,

    Is the page you are linking to in another Site by chance? If so, the issue may be with the way the /_cascade/formats/event details Format is outputting the related links.

    When you have a moment, try modifying the following lines at the bottom of the Format:

    ## Determine which link field to use for the related link.
    #set ($morelink = "")
    #if ($internalLink != "/")
        #set ($morelink = $internalLink)
    #elseif ($managedLink != "/")
        #set ($morelink = $managedLink)
    #elseif ($customLink != "" && $customLink != "http://"  && $customLink != "https://")
        #set ($morelink = $_EscapeTool.xml($customLink))
    #end
    

    to the following:

    ## Determine which link field to use for the related link.
    #set ($morelink = "")
    #if ($internalLink != "/")
        #set ($morelink = $_XPathTool.selectSingleNode($link, "internal/link").value)
    #elseif ($managedLink != "/")
        #set ($morelink = $_XPathTool.selectSingleNode($link, "external/content/system-symlink").value)
    #elseif ($customLink != "" && $customLink != "http://"  && $customLink != "https://")
        #set ($morelink = $_EscapeTool.xml($customLink))
    #end
    

    This tweak should better support cross-site linking.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by lauren.fraser on 31 Dec, 2013 05:31 PM

    lauren.fraser's Avatar

    Ryan,

    I made these changes and now no link is displaying…

  3. 3 Posted by Ryan Griffith on 02 Jan, 2014 06:39 PM

    Ryan Griffith's Avatar

    Hi Lauren,

    My apologies the change does not seem to be working for you.

    When you have a moment, I'd like to take a look at the XML being applied to the Format so I can double check the Velocity code:

    • Edit the Format
    • Preview one of your events using the following preview options:
      • Block: /_cascade/blocks/index/current page
      • Page: one of your events with a related link
    • Copy and paste the resulting XML to this discussion

    Please let me know if you have any questions.

    Thanks!

  4. 4 Posted by lauren.fraser on 03 Jan, 2014 10:50 PM

    lauren.fraser's Avatar
    <data>
    <system-index-block current-time="1388789094205" name="current page" type="folder">
    <calling-page>
    <system-page current="true" id="ecb6c8b3ac1009d0008dcfef47204b99">
    <name>baby-basics</name>
    <is-published>true</is-published>
    <last-published-on>1388509171072</last-published-on>
    <last-published-by>lfraser</last-published-by>
    <title>Baby Basics</title>
    <start-date>1386914400000</start-date>
    <end-date>1451541600000</end-date>
    <display-name>Display Name</display-name>
    <path>/2014/01/baby-basics</path>
    <site>Calendar-Clean</site>
    <link>site://Calendar-Clean/2014/01/baby-basics</link>
    <created-by>lfraser</created-by>
    <created-on>1386950871172</created-on>
    <last-modified-by>lfraser</last-modified-by>
    <last-modified>1387543285848</last-modified>
    <dynamic-metadata>
    <name>categories</name>
    <value>Childbirth Classes</value>
    </dynamic-metadata>
    <system-data-structure definition-path="Event">
    <starts>1390264200000</starts>
    <ends>1390273200000</ends>
    <all-day/>
    <recurrence>
    <frequency>Once</frequency>
    <interval>1</interval>
    <day/>
    <monthly-day>day of the month</monthly-day>
    <ends/>
    </recurrence>
    <details>
    <p>
    <span>Baby Basics is taught from 6:30 p.m. – 9 p.m.  This class teaches expectant parents basic baby-care skills, like bathing, diapering, temperature taking and caring for the umbilical cord.  This class also covers car-seat safety, home safety, choosing a pediatrician and other helpful tips, and includes a car-seat safety inspection and installation.  Individual class fee is $10.</span>
    </p>
    </details>
    <location>CMH Birth Place</location>
    <contact>
    <name/>
    <website/>
    <phone>417-328-6302</phone>
    </contact>
    <relatedlink>
    <title>Register for Baby Basics</title>
    <internal type="page">
    <content/>
    <path>/hospital-services/birth-place1/register-for-baby-basics</path>
    <link>site://citizensmemorial.com/hospital-services/birth-place1/register-for-baby-basics</link>
    <site>citizensmemorial.com</site>
    <name>register-for-baby-basics</name>
    <display-name>Baby Basics</display-name>
    <title>Baby Basics</title>
    <start-date>Dec 20, 2013 6:24 AM</start-date>
    </internal>
    <external>
    <path>/</path>
    </external>
    <custom/>
    </relatedlink>
    </system-data-structure>
    </system-page>
    
  5. 5 Posted by Ryan Griffith on 06 Jan, 2014 02:07 PM

    Ryan Griffith's Avatar

    Thank you for providing the XML output, Lauren.

    Comparing your XML to what I am seeing in my local instance, the snippet I provided should be working. When you have a moment, please attach or paste your entire Format so I can compare it to what I am testing with locally.

    Please let me know if you have any questions.

    Thanks!

  6. 6 Posted by lauren.fraser on 06 Jan, 2014 03:21 PM

    lauren.fraser's Avatar

    Ryan,

    Got it figured out. Copied over one too many lines.

    Thanks!

  7. 7 Posted by Ryan Griffith on 06 Jan, 2014 05:05 PM

    Ryan Griffith's Avatar

    Thank you for following up, Lauren. I am glad to hear you were able to get the Format working.

    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!

  8. Ryan Griffith closed this discussion on 06 Jan, 2014 05:05 PM.

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