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 :-/
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?
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.
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 :-/
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.
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).
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
Sounds really nice, but the
is a bummer :(
currently the host only gives 3.5 SP1
is working on a reply...