Skip to main content

To show sub-category on second page.

Classifieds Script ClassiBase Forums Presale questions To show sub-category on second page.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #2242 Reply
    Maroof Kazi

    How to show sub-catgeory on second page after main category?then after show list of adds on next page.?

    For eg.
    on first page showing main category
    onclicking on it showing sub-categories, parts,3.Motor,,etc.

    Now on clicking cars it will show list of adds related to cars with image.

    Please suggest solution for doing category division in these way.

    #2252 Reply

    I understand you want to display all your categories with icons for each category. You can use same example which we explained here , but instead of foreach($categories[0] as $cat) you have to use foreach($categories[intval( self::$_vars['selected_category']->id)] as $cat)

    And place this widget not in pages but in sidebar “Before content” (it should be in most themes).

    Ads will be listed in any way. You can hide them with javascript if you want.

    #2258 Reply
    Maroof kazi

    No your are not getting my point actually i want to create two stage categories & then showing adds.
    I want to create pattern like website follows for showing categories.
    Please reply me fast as my project is getting delayed.

    #2261 Reply

    Ok. To do 2 level (or multilevel) category listing you have to change couple things.

    1) Add categories with images for current level, which we explained above. Also you can use built in feature if you are happy with displaying categories without icons (

    2) Then you have to edit files in your theme. Make sure you compy your theme to new folder with different name. (detailed instructions can be found here

    3) Then edit file in your theme /user-content/themes/YOUR_THEME/views/index/category.php.

    Replace if($ads) with following code

    if(Category::hasChildren($selected_category, Category::STATUS_ENABLED))
    		// do nothing 
    			echo '<p><a href="?list_all=1">' . View::escape(__('View all ads in {name} &rarr;', array('{name}' => Category::getName($selected_category)))) . '</a></p>';
    			echo new View('index/_listing', $this->vars);
    			echo $paginator;

    We tried it on our test server it works. Let us know how it goes on your site.


Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: To show sub-category on second page.
Your information:

  • Classifieds Business Newsletter

    Get discounts and tips about growing your classifieds website.