Forum
Category list
I have created a set of categories, and I would like to display item in a category list with a photo and title. As of now, I can add a tag/slug to a page, and displaying it with a link. But the link return with 404.
I read the instructions in category/categories, but kind of hit the wall.
Can anyone get me to the right direction. A sample page and template perhaps?
This is what I have so far in my template.
<perch:categories id="destinations" label="Tag" set="destinations" required="true">
<perch:before>
<h3>Test title</h3>
<ul>
</perch:before>
<li><a href="/category/<perch:category id="catPath" />"><perch:category id="catTitle" /></a></li>
<perch:after>
</ul>
</perch:after>
</perch:categories>
My page template
<?php perch_content_create('Subpages left content', array(
'template' => 'subpages/subpages_left_column.html',
'multiple' => false,
'edit-mode' => 'listdetail',
'sort' => 'date',
'sort-order' => 'DESC',
'searchable' => false,
'filter' => 'slug',
'match' => 'eq',
'value' => perch_get('s'),
'count' => 1,
));
perch_content_custom('Subpages left content', array(
'skip-template' => false,
'template'=>'subpages/subpages_left_column.html'
));
$pagetitle = perch_pages_title(true);
PerchSystem::set_vars(['title_returned' => $pagetitle,
]);
perch_content_custom('Subpages left content', array(
'page'=>'/destinations/*',
'template'=>'widgets/rating_product_title.html',
));
?>
<?php
perch_comments('subpages', [
'template' => 'comment.html',
'sort-order' => 'DESC',
]);
perch_comments_form('subpages', 'Destinations');
?>
What's the URL you're getting, and what URL have you set up a page for?
The URL displayed is /category/destinations/beaches/
Do you have a route set up to handle that URL?
Not really. How can I set up a route?
Can you post your diagnostics report?
Diagnostic report
Ok, so you'd create a master page to display content based on the category and then add a route such as
Don't you have a full tutorial on how to create this. With sample pages and templates. I have tried this: https://docs.grabaperch.com/video/v/portfolio-with-categories/ but I cannot simply get it to work.
We don't have a full tutorial for every task someone might need. Where are you running into problems?