Copied to clipboard

Flag this post as spam?

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


  • CongPhuoc-Phan 4 posts 34 karma points
    Dec 16, 2014 @ 10:56
    CongPhuoc-Phan
    0

    How to manage dynamic content block - Umbraco 7.1.9

    Hi everybody I am a beginner of Umbraco, I need to do something like this: each retangle is a piece of information need to add by user
    Each item in the red retangle is added by admin. The number of item is unlimited. So, how can I finished it

    Many thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 16, 2014 @ 11:09
    Jan Skovgaard
    1

    Hi CongPhuoc-Phan

    I think my approach would be to make a "Content element" section in the "Content" Section, at the same level as your website.

    So in the Content section it would be

    - Content

      - Homepage

        - Page

        - Page

        - Etc.

      - Content Elements

        - Box element

        - Box element

        - Etc.

    So in the "Settings" section you will need to create an empty container document type called "Content Elements" and then you will need to create a document type called "Box elements", which can be created under "Content Elements". On the "Box elements" document type you can then define a "Content" tab where you can add the following properties

    - Header (Textstring)

    - Image (Media picker)

    - Bodytext (Rich text editor)

    This way all the boxes from your image above can be created as unique reusable content blocks, which can be used together or individually on other pages as well.

     

    In order to be able to use the boxes you need to go to the "Developer" section and right click on the "Datatypes" folder and choose "Create". From the dropdown list you should choose a Multiple node picker.

    Then configure this node to read data from the "Content elements" section and then hit save.

    Now you need to add the Multinode picker you just created to your document pages (Those that make up your website) and then you're able to select 1-unlimitied boxes from the content elements folder you created in the steps above :)

    I hope this makes any sense and can be used as a starting point for you.

    Happy umbracoing.

    Cheers,

    Jan

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 16, 2014 @ 11:13
    Dennis Aaen
    0

    Hi CongPhuoc-Phan,

    As I see it there are two ways that you can do something like this. The first option is to make a document type, for that spot box, and let the editor to able to add the document type as childs for the page Trang chû, and the by Razor og XSLT loop through these.

    Another approach, is to make a document type for a folder e.g shared content and still create the documen type for the spot box and let the user creates the boxes in the shared content folder. The way that you could let the user add the boxes to the page is by add the multi node tree picker on the document type for the Trang chû page. You can find the documentation about the multi tree node picker here. http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors-v7/Multinode-Treepicker

    Hope this helps, if any other have another approach on how to do something like this please add your thoughts

    /Dennis

  • CongPhuoc-Phan 4 posts 34 karma points
    Dec 16, 2014 @ 11:45
    CongPhuoc-Phan
    0

    Hi Jan Thank you for your reply, it is quick and very clear

    @Denis: Do we have a way to use Partial, any time I add a new item, it will display the same partial with different content .
    I am not sure, I am a newbie, but I think that would be easier to organise our website.
    If this is a MVC website, I will use a partial view the item

    Regard

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 16, 2014 @ 11:56
    Dennis Aaen
    0

    Hi CongPhuoc-Phan,

    No you can make one Partial that loop though the childen if you choose this approch, or you could make a partial that uses the multi node tree picker, and then it will take and render the boxes that you apply to the page. http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/Built-in-Property-Editors-v7/Multinode-Treepicker

    Hope this answers your question.

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft