Thread tagged as: Problem, Error

Category List

I need help to sort the category listing of pages. But i get an error (404) when clicking on pages in category link.


      if (perch_get('cat')) {
      //output the category title and description, using default category.html template
      'filter'=> 'catSlug',
      'match' => 'eq',
      'value' => perch_get('cat')
        // Output a listing of Destinations in that category
         perch_content_custom('Subpages left content', array(
         'template' => 'subpages/destinations-listing.html',
         'category' => 'destination/'.perch_get('cat'),
         'sort'=> 'RevSubDetailspageH1Title',
         'sort-order' => 'ASC'
         )); }
     else { // if no query string, just output a list of categories, displayed as 'tags'
      echo '<h2>The Categories</h2>';

URL pattern Route: category/[slug/slug:catPath] and this is what I get:


<perch:before><ul class="pub-listing"></perch:before>
 <perch:if exists="RevDetailsPageSliderImg"><a href="<perch:content id="_page" />">
 <img class="main-image fl" src="<perch:content id="RevDetailsPageSliderImg" type="image" width="450" height="215" crop="true" />" alt="<perch:content id="RevDetailsPageSliderImgalt" />" /></a>
 <a href="<perch:content id="_page" />"><perch:content id="pubname" type="text" /></a> in <perch:content id="location" /></li>


<perch:before><p>Click on a link to see Destinations in that category.</p>
<ul class=destinations-categories"></perch:before>
<li><a href="/category/<perch:category id="catSlug" />"><perch:category id="catTitle" type="text" /></a></li>

This is the only hurdle I have to get the project moving. Can someone help, Please. Thanks

Edward Johansen

Edward Johansen 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Where's the .JPG coming from?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't see a .JPG on that URL. Could you elaborate?

Drew McLellan said:

I don't see a .JPG on that URL. Could you elaborate?

Misunderstanding. The attached link ( the screengrab from the category page.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Edward,

In the template your link is /category/<perch:category id="catSlug" />, which gets you something like /category/beaches

Your URL pattern is category/[slug/slug:catPath] so it is looking for something like /category/some-slug/another-slug.

Try changing your URL pattern to category/[slug:cat].

Thanks, that is working. We realize we dream, we dream we know.

We ascend chuckling with the light,

We rests sobbing with the night.