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:
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?
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.
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>
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
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.
While writing I just got the solution:
just make a template the calls the other template with forms around it.
Hi Nicolai
Exactly that's the way to do it. We need no stinkin' hack! :)
#H5YR.
/Jan
haha, thanks Jan,
Yet another bad habbit put to rest ;)
is working on a reply...