Zum Hauptinhalt gehen

Site Architect - CMS_INPUT_DOM - Escaping output

Kommentare

7 Kommentare

  • Zendesk API User
    Author: marza - 5/3/2016 12:37

    Hi Upendra,

    what happens if you just use $CMS_VALUE(for_each_label.content)$ to output the content column?

    If the content is correct HTML you don't neet to escape it. The method renderToString() should be used only in special cases.

    Best regards

    Marian

    0
  • Zendesk API User
    Author: ukonangi - 5/3/2016 14:26

    Hi Marian,

    Using the content also escapes the content as below.

    for_each_label.content: <i class="test">dkfjd</i>

    Upendra

    0
  • Zendesk API User
    Author: kohlbrecher - 5/12/2016 9:10

    Hi Upendra,

    Maybe a textfield or the standard formatting within the DOM is a better solution. Can you give us your use case?

    Best regards

    Jan

    0
  • Zendesk API User
    Author: ukonangi - 5/26/2016 9:14

    Hi Jan

    Text field would not suffice as we need to add some internal links using a link template. So DOM is needed.  Standard formatting in DOM would not suffice as  we have around 60 small labels/html snippets (15 per Site * 4 Sites). We will not be able to create a separate data source / separate DOM element for each of them.

    Use Case: On our site, we haveTool Tips, Learn more Popups etc which have various small html snippets with different css class names per html tag . So standard formatting with DOM would not suffice.

    Example of sample snippets :

    Tool tip1 could be :  <div class="class1">Tooltip1</div>

    Tool tip2 could be : <SPAN class="class-tip2 "><div class="test1">Tooltip1</div></SPAN>

    Learnmore1 Popup could be :  <DIV class="popup1"> Learn More Text 1 <a class="learnmorepopover1-close" aria-label="Close">X</a> </DIV>

    Learnmore2 Popups could be:  <P class="learnmorepopup2"><a class="learnmorepopover2-close" aria-label="Close">X</a> </P>

    Do you know why for_each_label.content.renderToString in FS 4.2.461.48921  was not escaping the content, where as it does escape in FS 5.2.212.71463 ?


    Upendra

    0
  • Zendesk API User
    Author: marza - 6/3/2016 12:26

    Hi Upendra,

    if you enter HTML inside an DOM editor component it will be escaped. This is intended. It may be that the old 4.2 behaviour caused some problems so it was fixed in 5.2.

    Inside a DOM editor commponent you can work with format templates to have customs tags like <p class="note">. So if you enable them inside the GOM you can select a text inside a dom editor compoment and assign such a "style". Isn't this what you need?

    See http://www.e-spirit.com/odfs52/template-development/forms/input-components/dom/#s1 for more information (switch to English in the top if the German version is displayed)

    Regards

    Marian


    0
  • Zendesk API User
    Author: MichaelaReydt - 6/20/2016 8:50

    Hello Upendra,

    is this still an open question? Do you need further help or did the given replies already help you? If so it would be great if you mark the "correct answer".

    Best regards

    Michaela

    0
  • Zendesk API User
    Author: ukonangi - 7/14/2016 16:36

    Marian,

    This isn't what I was looking for. In our test case we have around 30 different html snippets. So, creating 30 format templates and adding them in DOM would not work. Since the html snippet was small, we were ok to add the html content directly to the DOM and we needed a way to directly read the HTML added in the DOM with out escaping it. This way instead of creating 30 format templates , we could live with adding small html snippets into the DOM.

    Upendra

    0

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