Weekly Content Display

Permalink 1 user found helpful
I'm working on a website for a summer festival and they have a different band lined up for each week throughout the summer.

I have the "Music Lineup" page listing all of the bands playing in order of the week they appear.

I need to have a block on the homepage the only display the band who will be playing for the current week.

How can I do this so the homepage updates itself automatically as the weeks go by?

leinteractive
 
shadowcomputers replied on at Permalink Reply
shadowcomputers
The Addon ProEvents should do everything you needhttp://www.concrete5.org/marketplace/addons/proevents/...
Shotster replied on at Permalink Reply
Shotster
Given the relatively small number of events in question (1 per week for 12 weeks or so), a page list solution might work as well. The general approach would be to create a page for each band underneath a main "music line-up" page. Then put a Page List block on the home page to display the desired number of "upcoming events." You might want/need to create a special "event date" page attribute and then create a custom template to show only events where the date was "greater than or equal to" today. It would not require any human intervention to have only upcoming event(s) reflected on the home page automatically.

If you're doing a lot with different events, definitely check into a calendar solution, but the particular need you described could be addressed with native C5 functionality.

-Steve
leinteractive replied on at Permalink Reply
leinteractive
But I need to display more than just the name of the band on the homepage. I need to actually show the bands picture, a short snippet of text and then a couple of links.

Could I accomplish that with the Page List block?
Shotster replied on at Permalink Reply
Shotster
> Could I accomplish that with the Page List block?

With some custom page attributes and a custom template, I don't see why not. If you're not familiar with developing for C5, though, it might make more sense to look for another solution. However, if you don't mind getting your hands dirty and would like to learn more about developing for and customizing C5, it would be a good learning experience.

While I've never done precisely what you want, the general approach I'd suggest is to create a couple page attributes - perhaps "event_date" and "event_photo". Create fully fleshed out pages for each event. Create a custom template which pulls data from the page to display an image and synopsis for each event. You could display the next 3 upcoming events, the next 1, or whatever. Each event summary (page list item) would link to the full-blown event details page.

-Steve
leinteractive replied on at Permalink Reply
leinteractive
I'm still relatively new to C5, so maybe I'm not quite getting at what you're saying.

How would the page list block just pull in specific pieces of data from another page? (image, text snippet, etc.)
Shotster replied on at Permalink Reply
Shotster
A block can have any number of "views" associated with it. They are called "Custom Templates" and can be accessed from the popup menu that appears when you click a block while a page is in edit mode. A template defines the underlying mark-up (HTML) as well as the specific block data you want to appear for that particular block instance. This allows you to completely change the appearance of a block simply by selecting a different template.

http://www.concrete5.org/documentation/general-topics/custom-templa...

(Also, search the forums and how-to section for a more detailed explanation of templates.) Anyway, what I'm suggesting is creating a custom template for the page list block that makes use of the attributes you have defined. This involves getting your hands dirty with PHP, so if you're not interested in that, definitely look into other options.

-Steve
leinteractive replied on at Permalink Reply
leinteractive
Yea, I understand how custom templates work.

But what I'm not understanding is how I can have a single block on the homepage pull in data from a single block on a different page (the music page).

I don't get how page attributes can trickle down to the block level.
Shotster replied on at Permalink Best Answer Reply
Shotster
> But what I'm not understanding is how I can have a single block on the
> homepage pull in data from a single block on a different page (the music page).

It's not a block pulling data from another block. It's a block displaying "page data," and you're simply customizing what data are displayed and how.

> I don't get how page attributes can trickle down to the block level.

Attributes don't "trickle down". Attributes are simply chunks of user-defined data that can be associated with various items within the C5 system (like pages, users, files).

http://www.concrete5.org/documentation/general-topics/attributes...

When you create a custom page attribute of type "File/Image," for instance, you are simply saying, "I want to be able to associate a specific file/image with a page." Actually specifying the value of that attribute (in this case, choosing the file to associate with the page) is done when the page is being edited. Then, in the custom template for the Page List block, you would display the value for that attribute. IOW, a page list is a list of pages, and each page can now have an image associated with it. In PHP code, you check to see if a page has a value for that attribute, and if it does, you display it.

That's just a conceptual overview. For implementation details, you can search the docs and forums; or perhaps someone will provide some sample code.

-Steve
leinteractive replied on at Permalink Reply
leinteractive
Ohhhhh! That makes sense now. I've never looked at any of the other Page Attributes other than a simple checkbox. Putting a file or the like as a page attribute makes sense now.

Alrighty then. Thanks for your help!

Time to to get my hands dirty.
Shotster replied on at Permalink Reply
Shotster
No prob. Here a recent thread that has some code which might jump start your efforts...

http://www.concrete5.org/community/forums/customizing_c5/custom-att...

-Steve