Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Display a list of sub-pages (listing of articles in a category)
#1
I need advice on how to aproach programing for a simple Category -> Product/Service website
I am a medium level experience PHP programmer.

End pls excuse my english.

I need to create a simple website with a few main pages (top level pages) and subpages for them.

Something like Category (top level page) -> Products or Services (sub pages)

In the top level page I need to display a list of the subpages in a fashionable way, each list item having:

1. Thumbnail for the subpage (product or service)
2. Title of subpage
2. Excerpt of the subpage
3. Read more link

The subpage will be a regular second level page.

I thought I would use the i8n Custom fields Plugin to define the thumbnail path, and excerpt for each subpage

How would you aproach this?
Where to place the code? in functions.php of template?
Make a plugin ?

I am sure this would be useful for many purposes.
Reply
#2
tazmandev Wrote:I thought I would use the i8n Custom fields Plugin to define the thumbnail path, and e

Seems like no-one is willing to share some experience on this topic ...
Reply
#3
tazmandev Wrote:Seems like no-one is willing to share some experience on this topic ...
Sometimes posts get overlooked and bumping it occasionally can do wonders. Smile

tazmandev Wrote:I am sure this would be useful for many purposes.
I totally agree with you there, I might even have a use for something like this myself in an up-coming project.

I saw your first post, but couldn't really come up with a good approach... sadly, I'm not a good programmer.
Reply
#4
may be right for you this plugin
http://get-simple.info/extend/plugin/pages-excerpts/62/
Reply
#5
tazmandev Wrote:I need to create a simple website with a few main pages (top level pages) and subpages for them.

Something like Category (top level page) -> Products or Services (sub pages)

In the top level page I need to display a list of the subpages in a fashionable way, each list item having:

1. Thumbnail for the subpage (product or service)
2. Title of subpage
2. Excerpt of the subpage
3. Read more link

The subpage will be a regular second level page.

Possible solution with plugins I18N, I18N Custom Fields, I18N Search and DynPages:
  1. Use the I18N Custom Fields plugin for thumbnail (image field) and excerpt (text or WYSIWYG field)
  2. Create each top level page and put {% search category %} on it (category different for each top page - component search see below - uses DynPages)
  3. Create the subpages with parent = top level page, tags = category and a slug name which can be sorted in the order you want the products to be sorted. Use a template product.php (see below)
  4. Create a template product.php which displays the product image (using I18N Custom Fields) and the content of the page instead of the content only
  5. Create a component search which gets the argument (the category), uses return_i18n_search_results (I18N Search) to get all products for this category sorted by url and then displays the results in a custom way with image and excerpt - involves reading the page XMLs to get this information.
  6. Use I18N plugin to display the navigation
Steps 2+5 will be greatly simplified with the next major version of the I18N Search plugin.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#6
tazmandev Wrote:I need to create a simple website with a few main pages (top level pages) and subpages for them.

Something like Category (top level page) -> Products or Services (sub pages)

In the top level page I need to display a list of the subpages in a fashionable way, each list item having:

1. Thumbnail for the subpage (product or service)
2. Title of subpage
2. Excerpt of the subpage
3. Read more link

The subpage will be a regular second level page.

I think that is almost what I am doing on my site at this page:
http://www.cartocopia.com/portfolio/

I'm using Mike's Page Caching plugin: http://get-simple.info/extend/plugin/page-caching/65/

Then in that portfollio page I have the following (simplified for you) code in my template (for that page):
Code:
/* Uses Mike's page caching plugin http://get-simple.info/extend/plugin/page-caching/65/ */
  $childlist = getChildren(return_page_slug());

  $subpagelist = array();
  foreach($childlist as $child) {
    if (returnPageField($child, 'private') != 'Y')
      $subpagelist[] = array($child, returnPageField($child,'title'), returnPageField($child,'menuOrder'));
  }

   /* sort children my menuorder subval_sort is built in to GS2.1+ */
  $subpagelist = subval_sort($subpagelist ,2);

  foreach($subpagelist as $subpage) {
    $thumb = '/data/uploads/' . $subpage[0] . '_thumb.jpg';
    $link = $subpage[0] . '/';
    $title = $subpage[1];

    echo .....................;
  }

So by making the thumbnails <slug>_thumb.jpg you can grab their reference, then on the echo line just build your image, title and link.

Add on the page excerpt plugin (as suggested by Oleg) http://get-simple.info/extend/plugin/pages-excerpts/62/ and you can also grab an excerpt (200 chars, text format by default) in the loop with something like:
Code:
$snippet = page_excerpt($subpage[0]);

then also echo it out.

Good luck-

-Rob A>
Reply
#7
still have such a plugin
http://get-simple.info/extend/plugin/sim...ontent/87/
Reply
#8
Now I am overwhelmed with solutions. I will look at every one of them this afternoon. Thank a lot.
Reply




Users browsing this thread: 2 Guest(s)