Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicolai Sørensen 42 posts 66 karma points
    Jun 07, 2013 @ 08:45
    Nicolai Sørensen
    0

    Bypass the open-close rule on html tags

    I find myself in a situation where i need to place <form> different for 2 scenarios, and as umbraco want every tag started to end correctly, then I cannot place the start tag in an if-statement and the end tag in another if-statement.

    Is there any way to solve this, hoping not to have to template me out of this:

    <xsl:if test="..."><form></xsl:if>

    ... some code

    <xsl:if test="..."></form></xsl:if>

  • Jan Skovgaard 11264 posts 23592 karma points MVP 9x admin c-trib
    Jun 07, 2013 @ 08:53
    Jan Skovgaard
    1

    Hi Nicolai

    Every HTML tag should start and end correctly in XSLT and in the generated HTML output as well. This is the syntax of the two languages and has nothing to do with Umbraco as such :)

    However I'm wondering why it seems neccesary to do a hack like the above? Is it the same form that needs to be rendered different places in certain circumstances?

    /Jan

  • Nicolai Sørensen 42 posts 66 karma points
    Jun 07, 2013 @ 08:59
    Nicolai Sørensen
    0

    Hi Jan,

    Min problem is that I am setting up different scenarios a product can be shown (there are many), and in this case in need a form around it if it has't got variations, and if I need the forms to be on every "loop".

    It seems I will have to go with templating allthough it's already a mess as I try to reuse all code through templating. 

  • Nicolai Sørensen 42 posts 66 karma points
    Jun 07, 2013 @ 09:00
    Nicolai Sørensen
    1

    While writing I just got the solution:

    just make a template the calls the other template with forms around it.

  • Jan Skovgaard 11264 posts 23592 karma points MVP 9x admin c-trib
    Jun 07, 2013 @ 10:30
    Jan Skovgaard
    0

    Hi Nicolai

    Exactly that's the way to do it. We need no stinkin' hack! :)

    #H5YR.

    /Jan

  • Nicolai Sørensen 42 posts 66 karma points
    Jun 07, 2013 @ 10:35
    Nicolai Sørensen
    2

    haha, thanks Jan,

    Yet another bad habbit put to rest ;)

Please Sign in or register to post replies

Write your reply to:

Draft