How to create "latest articles" and "all articles" like on "How Tos" page?

Permalink
Hi, there,

Since this Site is made with Concrete5, it's got to be pretty easy to do this. But since I'm new, and coming from a horrible experience with Drupal, I'm not really seeing how yet.

I'd like to create a page or block with "recent articles" and "all articles" like on the "How Tos" page on this site.

How do you do that, though? It seems like there's the header, some kind of teaser, and then the link to the article directly.

I supposed I could just type all of the content in one content block, but is there a way to auto-generate it? Is it auto-generated on this site?

It'd be nice to do the same thing for "latest audio" and "latest video", too...

Have a good day, everyone,

- Paul

 
jordanlev replied on at Permalink Reply
jordanlev
Welcome to C5! I too have had some bad experiences with Drupal -- just not able to wrap my head around it for some reason. Concrete5 makes much more sense to me.

Anyway, you want to use the Page List block. For recent articles, sort it by date in descending order ("most recent first"), then limit it to whatever number of recent articles you want to show. For "all articles", don't limit it at all (although you may want to turn pagination on if there will be a lot of them).

Note that the teaser is taken from the "description" property of the page (which you can enter when you first add a page, or by clicking "Properties" from Edit Mode if the page already exists). If you are feeling adventurous and want to display some of the page content itself as a teaser, see this thread:http://www.concrete5.org/community/forums/customizing_c5/implementi...

Good luck!

-Jordan
TheAngelGuy replied on at Permalink Reply
Thanks very much!

How will it know that it's just an "articles" or "video" type of page?

I'm new, so sorry if this is obvious.

- Paul
jordanlev replied on at Permalink Reply 1 Attachment
jordanlev
Short answer: In the page list block, you can choose to have it only show pages of a particular type. But you need to create those page types first.

Long answer:
I'm going to assume that you are the developer/designer for this site, and have some familiarity with how themes work in c5 (if not, no problem -- just let me know so I can adjust instructions accordingly).

So as the designer of a c5 theme, it is up to you to determine what the various "page types" in the site are going to be. If you want "article" and "video" pages, you need to create "article.php" and "video.php" page type templates in your theme's folder. Start out by copying one of the other templates for the theme (e.g. "left_sidebar.php" or "right_sidebar.php"), and rename them accordingly. Then install them from the dashboard (log into, go to Dashboard -> Pages and Themes, click "Inspect" next to your theme, click the "Install" button or whatever it's called).

Now you have two new page types available to your system, and when someone adds a new page they can choose which page type they want the page to be. (Although note that the page type selection is strictly for categorization and data purposes, not for enforcing specific kinds of content -- so there is nothing that prevents someone from adding a video to an article page or adding an article to a video page).

In the page list block, you can specify that it only show these types of pages (so you would have one page list block on one page that showed recent "video" pages, and another page list block on a different page that showed recent "article" pages -- or they could both be on the same page, whatever -- the point is that you can customize each page list to show different stuff).

Note that at first, your page types aren't going to look any different from each other. But you can change the way they look by modifying the page type template (the "video.php" or "article.php" files in your theme folder).

Finally, I'm attaching a packaged version of the custom template I referred to above -- I just submitted this to the marketplace but sometimes it takes a while for things to go through there, so feel free to install this now (just unzip it and drop it into your site's "packages" folder, then go to Dashboard -> Add Functionality, and click the "Install" button next to "Page List Teasers"). Now, after you add a page list block to a page, you can click on it (while in edit mode) and choose "Custom Template", then pick "Teasers" from the list. The page list *and* RSS feed will now show the first block in the 'Main' area on the pages it's listing.

Hope this helps!

-Jordan
TheAngelGuy replied on at Permalink Reply
Hey,

Thanks so much!

That's really awesome.

- Paul