Implementing teaser menus.

Permalink
I am new to concrete5. I have a website design to implement that looks like this:

(1) Content pages have a column of html content and can be represented by a teaser that consists of a thumbnail picture and a brief text snippet.

(2) Menu pages have three columns populated by teasers. Teasers link to content pages.

There's a lot more than that but that is the bare bones. I can't find any way in the c5 documentation into implementing this design.

All I need to do really is implement a data type that represents some main html content plus a thumbnail and snippet (my main page type). And then a menu page type which can be authored by providing a list of references to content pages and which can be rendered by looking up the target pages' teasers (thumbnail + snippet).

How would you go about implementing this in C5?

Many thanks.

tonyofthewoods
 
jordanlev replied on at Permalink Best Answer Reply 1 Attachment
jordanlev
Welcome!

You're going to want to put a Page List block on the menu pages. The tricky part is getting it to show the teaser. One way to do this is by adding custom attributes to the page type, and entering the teaser text and image in the page properties. Then create a custom template for the page list block on the menu pages so that it displays these custom attributes (search the forums for how to do this -- it has been asked quite a bit, because it is a fairly common thing to do).

The problem with this approach, though, is that you're double-entering the teaser (into the page properties and into the content itself). If you're feeling adventurous, you can use the custom template I'm attaching, which will actually pull out all of the blocks in an area called "Teaser" (you will need to add this area to your content page type templates, I suggest directly above the "Main" area). To use this file, create a new folder at "YOURSITE/blocks/page_list/templates/", and drop the attached file (unzipping it first) into there. Now you can choose the "Teaser List" custom template for Page List blocks on your site (see documentation on how to do this if you don't know), and whatever happens to be in that "Teaser" area on each page -- presumably an image and some text, or 1 content block with image and text in it, or the "Content Around Image" block (http://www.concrete5.org/marketplace/addons/content-around-image/... ) -- will show up in the page list on your menu page.

Note that this won't work for the RSS feed -- that one is a little more complicated to fix (but doable if you are willing to figure out some code).

Good luck!

-Jordan
tonyofthewoods replied on at Permalink Reply
tonyofthewoods
Many thanks for this!
jordanlev replied on at Permalink Reply
jordanlev
BTW, I packaged all of this up and it's now available on the marketplace (includes fixing the RSS feed so it shows page content as well):

http://www.concrete5.org/marketplace/addons/page-list-teasers/...