Forum
Get current category to list on page
I'm trying to get this category_single.html template....
<h1><perch:category id="catTitle" type="smarttext" label="Title" required="true" /></h1>
<perch:category id="desc" type="textarea" label="Description" editor="markitup" markdown="true" size="s" />
To list at the top on this category.php page...
<div id="text">
<h1 class="f-fp">This is the Category List page</h1>
<p><a href="portfolio.php">Products</a></p>
<?php
if (perch_get('cat')) {
perch_category(perch_get('cat'),array(
'template'=>'category_single.html'
));
perch_content_custom('Portfolio', array(
'template' => 'portfolio_listing.html',
'page'=>'/portfolio.php',
'category' => perch_get('cat'),
));
} else {
perch_categories(array(
'set' => 'Products',
));
}
?>
</div>
I need it to output the category_single.html from the slug ../category.php?cat=products/demolition/
Currently only the portfolio_listing.html outputs (a list of all the products with the "demotion" category.
Do you get any errors?
I don't get any errors when I load ../category.php?cat=products/demolition/
I get this if I load ../category.php
Is this an error?
I can output the content of the default category.html using....
Can this be modified to use the template here? content/category_single.html
Perhaps it's me. I think category_single.html should be in the categories folder yes?
What debug output do you get on
category.php?cat=products/demolition/
?My original problem I solved. I'd incorrectly put the template category_single.html in the "content" template folder it should have been in the "categories" template folder so nothing was being output on...
Now this has been corrected.
I was getting this with debug on befroe category.php?cat=products/demolition/