Skip to main content

How to get the absolute url using CMS_REF in FS5

Comments

9 comments

  • Zendesk API User
    Author: Peter_Jodeleit - 8/18/2014 16:37

    Please render the value of your $CMS_REF directly. And please always check your log!

    Additional tip: If you need to pass internal urls as parameter use the function ref. Check the documentation for usage.

    0
  • Zendesk API User
    Author: sivaprasad9394 - 8/19/2014 8:59

    Hello Peter Jodeleit,

    I have tried that also,but nothing renders in screen,

    <atom:link rel="detail" type="text/html"

        href="http://data.com........EMPTY" />


    <atom:link rel="detail" type="text/html" href="$CMS_VALUE(standaloneLink)$$CMS_REF(content.external_link,abs:2)$"/>

    The out is looks like,

    http://data.com .............

    CMS_REF returning empty  value...

    Thanks,

    Siva

    0
  • Zendesk API User
    Author: Peter_Jodeleit - 8/19/2014 11:13

    Sorry, I can't reproduce this.

    0
  • Zendesk API User
    Author: sivaprasad9394 - 8/21/2014 14:33

    Hello Mr. Peter Jodeleit,

    Thanks for your kind reply...

    Still i am facing the absolute path in FS5.

    To diffferentate portal page or standalone page,

    $CMS_SET(contextPage, "")$

            $CMS_IF(setIsPortal)$

                $-- determine, if page is in portal context --$

                $CMS_SET(contextPage)$$CMS_VALUE(psProjectUri,default:"")$$CMS_END_SET$

            $CMS_ELSE$

                $-- determine, if page is in standalone --$

                $CMS_SET(contextPage)$$CMS_VALUE(ps_standaloneHost,default:"")$$CMS_END_SET$

            $CMS_END_IF$

    For Link Template,

    $CMS_IF("lt_overlaylink_internal".equals(ltSelectedName.toString()))$

                         $--This condition belongs to internal link--$

                         <atom:link rel="detail"  href="$CMS_TRIM(level:4)$$CMS_VALUE(contextPage)$$CMS_REF(content.external_link,abs:2)$$CMS_END_TRIM$"/>   

    $CMS_ELSIF("lt_overlaylink_media".equals(ltSelectedName.toString()))$

                         $--This condition belongs to media link--$

                         $CMS_SET(link, "")$

                         $CMS_SET(extMediaLink)$$CMS_VALUE(content.external_link,default:"")$$CMS_END_SET$

                         $CMS_IF(isSet(ss_portal_integration) && ss_portal_integration.equals("true"))$                       

                            $CMS_SET(portalLink)$$CMS_VALUE(psBNNProjectUri,default:"")$$CMS_END_SET$                                               

                            $CMS_SET(link)$$CMS_VALUE(portalLink)$$CMS_VALUE(extMediaLink)$$CMS_END_SET$                       

                        $CMS_ELSE$                       

                            $CMS_SET(standaloneLink)$$CMS_VALUE(ps_standaloneHost,default:"")$$CMS_END_SET$                                                               

                            $CMS_SET(link)$$CMS_VALUE(standaloneLink)$$CMS_VALUE(extMediaLink)$$CMS_END_SET$           

                        $CMS_END_IF$

                         <atom:link rel="detail" href="$CMS_TRIM(level:4)$$CMS_VALUE(contextPage)$$CMS_REF(content.external_link,abs:2)$$CMS_END_TRIM$"/>

    result is like below,

    <atom:link rel="detail" href="http://data.com ......ABS path is empty for the LINK(selected value)" />

    Absolute path is empty for the link even if i selected it...?Why this behaviour?

    Thanks,

    Siva

    0
  • Zendesk API User
    Author: Peter_Jodeleit - 8/21/2014 14:53

    Your code is overcomplicated to proof a potential problem :/

    But perhaps the problem isn't in the template code: Did you specify an absolute path ("prefix for absolute paths") in the corresponding generate task?

    0
  • Zendesk API User
    Author: sivaprasad9394 - 8/21/2014 15:16

    Hello Mr. Peter Jodeleit,

    Thanks for you kind reply,mistake is on my side.....

    I have fount out the problem,

    CMS_INPUT_LINK name="csExternalTeaserLink" it is mapped to the database column "external_link".

    to get the value of selected ref: external link teplate name "lt_downloadref" need to be used.There i did mistake.Now working fine.

    OLD Code:

    <atom:link rel="detail" href="$CMS_VALUE(contextPage)$$CMS_REF(content.external_link,abs:2)$"/>

    New Code :

    <atom:link rel="detail" href="$CMS_VALUE(contextPage)$$CMS_REF(content.external_link.lt_downloadref,abs:2)$"/>

    Thanks,

    Siva

    0
  • Zendesk API User
    Author: Peter_Jodeleit - 8/21/2014 15:20

    Fine, nice to see it's working for you :smileyhappy:

    0
  • Zendesk API User
    Author: sivaprasad9394 - 8/22/2014 13:34

    Hello Mr. Peter Jodeleit,

    How to get the Absolute path for the news datasource(dataset link),

    I am linking new news id to the one which is existing in the system.

    for example 42506 is the news which is displaying in the screen and i am mapping 42580 to the news.

    I could able to get the news id which i select for dataset link like 42580.

    How to get the absolute path????

    ex:only the bolded one is absolute path and the prefix is publishing host.

    http://data.com/de/news/news_detail_page_128576.html


    <!-- fs_id1: $CMS_VALUE(content.external_link.lt_entity.getDataset().getEntity().getValue("fs_id"))$ -->

    output:

    <!-- fs_id1: 128576 -->

    Thanks,

    Siva

    0
  • Zendesk API User
    Author: sivaprasad9394 - 8/25/2014 9:33

    Hello,

    I got the value by using like ,

    $CMS_VALUE(content.external_link.lt_entity.getDataset().getEntity().getValue("fs_id"))$

    Thanks,

    Siva

    0

Please sign in to leave a comment.