Copied to clipboard

Flag this post as spam?

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


  • ketan italiya 17 posts 59 karma points
    May 12, 2014 @ 07:07
    ketan italiya
    0

    How to put repeatable content in Umbraco 7.1

    Hey,I want to put some repeatable content in my Umbraco website.In this content there is one image and some description of image is there. By using asp.net control we know that there is lot's of controls like repeater,gridview,list are used for that but in umbraco which type of controls or macro (may be) used? I have no idea for that can you please help me out.

    enter image description here

    Here i also put screenshot of my repeatable content which i want in my umbraco site.

  • MK 429 posts 906 karma points
    May 12, 2014 @ 07:15
    MK
    0

     

    Hi there,

    You can use the Archetype or U7 Grid Data to input all your content and just render your html using foreach loop in your razor.

    Archetype: http://our.umbraco.org/projects/backoffice-extensions/archetype

    U7: http://our.umbraco.org/projects/backoffice-extensions/u7-grid-data-type

    The razor example in U7 page should give you an idea on how you should use it.

    Regards

  • ketan italiya 17 posts 59 karma points
    May 12, 2014 @ 07:44
    ketan italiya
    0

    Thanks for your Quick reply Sir,but how i use this package in webmatrix actually i make a website using webmatrix and i am new in umbraco so can you please help me that how can i use U7 Grid Data Type in webmatrix.

  • MK 429 posts 906 karma points
    May 12, 2014 @ 07:51
    MK
    0

    Hi,

    You need to download the package, install it via Developer section --> Packages --> Install local package.

    Then you need to add the types of data you want to use in your gird.

    To do that, go to Developer section --> Data types and look for the u7 datatype. Add the relevant types (e.g. media picker and text).

    Then you need to add the new datatype to your page where you want to show it. So lets say you have a galley page...

    Go to Setting section --> Document type Look for your relevant document and add the new type via the property tab. That should add the new type to your gallery page in your content section. Now, just add the content and render it in your razor view/template.

    Are you on webform mode or mvc mode?

     

  • ketan italiya 17 posts 59 karma points
    May 12, 2014 @ 08:04
    ketan italiya
    0

    Thanks for Reply,It is helpful for me.I am on MVC mode so any other instructions for me?

  • MK 429 posts 906 karma points
    May 12, 2014 @ 08:12
    MK
    0

    Just follow the above and let me know if everything if ok.

     

  • ketan italiya 17 posts 59 karma points
    May 12, 2014 @ 08:50
    ketan italiya
    0

    wow,it's done but there is small problem i face with razor syntax(which is already given in that page) i have little knowledge about it.

    here what is mean by CurrentPage.dogs and this code is not work for me any solution for that.

  • ketan italiya 17 posts 59 karma points
    May 12, 2014 @ 08:51
    ketan italiya
    0

    wow,it's done but there is small problem i face with razor syntax i have little knowledge about it.

    <div>
        @foreach (var dog in CurrentPage.dogs)
        {
            <div>
                <p>Name - @dog.name </p>
                <p>Description - @Html.Raw(dog.description) </p>
                @if (dog.image != "") {
    
                    IPublishedContent iconImg = Umbraco.TypedMedia(dog.image.ToString());
                    <img src="@iconImg.Url" />
                }
                @if (dog.trained == "True")
                { 
                    <p>This dog is traind.</p>
                }
            </div>
        }
    </div>
    

    here what is mean by CurrentPage.dogs and this code is not work for me any solution for that.

Please Sign in or register to post replies

Write your reply to:

Draft