Forum

Thread tagged as: Runway

Product Catalog

I'm building a site with a product catalog—no e-commerce.

As a starting point, should I use the List & Detail technique in the "Portfolio with Categories" (https://docs.grabaperch.com/video/v/portfolio-with-categories) video? Or would the setup be different in Perch Runway?

Thanks!

Franz Neumann

Franz Neumann 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

In Perch Runway I would probably use a Collection for the products and Categories.

Yes, that's what I've done. Would I use the video however, as a starting point to build the actual list/detail setup, just replacing perch_collection for perch_content_custom? Thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's it!

I'm having difficulties getting a simple list/detail setup working in Perch Runway. I've created the listing page and the detail page from master page templates. I've created listing and detail content templates and added some products in my collection. Viewing the listing page works great. I see a list of the names of the products, which I've linked so:

<a href="/detail-page/<perch:content id="slug" for="product-short-name" type="slug" />">
<perch:content id="product-full-name" type="text" /></a>

The problem is viewing the link. If I simply view www.domain.com/detail-page I see my page fine (though obviously without the content from the collection. When I click a link from my listing page, though, I'm taken to a Not found page with the following:

<h1>Sorry, that page could not be found.</h1>

<!-- Undefined content: Error description -->

My code for the detail page includes:

    perch_collection('Products', [
      'template' => 'product_item.html',
      'filter' => 'slug',
      'match' => 'eq',
      'value' => perch_get('s'),
      'count' => 1,
    ]);

My slug code in my content template is:

<perch:content id="slug" type="slug" for="product-short-name" suppress="true" />

Any ideas?

(By the way, I finally realized slugs can't use "for=" on an id that has an underscore. I was getting slugs with names like fa-23es-gs3.)

Thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

What does your route look like?

My Routes field was blank for the listing page. I've now added detail-page/[slug] All that did was break the page layout I had for header and footer. In other words, the header appear but all image paths are broken. And the detail content does not appear, as before. I don't have any routing on the Product listing page other than /products

Thanks.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You need something like:

detail-page/[slug:s]

and you need to make your asset paths root-relative. e.g.

/images/foo.gif

Brilliant. Thanks!

I have it working now. Is there documentation with more info on slug:s versus just slug? I'm trying to understand the ":s" portion but can't find anything in the docs. Thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've followed the Portfolio with Categories video tutorial and am getting hung up toward the end, definitely due to my own ignorance, but perhaps also because this tutorial is for Perch and not Perch Runway.

I can view the portfolio page with all the items in my collection. I can click an item and see it on the detail page along with the listing of the two categories, both linked. I've created the category page with the complete code from the tutorial as well as the category_single.html template. If I mouse-over the category links, I can see that they should go to domain.com/category/work/my-category/ or domain/category/sectors/my-category/

However, when I click one of those links I get a "Sorry, that page could not be found" error. My hunch is I need some routing on the category page, but what that would be I have no idea or where to find it.

Thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you need to add a route to match those URLs. Is work/my-category the category path, or is work something else?

Hi Drew,

I'm just following the tutorial code, which generates that link on the categories, with "work" being one of the category sets ("sector" being the other), and "my-category" being one of the categories in the "work" set.

I imagine the routing needs to be something like category/(category set name here)/(category name here).

Thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that should do it. Is that what you have?