Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
242 views
in Q2A Core by
edited by
So far, we have these values for $template variable: 'activity', 'categories', 'custom', 'feedback', 'qa', 'question', 'questions', 'hot', 'search', 'tag',  'tags', 'unanswered'

I'm so mad that I would like to display something only on category pages, but there is NO unique value for category.

Again, the closest thing is "qa". But "qa" is also the homepage !!!!!!!!!!!!!!

I don't want to display on homepage. I just want on category page!!

1 Answer

0 votes
by

The category path (example: site.com/category-name) is just a pseudo path. It lists only a handful of latest questions. All the rest of category questions will be listed like this: site.com/questions/category-name

Very messy.

Now the only way to display something in a category page is to code in this lionel messi way.

$parts=explode('/', $request);
        $category = null;
        $category=$parts[count($parts) - 1];
        if($category == null || count($parts) == 1 && $template != 'qa' )
            return;

...........

...