Search the FirstSpirit Knowledge Base
Hello all,
I have section template called Icons which is used in ~10 section templates.
That template has the following form:
<CMS_INPUT_COMBOBOX name="st_icon" hFill="yes" useLanguages="no">
<ENTRIES>
<ENTRY value="icon-line2-graduation">
<LANGINFOS>
<LANGINFO lang="*" label="general_academy"/>
</LANGINFOS>
</ENTRY>
<ENTRY value="icon-android">
<LANGINFOS>
<LANGINFO lang="*" label="general_android"/>
</LANGINFOS>
</ENTRY>
...
</ENTRIES>
<LANGINFOS>
<LANGINFO lang="*" label="Select icon" description="Select icon"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>
I want to make this "global", so i don't need to enter this code in every place where i want to use these icons, but just to call this form into that section template.
Is that possible?
So for example if i have a section template:
<CMS_INPUT_TEXT name="st_headline" hFill="yes" singleLine="no" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="*" label="Headline" description="Insert video headline."/>
<LANGINFO lang="DE" label="Überschrift"/>
</LANGINFOS>
</CMS_INPUT_TEXT>
<CMS_INPUT_COMBOBOX name="st_icon" hFill="yes" useLanguages="no">
<ENTRIES>
<ENTRY value="icon-line2-graduation">
<LANGINFOS>
<LANGINFO lang="*" label="general_academy"/>
</LANGINFOS>
</ENTRY>
<ENTRY value="icon-android">
<LANGINFOS>
<LANGINFO lang="*" label="general_android"/>
</LANGINFOS>
</ENTRY>
...
</ENTRIES>
<LANGINFOS>
<LANGINFO lang="*" label="Select icon" description="Select icon"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>
Instead of that i want:
<CMS_INPUT_TEXT name="st_headline" hFill="yes" singleLine="no" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="*" label="Headline" description="Insert video headline."/>
<LANGINFO lang="DE" label="Überschrift"/>
</LANGINFOS>
</CMS_INPUT_TEXT>
CALLED icons template
And then if i want to change one icon i don't need to go through all of the templates, but just than one (icons).
If i was clear... I hope so.
Thanks,
Dragan
Hi Dragan,
this is not possible "directly".
Usually in this case, you use a datasource centrally holding the possible options (value for HTML and a description) and use FS_DATASET to choose one of them. One thing to keep in mind in that case is that those "technical datasets" have to be released automatically.
One advantage is that you can even add a FS_REFERENCE to those datasets holding a preview element - just for conveniance. So the editor will even get a visual representation of his choice. You would usually not release those media elements as they are not used in the output channel.
Another (possible) use case is the option to use some kind of filter, e.g. add a "category" to those icons to only allow subsets of them in different places.
As an alternative, you can use an INPUT_LINK together with a link template. The link template would then contain the combobox while the "main" template(s) just contain an INPUT_LINK. To add a little convenience, you can add the (empty) link element as a default value. The (small) disadvantage here: The editor has one more click to do (at least in CC) to "open" the "link" instead of having the combobox directly in the "main" template.
Michael
Hi Dragan,
this is not possible "directly".
Usually in this case, you use a datasource centrally holding the possible options (value for HTML and a description) and use FS_DATASET to choose one of them. One thing to keep in mind in that case is that those "technical datasets" have to be released automatically.
One advantage is that you can even add a FS_REFERENCE to those datasets holding a preview element - just for conveniance. So the editor will even get a visual representation of his choice. You would usually not release those media elements as they are not used in the output channel.
Another (possible) use case is the option to use some kind of filter, e.g. add a "category" to those icons to only allow subsets of them in different places.
As an alternative, you can use an INPUT_LINK together with a link template. The link template would then contain the combobox while the "main" template(s) just contain an INPUT_LINK. To add a little convenience, you can add the (empty) link element as a default value. The (small) disadvantage here: The editor has one more click to do (at least in CC) to "open" the "link" instead of having the combobox directly in the "main" template.
Michael
Hi Michael,
Thank you very much for the informations.
Best regards,
Dragan
Hi mbergmann,
since there are almost 1.5 years gone, is there maybe a new simple solution, which does exactly what Dragan wanted?
Best, Maik
Thanks for the hint and the link. I voted for that feature.
Best, Maik