Why do you need to make such check? I'm thinking that if the form is inserted using RTE one would notice on the page in the backoffice that the form is already there? But is it so that in your scenario it's possible to insert the form using RTE and the form is perhaps already inserted at the template level? Is that the case?
What is the scenario? Where would the form come from - How is it put somewhere so you need to make a check to make sure there is only one form? I'm not sure I get why you need to make a check? Sorry if I'm being slow on this one...:)
Yes I get that part - What I don't get is HOW a form is added to a page? Is it by an editor, is it added at a template level? This is what I need to understand :) What is the workflow when adding the form...
Contour form on the page
How I can check with Razor if Contour form already exist on the page?
Hi Michael
Not sure I understand the scenario for this?
Why do you need to make such check? I'm thinking that if the form is inserted using RTE one would notice on the page in the backoffice that the form is already there? But is it so that in your scenario it's possible to insert the form using RTE and the form is perhaps already inserted at the template level? Is that the case?
/Jan
Hi,
Thanks, but at this moment I should check if any form exist on page i should newer render another.
I've render contour forms with umbracoContour.RazorRenderForm
So if it possible to check for example Content.HasForm() ?
Hi Michael
What is the scenario? Where would the form come from - How is it put somewhere so you need to make a check to make sure there is only one form? I'm not sure I get why you need to make a check? Sorry if I'm being slow on this one...:)
/Jan
Hi Jan,
I need only one form on page, if contour form exist on the page I shouldn't render another.
"so you need to make a check to make sure there is only one form" - Yes!
Michael
Hi Michael
Yes I get that part - What I don't get is HOW a form is added to a page? Is it by an editor, is it added at a template level? This is what I need to understand :) What is the workflow when adding the form...
/Jan
Hi Jan,
I've added all forms with templates
@Umbraco.RenderMacro("umbracoContour.RazorRenderForm", new { FormGuid = formId })
Thanks,
Michael
is working on a reply...