Copied to clipboard

Flag this post as spam?

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


  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Oct 25, 2013 @ 22:32
    Chriztian Steinmeier
    0

    Extension to export the form XML?

    Hi guys,

    I've created a multi-step form with Contour and I'd like to render a "progress bar" above the form, to show which of the steps the user is currently on.

    Using the exported form, I can easily create the progressbar with XSLT - but the great thing about Contour is of course that the client can edit the forms, creating new steps or renaming the existing ones. Which leaves me with the problem of having to re-export the XML in order to keep the progressbar in sync...

    None of the extensions in the "umbraco.contour" namespace seems to give me the form's XML (they only return "records"), so I was thinking it should be possible to write an extension to do it — does anyone (Tim?) know if the Export method is public in the source so it's possible to essentially create an App_Code extension that could return the XML?

    Thanks in advance,

    /Chriztian

  • Comment author was deleted

    Oct 29, 2013 @ 09:44

    Hey Chriztian, are you using the razor macro then it should be pretty simple to update the form markup with a progress bar... let me know if you are/aren't then I can give you the correct pointers!

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Oct 29, 2013 @ 09:59
    Chriztian Steinmeier
    0

    Hi Tim,

    Thanks - Yes, I'm using the umbracoContour.RazorRenderForm macro for this.

    I need to generate this very simple list of items - almost a standard navigation snippet:

    <ol class="stepsnav">
        <li class="selected">Step 1 Caption</li>
        <li>Step 2 Caption</li>
        <li>Step 3 Caption</li>
        <li>Step 4 Caption</li>
    </ol>
    

    So I need to know which step is the current (with XSLT I could grab that from the Request) and of course what the other steps are, and the order they're in.

    /Chriztian

  • Comment author was deleted

    Oct 29, 2013 @ 15:57

    Easiest is to do this in the razor file :)

    http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Developer/Custom-Markup/

    <ol class="stepsnav">
    @foreach(var page in @Model.Pages)
    {
      <li>@page.Caption</li>
    }
    </ol>
    
  • Comment author was deleted

    Oct 29, 2013 @ 15:59

    To check if it's current you can do page.Caption == Model.CurrentPage.Caption

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Oct 30, 2013 @ 10:55
    Chriztian Steinmeier
    0

    Thanks Tim!

    That does the job - I have a couple of follow-up questions, but I'll put them in a new thread...

    /Chriztian

  • Comment author was deleted

    Oct 30, 2013 @ 10:57

    Sweet :)

Please Sign in or register to post replies

Write your reply to:

Draft