MonkeyCMS Forum

Go Back   MonkeyCMS Forum > MonkeyCMS > Content Discussion
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2007, 06:57 AM
chrisjlocke chrisjlocke is offline
Super Moderator
 
Join Date: Apr 2007
Location: Essex, UK
Posts: 1,051
Default Featured

I'm adding in content, and using the 'text' for the bulk of the content. Whats the purpose of the 'featured' elements? Where would I use them?
Thanks!
__________________
http://www.cscomputerservices.co.uk/ | Providing complete computer solutions | Web hosting with MonkeyCMS pre-installed
Reply With Quote
  #2  
Old 05-02-2007, 09:04 AM
Colin Colin is offline
Administrator
 
Join Date: Apr 2007
Posts: 1,593
Default

This allows you to highlight a random piece of content from a definition and display it with the featuredcontent function:

(featuredcontent|template|definitionid|lastx)

template is the template to display the featured content in
definitionid is the definition you want the content to be in
lastx is the number of pieces of featured content to pick the featured one from (optional)
Reply With Quote
  #3  
Old 11-10-2009, 01:04 PM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 448
Default

Quote:
Originally Posted by Colin View Post
This allows you to highlight a random piece of content from a definition and display it with the featuredcontent function:

(featuredcontent|template|definitionid|lastx)

template is the template to display the featured content in
definitionid is the definition you want the content to be in
lastx is the number of pieces of featured content to pick the featured one from (optional)
Is there any way to display the last n featured items rather than just one?
Reply With Quote
  #4  
Old 11-10-2009, 01:31 PM
chrisjlocke chrisjlocke is offline
Super Moderator
 
Join Date: Apr 2007
Location: Essex, UK
Posts: 1,051
Default

WHat are your requirements? To display the last n featured items, just create an advanced index with 'featured=1' in the 'where' clause. Or do you want a random item from the last n featured items? Or do you want n random items from the featured items? Or n random items from the last n items?
__________________
http://www.cscomputerservices.co.uk/ | Providing complete computer solutions | Web hosting with MonkeyCMS pre-installed
Reply With Quote
  #5  
Old 11-10-2009, 01:58 PM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 448
Default

Decisions, decisions...

n random items from the featured items would be good if possible, for the time being I'm going to go the advanced index where clause route.
Reply With Quote
  #6  
Old 11-11-2009, 01:43 PM
chrisjlocke chrisjlocke is offline
Super Moderator
 
Join Date: Apr 2007
Location: Essex, UK
Posts: 1,051
Default

So you can't just use the above function n times then? Or can't you risk pulling out duplicate items?
(Not a great solution, but a quick fix...)

Logistically, it can be tricky pulling out n items, as you've got to keep track of what you've already pulled out. Do-able I guess, but could be a server hog of code... (well, using my inefficient code, anyway...)
__________________
http://www.cscomputerservices.co.uk/ | Providing complete computer solutions | Web hosting with MonkeyCMS pre-installed
Reply With Quote
  #7  
Old 11-11-2009, 01:49 PM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 448
Default

OK, maybe I'll steer clear of that idea then!

I had thought about repeating that funtion but duplicates would look strange unfortunately.
Reply With Quote
  #8  
Old 11-11-2009, 01:58 PM
chrisjlocke chrisjlocke is offline
Super Moderator
 
Join Date: Apr 2007
Location: Essex, UK
Posts: 1,051
Default

Nah, its not a great issue, but just a 'warning' that such a function could impact a large site. If you've got to pull out 10 items, and check each time whether its already been pulled out, and you're doing that all at once when 50,000 users are looking at the homepage, the server may cough!

I could see where it might be useful though. I've seen it on other sites, and can see it useful on my own. I'll dig around with some plugins.
__________________
http://www.cscomputerservices.co.uk/ | Providing complete computer solutions | Web hosting with MonkeyCMS pre-installed
Reply With Quote
  #9  
Old 01-22-2010, 11:49 AM
harvey harvey is offline
Senior Member
 
Join Date: Jun 2008
Posts: 448
Default

Had a need for this functionality again and stumbled upon this:

http://www.monkeycms.com/forum/showt...ghlight=random

Result!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 06:52 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© Poisonous Monkey