Theoretical Question About Page Attributes

Permalink 1 user found helpful
I just had this sudden realization that I can do so much more with C5 out of the box than I thought I could. Kinda funny how those little things just kinda "click" huh?

Anyways...let's say that my homepage has a JavaScript rotator that slides through half a dozen images, each promoting something different, and each linking to a page on the site with more info.

Can't I handle all of this functionality with Page Attributes?

First, make an attribute where the image for the homepage rotator is stored. Then make attributes for Start Date and End Date of the image so that it can go up and come down based on those dates.

Then I create a custom template for the Page List block to display only the images from the pages I specify and only if they have valid dates.

Is this theoretically accurate?

Is it also possible to make the entire page itself be published or unpublished based on the dates defined in the attributes for that page?

This question kinda stems from another thread I started about publishing blocks with specific start and end dates (which I never got an answer to).

I was just thinking more about it and wanted to ask this too...

leinteractive
 
adamjohnson replied on at Permalink Reply
adamjohnson
Sounds like you have a similar idea to this tutorial:

http://www.mesuva.com.au/blog/technical-notes/adding-ajax-source-pa...
leinteractive replied on at Permalink Reply
leinteractive
That's about exactly what I was thinking.

Is there a big difference between the two methods?

I guess the way I had thought it through is that each item that I feature on the homepage would actually be attached to the page created for it, and thus could all be edited and created at once.

The method you posted seems to require creating the page that each item will link to and then going to that single ajax page and adding said item to it.

Is there a major benefit/downfall to doing it either way?
adamjohnson replied on at Permalink Reply
adamjohnson
The simpler you can make it the better. I know the Dojo Page Filter add on only has to add the page and its attributes and it will automatically get added to the page list.
jordanlev replied on at Permalink Reply
jordanlev
Unless I'm misunderstanding your question, I don't think the difference between the two approaches is what you think it is.

In both cases, you create a new page for each piece of content and the page list on the home page pulls something from those pages. The difference is in how it pulls that content -- either by using custom attributes (as you suggest), or by actually pulling the page content itself via ajax (as the linked tutorial shows).

When I build sites I always come across this questions -- and it really comes down to a design decision -- specifically, how do you want to design the editing interface for whoever is managing the site content?

My golden rule is to avoid forcing them to enter the same content in two places (because just like programming, this leads to problems when you want to change it and you forget to look for it in all the places it exists). So, if the content you want to show on the home page is the same exact content that appears somewhere on the interior page, then I would pull the content from the page. But if the content you want to show on the home page is slightly different than the content as it appears on the interior page (for example, it's a different thumbnail image or an excerpt/abstract that differs from the first paragraph or two of text on the page), then I would use custom attributes.

SIDE NOTE: When I want to pull content directly from a page (i.e. not the custom attributes), I would *not* use the approach linked to in the above article. Instead, I created a free custom template for the Page List block that pulls content from the page in a much saner fashion, called Page List Teasers:
http://www.concrete5.org/marketplace/addons/page-list-teasers...

So, I hope that addresses what you were thinking of. If not, please clarify and I'd be happy to try to explain further.

-Jordan

PS - I think you need to enable "Advanced Permissions" to get the feature that publishes/unpublishes pages based on dates (I think? Not 100% sure about that though)
leinteractive replied on at Permalink Reply
leinteractive
Maybe we're talking about the same thing in different ways here...but this is how I understand the method in the link above to work:

1. Create a blank page with a single area on it.
2. Add as many blocks to this area as you want. Each block being a piece of content to be showcased in the slide.
3. Each block in that area ALSO has to have a separate page in the sitemap that it an link to when clicked

The method I was considering combines the content from the Blocks in the above example into the Page Attribute. This was I create the page once, assign the appropriate Attributes to it (image, dates, links, etc.) and then display those in a Page List Block on the homepage.

Content only needs to be created once and maintained in one place.

But (unless I didn't read the link correctly) I see how that method could just as easily use Page attributes to populate that single area on the AJAX loaded page. It just seems heavy to me to actually go and load an entire page which subsequently loads attributes from other pages. I think you could just skip the AJAX part and do it all through a Page List directly.
jordanlev replied on at Permalink Reply
jordanlev
I believe the above linked method is one page per slide (so if there's multiple blocks in an area on one page, then those multiple areas all make up 1 slide -- not each block being a different slide as you say in #2).

What you suggest about putting all of that in the Page Attributes is basically the same thing, it's just that the user would have to deal with the attribute UI which is not as nice to use as blocks on a page (in my opinion), and also you lose out on a bunch of built-in features: not appearing in search results, not tracked in page revision history, no page defaults or copying/scrapbooking, etc.

That being said, it's easier for you the developer to pull out that data if it's stored in page attributes as opposed to blocks of content on the page. So it's a tradeoff between ease of development versus ease of content editing, but functionally they achieve the same thing.