Copied to clipboard

Flag this post as spam?

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


  • Michael 125 posts 409 karma points
    Jan 15, 2015 @ 18:03
    Michael
    0

    Contour form on the page

    How I can check with Razor if Contour form already exist on the page?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 15, 2015 @ 20:04
    Jan Skovgaard
    0

    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

  • Michael 125 posts 409 karma points
    Jan 16, 2015 @ 10:44
    Michael
    0

    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() ?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 16, 2015 @ 11:05
    Jan Skovgaard
    0

    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

  • Michael 125 posts 409 karma points
    Jan 16, 2015 @ 12:21
    Michael
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 16, 2015 @ 12:36
    Jan Skovgaard
    0

    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

  • Michael 125 posts 409 karma points
    Jan 16, 2015 @ 12:39
    Michael
    0

    Hi Jan,

    I've added all forms with templates

    @Umbraco.RenderMacro("umbracoContour.RazorRenderForm", new { FormGuid = formId })

    Thanks,

    Michael

Please Sign in or register to post replies

Write your reply to:

Draft