Copied to clipboard

Flag this post as spam?

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


  • Robert Shimield 9 posts 59 karma points
    Jul 28, 2015 @ 14:22
    Robert Shimield
    0

    Absolute beginner!

    Hi

    I have installed Umbraco CMS. We plan to use it for our new hospital website. All working fine, thanks.

    I have downloaded and installed the U7 grid data type, and I have created a new data type and selected Content grid and added some columns.

    What do I do now???

    How do I add the content grid to a page so I can see it in the front end?

    Many thanks

  • Anders Bjerner 487 posts 2995 karma points MVP 8x admin c-trib
    Jul 28, 2015 @ 14:42
    Anders Bjerner
    0

    Welcome to Our ;)

    In the template of your page, you can simply add the following line (where content is the name of the property holding the grid):

    @CurrentPage.GetGridHtml("content")
    

    This will automatically render the grid using Bootstrap 3. This is the simplest way to render the grid, since you let Umbraco do the magic.

    You can also use other frameworks than just Bootstrap 3 - eg. if you have installed the Fanoe starter kit, or simply created your own:

    @CurrentPage.GetGridHtml("content", "fanoe")
    

    To get a feel on what's going on, you can look through the files in the ~/Views/Partials/Grid/ folder for inspiration.

    Also, feel free to ask if you have any further questions ;)

  • Steve Morgan 1349 posts 4459 karma points c-trib
    Jul 28, 2015 @ 14:53
    Steve Morgan
    0

    If you're struggerling to see how it all pieces together can I suggest you work through the basic walk-through - it doesn't cover the grid but it will help understand how Umbraco slots together then the code Anders posted will make more sense.

    It sounds like you're nearly there.. so it might be too basic for you.

  • Robert Shimield 9 posts 59 karma points
    Jul 28, 2015 @ 15:06
    Robert Shimield
    0

    Thank you Steve, I admit I am struggling a bit. I actually installed the starter kit which I now see skips a lot of the basic understanding of the system. I'll have to go back and study the basics . . .

  • Jeffrey Schoemaker 408 posts 2138 karma points MVP 8x c-trib
    Jul 28, 2015 @ 15:11
    Jeffrey Schoemaker
    0

    Hi Robert,

    also umbraco.tv is a great start when you're new to Umbraco. In just one day all basics are demonstrated in short videos!

    Good luck,

    Jeffrey

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 28, 2015 @ 15:13
    Dennis Aaen
    0

    Hi Robert,

    When you are saying U7 grid data type did you mean the build in grid in Umbraco 7.2.x or did you mean this package. https://our.umbraco.org/projects/backoffice-extensions/u7-grid-data-type

    If you mean the u7-grid-data-type, then you will find good Razor examples here https://our.umbraco.org/projects/backoffice-extensions/u7-grid-data-type

    <div>    
        @foreach (var dog in CurrentPage.dogs)
        {
            <div>
                <p>Name - @dog.name </p>
                @* Editor content - parse internal links *@
                <p>@Html.Raw(umbraco.template.ParseInternalLinks(dog.description.ToString()))           </p>
                @* Media picker - single *@
                @if (dog.image != "") {
                IPublishedContent dogImage=Umbraco.TypedMedia(dog.image.ToString());
                    <img src="@dogImage.Url" />
                }
                @* Media picker multiple - split the id's *@
                @if (dog.images != "") {
                    foreach (var item in dog.images.ToString().Split(','))
                    {
                IPublishedContent dogImage = Umbraco.TypedMedia(item);
                    <img src="@dogImage.Url" />
                    }
                }
                @* Content picker multiple *@
                @if (dog.brothers != ""){
                    foreach (var item in dog.brothers.ToString().Split(','))
                    {
                // get link
                var contentLink = Umbraco.NiceUrl(int.Parse(item));
                // get node
                dynamic pickerNode = new umbraco.MacroEngines.DynamicNode(item);
                <a href="@contentLink">@pickerNode.Name</a>
                    }
                }           
                @* Check box *@
                @if (dog.trained == "True")
                {
                    <p>This dog is traind.</p>
                }
            </div>
        }
    </div>
    

    Also try to see my comments in this thread https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/52749-Need-help-for-razor-syntax-in-U7-Grid-Data-Type

    Hope this helps,

    /Dennis

  • Robert Shimield 9 posts 59 karma points
    Jul 28, 2015 @ 15:21
    Robert Shimield
    0

    I meant the U7-grid-data-type, but when you say Razor examples I think you're talking about shaving!

    I'm used to Joomla, WordPress, SharePoint where adding plugins, webparts or whatever to a page is relatively simple.

    I'll have to go back to the basics.

    Thanks for your advice.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 28, 2015 @ 15:59
    Dennis Aaen
    0

    Hi Robert,

    Okay then I think that you should sign up for Umbraco TV. http://umbraco.tv/ You can see the different plans here http://umbraco.tv/plans-signup/

    And then I would recommend you to see the videos step by step from the chapter about document type to chapter about Razor syntax and querying Umbraco data with Razor

    http://umbraco.tv/videos/umbraco-v7/implementor/

    Hope this helps,

    /Dennis

  • Robert Shimield 9 posts 59 karma points
    Jul 29, 2015 @ 07:26
    Robert Shimield
    0

    Thank you all for your advice. It is a nice surprise to find a forum that actually responds so helpfully and quickly!

Please Sign in or register to post replies

Write your reply to:

Draft