We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Blog, Gallery

Gallery App or Content Templates?

I want to create a portfolio where the index page has the option to filter by type. The index will be thumbnail images perhaps with a heading and caption. Clicking on an image or link will take you to a detail page which will have more images and some text (its an agency portfolio).

Is this best done with the Gallery app or manually using templates and perch_content_custom?

What is the main advantage of using the Gallery app?

Or would I be better off using the Blog app for this?

Nigel Coath

Nigel Coath 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Okay thats very helpful, just to be clear is this without using the gallery app? It looks like how I did a blog for a client before you brought out the Blog app.

PS: Just want to say Perch is really coming along now. I think the last thing that would really be worth investigating is a small cart inside Perch with a set of default templates as starters.

I know you have the Foxycart option but for those that want to keep customers on site and costs down its not the ideal solution. I have used Opencart for a full blown shop but for smaller sites with only a few items like say a band site its a bit overkill.

PPS: The documentation is getting a lot better so well done for that!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Correct, that's not using the gallery app.

Thanks, which is the best way in your opinion and can both routes make use of Categories?

Are there any sample templates for the listing and detail are these in the quill folder or somewhere else?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I wouldn't use Gallery for this.

List/detail instructions and sample templates here: http://solutions.grabaperch.com/architecture/how-do-i-create-list-detail-pages

Okay thanks for confirming and thanks for links.

Studied the link on portfolio but struggling to work out which templates to put what based on my intended implementation. I read and re-read and think I am struggling with which templates control what.

Any chance you could look at http://dev.marketingalchemy.co.uk/portfolio and the subsequent link it takes you too for the detail page?

I need to figure out what to put in what template and how to get that menu of categories on the listing page.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure what you're asking.

Have you looked at the test list and detail page?

  1. Which template controls which page?
  2. To display the Category and Pagination links where do these reside?
  3. What do I put in portfolio.php template wise?
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you looked at the test list and detail page?

Yes, but I don't know what I'm looking for.

  1. Which template controls which page?

I don't know - you built it, not me! If you turn debug on, Perch outputs the name of the templates being used, so that might help.

  1. To display the Category and Pagination links where do these reside?

Where do you want to display them? I don't know anything about how you've constructed that page. You're the only person in a position to answer these questions.

  1. What do I put in portfolio.php template wise?

I don't know what you want to do.

Okay let me clarify.

I have an index page portfolio.php, this displays a grid of thumbnails for the portfolio items, there are filter links above to filter by category. Clicking on an item takes you to a detail page.

Currently this is all a static html file just to show the intended layout.

I have experimented a bit on another page http://dev.marketingalchemy.co.uk/portfolio-test however not sure I have it right.

I have this inside my portfolio.php file

<?php
    perch_content_create('Portfolio', array(
      'template'   => 'portfolio_item.html',
      'multiple'    => true,
      'edit-mode' => 'listdetail',
    ));
    ?>

    <?php
    perch_content_custom('Portfolio', array(
      'template' => 'portfolio_listing.html',
    ));
    ?>

Does this look about right?

And how do I add (and inside which template listing or item):

  1. Category filters
  2. Pagination
  3. Link to detail page
Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't build your site for you piece by piece. That's not what support is for.

If you need help building your site, perhaps seek advice from one of our registered developers.

http://grabaperch.com/developers/

I am not expecting you to either. Its just I find it hard finding the relevant info on these functions. While the Portfolio link is useful and I have made some headway, its those 3 things I need pointing to where the info is on the hooks to get this data.

Okay I have made some progress, looking at your docs for pagination it seems to offer the Prev/Next and page 1 of xx, is there a way to just have 1 2 3 4 etc?

Also how do I filter the listing page by category?

Drew McLellan

Drew McLellan 2638 points
Perch Support

We call those 'page links' - check the options at the bottom: http://docs.grabaperch.com/docs/templates/pagination/

Using your two page solution for list/detail http://solutions.grabaperch.com/architecture/two-page-list-and-detail

Works fine.

I have tried the mod rewrite rule to make my current path of portfolio/detail.php?s=xxx clean

RewriteRule ^portfolio/([a-zA-Z0-9-/]+)$ /portfolio/detail.php?s=$1 [L]

But this does not seem to work, what have I done wrong?

Drew McLellan

Drew McLellan 2638 points
Perch Support

How does it fail?

The links stay as portfolio/detail.php?s=xxx

To clarify I have portfolio.php and detail.php using the method explained in your tutorial for separate list/detail pages.It works fine, just cannot get the clean url htaccess to work, yet the same method works for the blog.

Drew McLellan

Drew McLellan 2638 points
Perch Support

The rewrite rule in your htaccess will enable the clean URL to match your pages. It won't change the links output in your HTML. You need to do that via the templates.

Thanks I made the link href="<perch:content id="slug" type="slug" />" and it now works.