Zum Hauptinhalt gehen

EN input as a default for another languages

Kommentare

2 Kommentare

  • Zendesk API User
    Author: mbergmann - 9/10/2018 7:47

    Hi Dragen,

    you could use an approach as described in this thread. The idea is to define another language independent field for EN.

    Or as a slightly different - maybe easier - idea that should make additional template output code unnecessary:

    Define an additional hidden language independent field only as "transfer field".

    <CMS_INPUT_TEXT name="st_headline_master" hFill="yes" singleLine="no" useLanguages="no" hidden="yes"

      <LANGINFOS> 

      <LANGINFO lang="*" label="Headline"/> 

      <LANGINFO lang="DE" label="Überschrift"/> 

      </LANGINFOS> 

    </CMS_INPUT_TEXT> 

    Then, always copy only the master language's value into this transfer field and - when not in the master language and the field is empty - "back" to the language independent field:

    <!-- copy language dependent field's value to the language independent's one if in master language and entering text -->

    <RULE>

         <IF>

              <AND>

                   <EQUAL>

                        <PROPERTY name="LANG" source="#global"/>

                        <PROPERTY name="MASTER" source="#global"/>

                   </EQUAL>

                   <PROPERTY name="FOCUS" source="st_headline" />

              </AND>

         </IF>

         <WITH>

              <PROPERTY nama="VALUE" source="st_headline" />

         </WITH>

         <DO>

              <PROPERTY nama="VALUE" source="st_headline_master" />

         </DO>

    </RULE>

    <!-- When not in master language and language dependent field is empty, copy the "master" field's value into it -->

    <RULE>

         <IF>

              <AND>

                   <NOT>

                        <EQUAL>

                             <PROPERTY name="LANG" source="#global"/>

                             <PROPERTY name="MASTER" source="#global"/>

                        </EQUAL>

                   </NOT>

                   <PROPERTY name="EMPTY" source="st_headline" />

              </AND>

         </IF>

         <WITH>

              <PROPERTY nama="VALUE" source="st_headline_master" />

         </WITH>

         <DO>

              <PROPERTY nama="VALUE" source="st_headline" />

         </DO>

    </RULE>

    Michael

    0
  • Zendesk API User
    Author: draganr - 9/10/2018 8:13

    Hi Michael,

    Thank you very much. It works like a charm.

    Regards,

    Dragan

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.