Copied to clipboard

Flag this post as spam?

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


  • Bruno Alexandre 29 posts 38 karma points
    Jun 16, 2011 @ 14:30
    Bruno Alexandre
    0

    Best approach to have a list of items in the page properties

    Being a newbie I thought would be best to tell everyone what I'm trying to accomplish and ask what's the best route to take before I drawn myself in the documentation.

    I want to create a simple page that will contain a colection of Text + Image, so I can show the company referals in that page.

    Something like:

    List of ReferalCompany

    public class ReferalCompany { 

        public string ImageUrl {get;set;} 

        public string HtmlText {get;set;} 

    }

    And I would like to know how can I have such functionality in the page properties so the user can, at anytime, add, remove or edit the existing information.

    Is the UserControl the best route? is there anything I can do so in the template I can grab this information and expose it in the HTML?

    Any help is greatly appreciated.

     

    P.S. this is my 7th attempt to post a message! Everytime I say "submit" it just gives me a the Insert a topic page as I didnt write anything at all :-/

  • Drew 165 posts 340 karma points
    Jun 16, 2011 @ 14:41
    Drew
    0

    Rather than store it as a list within a property of a page, why not create a new document type called "Referral Company" with two properties:
    - Image (type: media picker)
    - HTML Content (type: tincymce rich text editor).

    Allow the 'referralcompany' document type to be created under the page that lists the referral companies.

    Then on your page that you want to list your referral companies, simply call a macro which gets all Descendants of type 'ReferralCompany' and spits out the values?
    By doing it this way, it's all nice an clear for any admins using the site - it makes it easy to manage the values and validate them.
    Or if you've got thousands of entries, how about dumping the values in a DB then writing your own XSLT Extension in C# which you can use to pull back the correct ReferralCompany entries?
  • Bruno Alexandre 29 posts 38 karma points
    Jun 16, 2011 @ 15:09
    Bruno Alexandre
    0

    Hummm... Document Type here I go :)

    Sounds lovely :) Thank you very much for the heads up. 

     

    I'm getting to love Umbraco (though it's extremely "blown way" at the start).

  • aghy 129 posts 308 karma points
    Jun 16, 2011 @ 15:18
    aghy
    0

    Hi Bruno,

    Have a look at the MultiType datatype. It will allow you to have a list of image and text items on a single page. It stores all the data in xml and can be displayed using xslt. You also have full control over the front end and can change the way the items look. Just another option to the doctypes.

    Thanks
    Ben

  • Bruno Alexandre 29 posts 38 karma points
    Jun 16, 2011 @ 16:04
    Bruno Alexandre
    0

    Sounds really nice, but the 

    .NET Version: 4.0
    Supports Medium Trust: No

    is a bummer :(

    currently the host only gives 3.5 SP1 

Please Sign in or register to post replies

Write your reply to:

Draft