Author Topic: Displaying Multiple Articles  (Read 1088 times)

moggiex

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Displaying Multiple Articles
« on: November 05, 2009, 02:41:03 PM »
Howdy,

May be a daft question, but unsure on how to do this.

I would like to create a page, where multiple articles are displayed, not just one. Can someone point me in the right direction?

Kind regards,

Matt

Xander

  • Developer
  • Administrator
  • Full Member
  • *****
  • Posts: 240
  • Karma: +5/-0
    • View Profile
    • CompactCMS.nl
Re: Displaying Multiple Articles
« Reply #1 on: November 05, 2009, 10:05:31 PM »
This is always painful :).. You can't right now :-\.

The problem is that the url looks like site.com/features.html. This tells the CMS to include features.php in the template, but doesn't take any 2nd or 3rd variables. I'm unsure right now on how to make otherpages to be included in different locations. I'll think about it, but any suggestions will be greatly appreciated.

If it is a static file to be included you can use <? include_once('./content/file.php'); ?> in the template.

Sorry for the dissapointment!
Xander.
Don't ever hold back your suggestions. Help me either to improve CompactCMS or spread the word about it on sites such as Twitter, Digg, StumbleUpon, etc :). Thanks!

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Displaying Multiple Articles
« Reply #2 on: November 12, 2009, 08:03:30 AM »
Hi moggiex,

how would you specify which pages to include?

For example, should your content manager be able to create a link like /index.html?page_list=page1,page2,page9

Or are you thinking more of a blog, which might show, say, the 5 most recently edited pages?

Hi Xander,

in my shop module I have used 2 new templates (well, 3, but ignore the 3rd for now)... the first is to "browse items" - in addition to showing the list of items, above the list I am displaying a regular CCMS web page. Likewise, the 2nd template is to "view item details" and again there is a regular CCMS web page above it.

I reckon there would be a way forward to put multiple page content on a single URL - but it depends a bit on what moggiex actually wants to acheive.

The shop is visible at originalsbynada.com.au

Chris.

abicio

  • Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Displaying Multiple Articles
« Reply #3 on: November 19, 2009, 05:26:37 PM »
I think you can make it manually (as decribed by Xander):

1. open the page which you want to include others articles
2. puts the php tag "include" with the name of the page (and the path) which you want to include

I never tried it, I hope it works...  ;D

Xander

  • Developer
  • Administrator
  • Full Member
  • *****
  • Posts: 240
  • Karma: +5/-0
    • View Profile
    • CompactCMS.nl
Re: Displaying Multiple Articles
« Reply #4 on: November 19, 2009, 05:38:32 PM »
It does work. It's what I do when I e.g. have contact details to be included on all pages. Just add <?php include_once(./content/contactdetails.php);?> and it will show the contents of that file on the place specified. If something changes you use the CCMS editor to change contactdetails.php and it will change on all pages. If you'd like to have it on certain pages you can now use the templates. One template with the inclusion, one without. Apply templates accordingly.

It's not the neatest way, but I just can't think of a way to make content appear on certain pages without a difficult to manage back-end change. E.g. how will you be able to change what secondary content shows where and when? Maybe with the upcoming module manager, but still.. You know my primary focus: keep it as compact and simple as possible. It has its downsides, but it appears to be unique in the CMS world...

Cheers!
Xander.
Don't ever hold back your suggestions. Help me either to improve CompactCMS or spread the word about it on sites such as Twitter, Digg, StumbleUpon, etc :). Thanks!