Rotating messages Options
billyhomebase
Posted: Wednesday, September 03, 2008 10:15:28 PM
Rank: Newbie

Joined: 8/19/2008
Posts: 4
Location: London, England
I want to have a list of quotes with 2 data elements, {quote} & {source}. I want to randomly display these quotes on a page.

I was thinking of using a .NET custom user control to read the list of them and randomly pick one.

I would like these items to be managable through the CMS. What is the best way to do this?

I was thinking of setting these 2 element items up as Media Types but can't find out quite how to do that. Is there another way other than making each item a page in itself and then just picking the information out of those pages.

Regards

Billy
drobar
Posted: Wednesday, September 03, 2008 11:18:39 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Personally, I'd do it all with content nodes and xslt... easy for content editors to handle. You could do it with a .net control but that seems kind of over-kill... though it would work.

Create a 'quote' docType with two properties, 'quote' and 'source'. Probably a multiline textfield and a textfield. Probably no need for an RTE because styling probably isn't needed. If you need some simple styling you might use the SimpleEditor.

There would be NO template associated with this docType since you wouldn't display the node independently, but only as part of a regular page.

Then, make a page or folder in your umbraco content tree and start creating 'quote' pages below it. That will keep all your quotes organized. Simply unpublish any quote you want to remove from the rotation.

Now that you've got quotes easily maintainable by your content editors you just need to make a small xslt macro to select one at random to display on your pages. There are numerous examples of how to select random nodes in xslt on the forum... just shout if you can't find one to get you started.

cheers,
doug.

MVP 2007-2009 - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.