Search the FirstSpirit Knowledge Base
Hello All,
I would like to get the master language text box value, if there is not value in the other language text box? I hope these things can happen in page generation time?
Here i don't want to fill the value of short-id in the text box.Just want to set it while generation time.
This is a fall back condition if no value is entered Master language value will be set for all the other remaining language.
Attached some image for your reference.
Form:
<CMS_INPUT_TEXT name="ptMediasuiteID" editable="yes" hFill="no" length="25" noBreak="yes" useLanguages="yes"> | |
<LANGINFOS> | |
<LANGINFO lang="*" label="Short-ID:"/> | |
</LANGINFOS> | |
</CMS_INPUT_TEXT> |
Format Template:
$CMS_IF(!ptMediasuiteID.isEmpty)$
$CMS_SET(mediasuiteId, ptMediasuiteID.toString)$
$CMS_ELSE$
$CMS_SET(mediasuiteId)$$CMS_VALUE(#this.formData.get(#global.project.masterLanguage, "ptMediasuiteID").get)$$CMS_END_SET$
print $CMS_VALUE(#global.project.masterLanguage)$ $CMS_VALUE(mediasuiteId)$
$CMS_END_IF$
<iframe id="video_iframe" width="$CMS_VALUE(iframe_width)$px" height="$CMS_RENDER(script:"getvideoheight",width:iframe_width.toString(),ratio:ptMediasuiteAssetRatio.toString(),subtitlesIncluded:ptMediasuiteAssetSubtitlesIncluded.toString())$px" src="$CMS_VALUE(psMediasuiteUri)$/$CMS_VALUE(psMediasuiteMandator)$/$CMS_VALUE(mediasuiteId, default: ptMediasuiteID)$/$CMS_VALUE(iframe_width)$" frameborder="0" scrolling="no" style="margin-left: $CMS_VALUE(marginLeft)$px;"></iframe>
FS_Version:5.2.426
Thank you.
Regards,
Siva
Hi Siva,
I am not 100% sure if I understand your question correctly, but I think there are multiple ways how you could solve this issue.
Cheers,
Lena
Hi Siva,
your code looks fine to me and also seems to work. Are you sure the page is marked as fully translated for EN?
Regards
Tim
Hello Tim,
Thank you for your reply.
Solved it by using the #this and other methods.
I have a question here Is it possible to hide the section at run time page generation,Suppose Master language EN text box no Media Short-id is entered.
Here I have to hide the section, if EN is empty and all the other language Dependent text boxes are empty.
Reason behind hiding all the other language is there is no value in EN text box and fall back of EN text box value will not be there in other languages too.
At Runtime based on EN value need to hide the section??
Also
<iframe id="video_iframe" width="$CMS_VALUE(iframe_width)$px" height="$CMS_RENDER(script:"getvideoheight",width:iframe_width.toString(),ratio:ptMediasuiteAssetRatio.toString(),subtitlesIncluded:ptMediasuiteAssetSubtitlesIncluded.toString())$px" src="$CMS_VALUE(psMediasuiteUri)$/$CMS_VALUE(psMediasuiteMandator)$/$CMS_VALUE(mediasuiteId, default: ptMediasuiteID)$/$CMS_VALUE(iframe_width)$" frameborder="0" scrolling="no" style="margin-left: $CMS_VALUE(marginLeft)$px;"></iframe>
Rendering is happening inside the format template. If I do hide here 'Page not found will not be displayed'.But CSS will be displayed right in live web page suppose if the section has borders and colours???
Thank you.
Hi Siva,
I am not 100% sure if I understand your question correctly, but I think there are multiple ways how you could solve this issue.
Cheers,
Lena