Welcome to the Geeks & God Static Archive. Read more »

Rotate content by week of the year

Joined: 09/20/2007

Can someone point me in the right direction? I am working to finalize the new church website. One feature that I am looking at implementing is to have a weekly memory verse. I would like to have 52 verses in the database. Then, create a view that will show the verse, with a filter or argument that chooses the correct verse based on what week it is.

I have been doing some homework, and it looks like I would need to create some PHP code to insert an argument into the block that will display the verse. Then I suppose, my views will have to accept the argument, parse it and match it up with the verse for that week.

Is that the right way to attack this?

For my content, I plan to have a custom content type with three fields: verse text, verse passage, and order which will be an integer from 1 to 52.

Is there a good resource on how to insert arguments into a block so that the view can use those arguments to filter nodes?

Thanks.

John
john-simons.com

Curt
Curt's picture
You're working too hard

John,

I think you're working too hard, or maybe just avoiding the simple. Here's what I'd do:

First create a custom content type--call it "memory_verse," or something like that. Use the node title to contain the reference, e.g. John 3:16; the body contains the text. Add a date field; this becomes the last date the verse is "valid" (I'm talking technical, not theological, here 8=) ).

Next, create as many memory_verses as you like; you can work ahead just one week, or ten years. At a minimum create two for the upcoming two weeks for testing.

Finally, create a view to create a block view (you might want a page view, too, showing the entire node). Select memory_verses where the date is greater than now() (I may not have that exactly correct). Sort by the date (ascending) and only return 1 entry. You might want to just list the title as a link to the node, or you can include the verse.

That's it.

Curt

Joined: 09/20/2007
Yeah - that would work.

OK, so there are easier ways to do it. I hadn't thought about the method that you suggest, but I had thought about using the scheduler module to publish and unpublish verses. However, I was looking to see if there is a way to set it up once and let it run until the cows come home. That way, I never have to mess with it again.

For know, I will use either your method or scheduler. Maybe I will come back to something more time consuming later.

The other solution that I thought of was to use the verse of the day or verse of the week feeds from the ESV website. I tried the aggregator module, but it only would show the link to the verse, not the body. I may check out the Feed API to see if will let me parse the feed into a block so that I can display the verse, reference, and link to the ESV site for those who want to read more.

John
john-simons.com

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
3 Ways

There are three ways I see to do this.

  1. Add a date field and sort based on that. Like the comment above. (I don't recommend this one. It seems to complicated and not quite the solution to the problem.)
  2. Create a node type for the bible verses and fill in 52 of them. Then use the scheduler module to have them publish once a week. Use the touch feature on the scheduler module to have the scheduled launch time be the created date on the node. Then use a view to create a page, a block, and a feed (this could be combined with feedburners email feature) for this. Just sort by the node created date.
  3. Use a module like SimpleFeed (this will be around for the long haul. It's used on some pretty big websites and it's built for performance) to create your nodes based on something like the ESV bible feeds. Then create the views just like the previous bullets.

I'd recommend going with one of the last 2 bullets. Good luck.

Matt Farina
Geeks and God Co-Host
www.innovatingtomorrow.net
www.mattfarina.com

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com