|
{mosignorehit} I needed to publish details of a special offer on www.sigmasdi.co.uk but didnt want to be concerned with logging back in the admin section and remembering to unpublish it once the special offer had expired. I looked at several "Content item in module positions" modules, but not of them seemed to take into consideration its published state, or its finish publishing attribute I wrote this functionality into a mambot, so it can be used in normal content as well as Virtuemart product descriptions (if enabled) and module positions.
Here's what I did for my "special offer" - install the mamot and make sure its published
- create a content item with the details of your special offer (keep in mind where it will appear and format the layout accordingly)
- Set the finish publishing attribute to be when your special offer finishes, and make sure your content is published
- save the content and note its id
- go to the modules screen and create a custom module
- I turned the title off so that when the special offer expired all traces of it disappeared
- in the module body put the mambot code
{specialofferitem <content id from earlier>}
- Choose the position of your module, the pages it will appear on and make sure its published
- Viewing your site should now show the content in the module position requested with the words "offer ends <finish publish date>" appended to the end. If you want the text to say something else, you can change it in the mambot configuration screen. Getting rid of the value altogether results in nothing being appended to the content.
A couple of technical notes: - Everytime the the mambot is run it checks to see if the finish publish date has passed, if it has then it will unpublish the content, and obviously not display the content in the module position. This means that it may appear to be not working if you were to go into the content administration and check to see if the content is still published (if no-one has looked at the page your speacial offer is published on, then the content will still show as published) The upshot is though: no user will see the content from the mambot if the finish publish date has been passed
- Its based on kksou.com's include content item mambot (credit where credit is due)
- its just occured to me that you could use the conditional content item include (if you're on Joomla 1.5) I guess that would look like.....
{include_content_item_if <content item id> (return (time()<=strtotime("YYYY-MM-DD HH:mm:ss")) }
Where YYYY is the year, MM is the month..... and so on and so forth
Download the mambot (joomla 1.0.x) here
Add as favourites (90) | Quote this article on your site
Only registered users can write comments. Please login or register. Powered by AkoComment Tweaked Special Edition v.1.4.6 AkoComment © Copyright 2004 by Arthur Konze - www.mamboportal.com All right reserved |
|
Last Updated ( Monday, 18 August 2008 )
|