Featured articles changed every 24 hours
So here’s the scenario. For one site it’s been decided that every 24 hours they want the frontpage to change featured article.
Is there a way to do two things.
1) Change featured article (homepage only) every 24 hours.
2) Have the ability to change the article to anything they want.
Problems
There are some problems with it.
What exactly the rule of changing nodes,
what is the sequence of nodes that have to be changed automatically?
Unfortunately, we can’t just remove node from nodequeue (the last or the fisrt one) automatically once a day because there are no Actions for it (actions module)
only Action for removing and additing particular node
And nodequeue doesn’t support Rules module – there are no special conditions for rules that could be useful for this task.
That’s why we can’t change node queue by cron
if we don’t know what exactly node has to be added.
At least, I didn’t find any possibilities to do that,
maybe I’m wrong.
We need to know what node have to be shown today
with that parameters.
For example, node with the value of a field is equal to current day
or node with taxonomy term = current day
My solution
I found only one solution, I tried tons of different combinations
and stopped on this one, which seems to me quite logical and convenient:
For the frontpage I created Frontpage queue by nodequeue module
(it is shown on frontpage by view
with maximum nodes in queue, for example = 3)
So after additing a new node to the queue first node will be removed from it.
And I added Triggered rule and Rule set.
Triggered rule – for firing the rule set after additing new content
Rule set – for adding node,
which was just created and which is promoted to front page, to the queue, but not only, this rule set has a schedule in order to be firing once a day while this node is promoted to front page
so we have a circle for changing nodes if there isn’t any new node for frontpage
and in any time we can add any new node to the queue to show it on frontpage.
Modules that I used:
- Nodequeue
- Rules
For random image
There is much easier solution:
Just use views with random sort criteria -
special module Views random seed (Adds a random order handler with seed so random order listings with paging works).

Отправить новый комментарий