Copied to clipboard

Flag this post as spam?

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


  • Dipa 88 posts 370 karma points
    Feb 24, 2016 @ 06:27
    Dipa
    0

    How to use data type MultipleTextstring (Repeatable textstring) in template

    Hello,

    I am using Umbraco v7.4.1. In that there is one new data type called 'Umbraco.MultipleTextstring' (Repeatable textstring). I have use it in document type and want to use it in template to display all textstrings. But I am not able to find syntax for it.

    Please guide to how to use it. And if there is any guide, where all new data type and its description is there, give me reference of it.

    Thanks,

    Dipa.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Feb 24, 2016 @ 07:06
  • Ronak Panchal 71 posts 230 karma points
    Feb 24, 2016 @ 11:57
    Ronak Panchal
    0

    Hi dipa you can do something like below for getting the repeatable text.

    Returns: array of strings

    @foreach (var newitem in Model.Content.GetPropertyValue<string[]>("multiplestring"))
    {
        <li>@newitem</li>
    }
    
  • Gary 80 posts 377 karma points
    Nov 23, 2016 @ 15:54
    Gary
    0

    I have had a look at the above examples but I want to get the repeatable text string values from child pages?

    I have tried multiple ways but not had any luck yet.

    Can anyone please help?

    Kind Regards,

    Gary Henshall

  • Ronak Panchal 71 posts 230 karma points
    Dec 01, 2016 @ 14:30
    Ronak Panchal
    0

    Hello Gray,

    Just get that child page by id or document type alias. after that you can do like below.

    @foreach (var newitem in node.GetPropertyValue<string[]>("multiplestring"))
    {
        <li>@newitem</li>
    }
    

    if you are not using strongly typed view then you can do something like below.

    @{
        if (CurrentPage.keyFeatureList.Length > 0)
        {
            <ul>
                @foreach (var item in CurrentPage.keyFeatureList)
                {
                    <li>@item</li>
                }
            </ul>
        }
    }
    

    where multiple string is alias of your property.

    Hope this will help,

    Regards, Ronak Panchal.

Please Sign in or register to post replies

Write your reply to:

Draft