Description in addition to first block

Permalink Browser Info Environment
Is it possible to display both the page description AND the first block?

In my case, I have pages that have an image as the first block and I would like to display the image along with the page description on the overview page.

I presume it's pretty straight forward to pull the page description and display it, but my PHP knowledge is very low. I played with the template file but couldn't get anything working.

I also tried your page_list.php generic template from another post and nearly had it working with that, but there seemed to be a bug in the code (it was pulling the second page's content and making it part of the first page summary).

Any help would be appreciated.

Thanks.

Type: Discussion
Status: New
formulate
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Shouldn't be too hard (although you'll need to play around with the placement and your CSS to make it look exactly right). Create a new directory on your server here:
SITEROOT/blocks/page_list/templates/

...and copy this file into that new directory:
SITEROOT/packages/page_list_teasers/blocks/page_list/templates/teasers.php

Now edit the new copy of that file (SITEROOT/blocks/page_list/templates/teasers.php) and add the following code somewhere around line 24~27 (should be an <h3> and <div> there -- put it wherever you need it to be that makes sense for your theme):
<?php echo $cobj->getCollectionDescription(); ?>


You might need to put another div around that snippet of code to be able to style it appropriately in your theme CSS.

Hope that helps!

-Jordan
formulate replied on at Permalink Reply
formulate
Thanks Jordan for your incredibly prompt response. What you suggested worked and definitely got me closer to my end result.

However, my issue now is that Page List Teasers is literally only displaying the content of the block (in this case my image) and not any of the additionally required block assets (such as javascript used by the block).

I am using the zoom image block as my first block so that the thumbnail image is clickable for a larger view. This works great on my article page, but when page list teasers grabs the block, the zoom no longer works due to lack of the javascript file. I tried manually adding the javascript from the article page header to my theme header.php, but that only broke the site.

Any thoughts on how I can get around this issue? I really need the thumbnails zoomable on both the page list and the article page itself. Otherwise I would just use a custom page attribute for the image and use the standard page list block. I hoped teasers would get me around the issue.

Here is the rough functionality test site I'm working with. Click on either article to see the zoom work on the actual article page.

http://formulate.ca/c5/september-2011/...

Thanks.
jordanlev replied on at Permalink Reply
jordanlev
Unfortunately I don't think Page List Teasers is going to do everything you want it to. I'm guessing there's some bug or limitation in C5 that makes it not include block js/css when displaying them in a non-standard way (although Page List Teasers is using standard C5 API calls -- but often they don't do things exactly as they should).

So I think you're going to have to code this one up yourself.

Best of luck.

-Jordan
formulate replied on at Permalink Reply
formulate
Thanks for your help Jordan. I think making the zoom thing work on the overview page is probably beyond my skills with C5 at this point. I think on this project I'll end up using another CMS (specifically ModX) where I know I can deliver the functionality I require.

This is actually one of my largest gripes with C5, mainly how difficult it is for non-php folk to repurpose content from other pages > areas > blocks. Teasers at least addresses this to some degree, but is still fairly limited. It would be nice if there was an easy way to say: grab X piece of content from Y page and Z block (or something along those lines). While this can probably be done via PHP, most other CMS's have this functionality baked in for non-PHP savvy users.

Anyway, thanks again.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.