firstspirit - get image reference
Author: luisapmesquita
Publication Date: 2/10/2017 12:02
Hello,
I am having problems when trying to get the url of an image.
Next you can find the form that I have with a title and an image list:
<CMS_INPUT_TEXT name="pt_T_HL" singleLine="no" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="*" label="Headline" description="Headline"/>
</LANGINFOS>
</CMS_INPUT_TEXT>
<FS_LIST name="pt_picture" hFill="yes" height="420">
<DATASOURCE type="inline" maxEntries="1" useLanguages="no">
<LABELS>
<LABEL lang="*">"Picture-Uid: " + #item.st_reference.getUid()</LABEL>
</LABELS>
<ACTIONS>
<ACTION name="ADD">
<PARAM name="select-ui">list</PARAM>
</ACTION>
<ACTION name="REMOVE"/>
<ACTION name="EDIT"/>
</ACTIONS>
<COLUMNS>
<COLUMN show="no">#identifier</COLUMN>
</COLUMNS>
<LAYOUT>
<ADD component="toolbar" constraint="top"/>
<ADD component="stackedview" constraint="hide">
<PARAM name="toolbar-assembly">PANEL</PARAM>
</ADD>
<ADD component="overview" constraint="hide"/>
<ADD component="singleview" constraint="bottom"/>
</LAYOUT>
<TEMPLATES source="sectiontemplates">
<TEMPLATE uid="generic_picture"/>
</TEMPLATES>
</DATASOURCE>
<LANGINFOS>
<LANGINFO lang="*" label="Image"/>
</LANGINFOS>
</FS_LIST>
And in html I have this:
<p:title>$CMS_VALUE(pt_set_formdata.get(#global.language,"pt_T_HL").get())$</p:title>
<p:imageLink>$CMS_REF(pt_set_formdata.get("pt_picture").get().get(0))$</p:imageLink>
For the title is working ok, for the image link no. Can you help me here?
The html and form of generic picture are attached.
MTIA,
Luisa Mesquita
Tags: firstspirit5, image, references
-
Author: mbergmann - 2/10/2017 19:07
Hello Luisa,
as you are trying to access an inner field st_reference, you will of course have to provide its name. Furthermore, in a template, you can use a simplified syntax.
So the following should work:
$CMS_REF(pt_set_formdata.pt_picture.first.st_reference)$
Michael
0 -
Author: marza - 2/23/2017 14:11
Hello Luisa,
do you need further help or did <anyone>'s reply already help you? If so, it would be great if you marked Michael's reply as "correct answer" so that other community users find the solution easily. If you have already found a solution by yourself, it would be very kind of you, if you posted it here.
Best regards
Marian
0 -
Author: luisapmesquita - 2/23/2017 14:44
it was correct.
0 -
Author: luisapmesquita - 2/23/2017 14:45
thank you. it worked
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare