Copied to clipboard

Flag this post as spam?

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


  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Oct 28, 2013 @ 13:47
    Bo Damgaard Mortensen
    0

    Setting SubmitCaption

    Hi all,

    I have a client who needs difference texts on the submit button on each form.

    I'm running Contour version 3.0.17 with Umbraco version 6.1.6 in MVC mode. I'm wondering if there's any way to set the SubmitCaption in Contour?

    If this is not possible, does anyone know if Contour can be extended in some way to be able to set it? :-)

    Thanks in advance!

    All the best,

    Bo

  • Comment author was deleted

    Oct 28, 2013 @ 13:54

    Hey Bo,

    Like mentoined on twitter we need an easier way to do this but currently you can update the razor view http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Developer/Custom-Markup/

    What I'll look into this week for the new maintenance release is adding the button captions as settings on the form... so if you can wait a couple of days then that version will do the trick for you :)

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Oct 28, 2013 @ 14:46
    Bo Damgaard Mortensen
    0

    Thanks a lot, Tim. That sounds awesome :-)

    For now, I have just hardcoded the values checking on the form id. Will definitely keep an eye open for the maintenance release!

  • Comment author was deleted

    Oct 28, 2013 @ 14:47

    Ok I'll ping back here once it's out :)

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 05, 2013 @ 09:38
    Chriztian Steinmeier
    0

    Hi,

    Been scratching my head on this for a while too - I think I was led to believe that the captions came from the Dictionary as always...

    Then I tried to "enhance" the Razor view to just grab them from the Dictionary myself... safe to say I didn't succeed (mainly because I don't use Visual Studio so can't "dot-code" my way into the solution :-)

    Settings on the form, that accepts the common #DictionaryKey syntax would definitely be the best way to do this, I think...

    /Chriztian

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Nov 06, 2013 @ 12:17
    Bo Damgaard Mortensen
    0

    Have you had a chance to look at this yet, Tim? :-)

    @Chriztian: ping me on Skype if you want a helping hand! (Will post the solution here afterwards for future reference)

  • Comment author was deleted

    Nov 06, 2013 @ 12:37

    Sorry was busy with v7 RC :( and rest of the week is uk fest so it will be next week, that whole week is scheduled for Contour maintenance

  • Phil Dye 149 posts 325 karma points
    Jan 16, 2014 @ 18:10
    Phil Dye
    0

    Any update on this?

    Phil

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jan 16, 2014 @ 22:04
    Chriztian Steinmeier
    1

    Hi Phil,

    I'm currently using something like this in the Form.cshtml file (found in Umbraco/Plugins/umbracoContour/Views):

    <div class="contourNavigation">
      @if (Model.IsMultiPage)
      {
        if (!Model.IsFirstPage)
        {
          <input class="cancel" type="submit" value="@umbraco.library.GetDictionaryItem("PreviousCaption")" onclick="document.getElementById('PreviousClicked').value = 'back'"/>
        }
        if (!Model.IsLastPage)
        {
          <input type="submit" value="@umbraco.library.GetDictionaryItem("NextCaption")"/>
        }
      }
      @if (Model.IsLastPage)
      {
        <input type="submit" value="@umbraco.library.GetDictionaryItem("SubmitCaption")" />
      }
    </div>
    

    It took some trial and error, but with help from Bo Mortensen I got the syntax right.

    It's not the best solution, but at least the captions come from the Dictionary now...

    /Chriztian

  • Michael Lykke 12 posts 75 karma points
    Aug 01, 2014 @ 11:03
    Michael Lykke
    0

    I was also facing this challenge and managed to solve it to meet our needs by using a property on the DocumentType that we use to insert the forms. We have three generic properties for previous, next and submit captions on the DocumentType and I am simply accessing the properties via the Umbraco NodeFactory:

    Forms.cshtml:

    @if (Model.IsLastPage)
    {
        <input type="submit" value="@umbraco.NodeFactory.Node.GetCurrent().GetProperty("formSubmitText").ToString()"/>
    }
    

    This way we can have different submit (or previous/next) captions per form.

    We're using Umbraco 4.7 and Contour 3.0.6.

    HTH

    /Michael

Please Sign in or register to post replies

Write your reply to:

Draft