Copied to clipboard

Flag this post as spam?

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


  • Fergus Davidson 309 posts 588 karma points
    Apr 10, 2014 @ 23:17
    Fergus Davidson
    0

    numbering fieldsets

    i am customising the views for a contour form and i was hoping there was a way that i can get the position of the fieldset.

    i have tried a few things but always end up with something like:

    Umbraco.Forms.Mvc.Models.FieldsetViewModel' does not contain a definition for 'Position'

    anyone point me in the right direction?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 11, 2014 @ 08:40
    Jan Skovgaard
    0

    Hi Fergus

    Could you show some examples on how you have been trying to do it?

    /Jan

  • Fergus Davidson 309 posts 588 karma points
    Apr 11, 2014 @ 09:18
    Fergus Davidson
    0

    For example: @fs.Position()

    @foreach (FieldsetViewModel fs in Model.CurrentPage.Fieldsets) { <div class="greenform"> @if (!string.IsNullOrEmpty(fs.Caption)) {
    <h2><span>@fs.Position()</span> @Html.Raw(fs.Caption)</h2>

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 11, 2014 @ 09:31
    Jan Skovgaard
    101

    Aaah I see - Why do you need to number the fieldsets? Is it a visual thing or do you need it for another purpose?

    If it's a visual thing would it then be possible to alter the HTML output to be wrapped in an ordered list perhaps? Or perhaps you can use CSS counters so you don't have to play with the HTML?

    Hope this helps.

    /Jan

  • Fergus Davidson 309 posts 588 karma points
    Apr 11, 2014 @ 09:37
    Fergus Davidson
    0

    yes, it's a visual thing. i was hoping this was a simple task of getting position or SortOrder.

    trying out the CSS counters - i was not even aware of that

  • Fergus Davidson 309 posts 588 karma points
    Apr 11, 2014 @ 09:55
    Fergus Davidson
    0

    CSS counters worked perfectly - thanks Jan

    it's only 08:50 and already i have learned something

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 11, 2014 @ 10:29
    Jan Skovgaard
    0

    Hi Fergus

    Happy to help - you can get a really long way using CSS or JavaScript manipulate something where you don't know how to access / deal with the core of things.

    Have a nice friday and a good weekend when it's time :)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft