need help in creating generic page template

79 views
Skip to first unread message

bwj....@gmail.com

unread,
Mar 20, 2014, 6:03:27 AM3/20/14
to reddot-c...@googlegroups.com
Hi All,
I need to create a generic page template which will display message based on locale or language varient

i.e. if i have selected the french the message "Enter Decription" should be in french and vice versa

Can any help me out in implementing the any such if- else condition in page template 

Thanks and regards,
Amit

Jian Huang

unread,
Mar 20, 2014, 11:53:34 AM3/20/14
to reddot-c...@googlegroups.com
Hi Amit,

I see that you are already using language variants.

A placeholder inside a template can have different default values depending on language variant, so there isn't a need for if and else.

-jian

bwj....@gmail.com

unread,
Mar 21, 2014, 12:54:45 AM3/21/14
to reddot-c...@googlegroups.com
Hi Jian,
Thanks for the reply, Actually my requirement to create custom form where we take input based from different user but "Label" which is hard coded in template should change as per the language varient 
I tried this code
<if> 
 <query valuea="Context:CurrentLanguageVariant.Key" operator="==" valueb="Str:ENU"> 
                    <htmltext></htmltext> 
        </query> 
        <query type="else"> 
                    <htmltext></htmltext> 
        </query> 
</if> 

but didnt work 

Thanks & Regards,
Amit

Jian Huang

unread,
Mar 21, 2014, 9:18:53 AM3/21/14
to reddot-c...@googlegroups.com
Hi Amit,

You can treat the label like a regular standard field.  Just make sure to check the placeholder setting "do not show in form" and "not relevant to workflow".  Just enter the label text in the default value field.  Then change language varian, edit the template, and edit the placeholder setting again, and you can set a different default value for that language variant.  This way, it is more out of box and let processing.

However, if you prefer to use rendertag, instead of using Context:CurrentLanguageVariant.Key, just use <%inf_current_language_variant%>.

Best,

-Jian

bwj....@gmail.com

unread,
Mar 24, 2014, 7:51:29 AM3/24/14
to reddot-c...@googlegroups.com
Hi Jian,
I tried

<reddot:cms>
  <if>
        <query valuea="<%Context:inf_current_language_variant%>" operator="==" valueb="Str:ENU"> 
     <htmltext>
    aaa <%inf_current_language_variant%>

      </htmltext>
    </query>
    <query type="else">
      <htmltext>
bbb  

</htmltext>
    </query>
  </if>
</reddot:cms>

it is always going to else condition and printing "bbb"

Thanks and regards,
Amit

Jian Huang

unread,
Mar 24, 2014, 9:35:10 AM3/24/14
to reddot-c...@googlegroups.com
Typo?

<%Context:inf_current_language_variant%>?

Please use this inside rendertag instead

<%inf_current_language_variant%>

bwj....@gmail.com

unread,
Mar 24, 2014, 2:35:47 PM3/24/14
to reddot-c...@googlegroups.com
Hi Jian ,
Even for <%inf_current_language_variant%>
It is also going in else condition

Jian Huang

unread,
Mar 26, 2014, 10:54:29 PM3/26/14
to reddot-c...@googlegroups.com
Hi,

please ensure the placeholder is defined.

bwj....@gmail.com

unread,
Mar 28, 2014, 4:31:39 AM3/28/14
to reddot-c...@googlegroups.com
Thanx jian its working fine.
Reply all
Reply to author
Forward
0 new messages