rinku_chowdhury
I'm new here

How to retrieve data from section template to link template?

scenario: section template can have an external link template which will popup a message defined in the section template. Because the link template does not allow "useLanguages=yes".

section template: text_box (has value based on languages)

<FS_LIST name="st_linkList" hFill="yes" height="300">

<TEMPLATES source="linktemplates">

      <TEMPLATE uid="textlinkexternal"/>

</TEMPLATES>

224671_pastedImage_0.png

  </FS_LIST>

link template : external.html
if (condition)

$CMS_VALUE ( retrieve from st_poptext)$ 

any idea how to handle this? also, open to an alternative solution.

0 Kudos
1 Reply
felix_reinhold
Returning Responder

Hello Rinku,

You can always set a variable bevor rendering the link and use it in the link template.

For example:

Sectiontemplate:

$CMS_SET(sv_poptext, st_poptext)$

$CMS_VALUE(your_link)$

$CMS_SET(sv_poptext, null)$

Linktemplate:

$CMS_IF(isSet(sv_poptext) && sv_poptext!=null)$

    $CMS_VALUE(sv_poptext)$

$CMS_END_IF$

But you should consider to change the FS_LIST to useLanguages="yes". It's the recommended setting for FS_LIST (INLINE) with linktemplates.

Best regards

Felix

0 Kudos