Support Forums

Any want to choose viewlisting template for different categories?

This is a discussion on Any want to choose viewlisting template for different categories? within the Technical Support forums, part of the Technical Support Forums category; What version of 68 Classifieds are you running? v4.2.0 Developer What template are you using? Default Please describe in detail ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

Reply
 
Thread Tools Display Modes
Old 10-31-2010, 09:18 PM   #1
Customer
 
Join Date: Sep 2006
Posts: 68
Rep Power: 19
rockabilly is on a distinguished road
Default Any way to choose viewlisting template for different categories?

What version of 68 Classifieds are you running?
v4.2.0 Developer

What template are you using?
Default

Please describe in detail the issue you are having:

Is there any way to specify which version of the viewlisting template is used by category?

For example, if I have two categories, cars, and motorcycles, can I select cars to call up the viewlisting2.tpl, while having motorcycles call up and use the viewlisting.tpl?

Thanks in advance...

Last edited by rockabilly; 11-01-2010 at 02:16 AM.
rockabilly is offline   Reply With Quote
Old 11-01-2010, 04:38 PM   #2
Staff
 
Join Date: Mar 2006
Posts: 485
Rep Power: 29
Blair will become famous soon enough
Default

The viewlisting.php file is where either the viewlisting.tpl file or viewlisting2.tpl file is assigned for display. There's already an 'if-else' clause near the bottom of the file. You could try modifying it to something like:

Code:
if($lDisplay==1 && $rs['section']=="22")
   {
      $class_tpl->assign('body','viewlisting.tpl');
   }
   else
   {
      $class_tpl->assign('body','viewlisting2.tpl');
   }
where "22" is the category id.
__________________
Blair
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
Blair is offline   Reply With Quote
Old 11-01-2010, 11:14 PM   #3
Customer
 
Join Date: Sep 2006
Posts: 68
Rep Power: 19
rockabilly is on a distinguished road
Default

Hello Blair,
Thanks for the help. I did modify it as you indicated below, setting the category ID. When I tried it just as shown below, it changes the template for all categories. I wasn't able to set just that one specific category.
Am I doing something wrong?

Thank you...

Quote:
Originally Posted by Blair
The viewlisting.php file is where either the viewlisting.tpl file or viewlisting2.tpl file is assigned for display. There's already an 'if-else' clause near the bottom of the file. You could try modifying it to something like:

Code:
if($lDisplay==1 && $rs['section']=="22")
   {
      $class_tpl->assign('body','viewlisting.tpl');
   }
   else
   {
      $class_tpl->assign('body','viewlisting2.tpl');
   }
where "22" is the category id.
rockabilly is offline   Reply With Quote
Old 11-01-2010, 11:27 PM   #4
Staff
 
Join Date: Mar 2006
Posts: 485
Rep Power: 29
Blair will become famous soon enough
Default

If it's changing it for all categories, the "&& $rs['section']" portion is causing the 'if' statement to be false.

Did you change the category id?
Did you try it without double quoutes?

This is a custom change and to be honest, isn't supported. But the information supplied should be giving you the nudge you need to play around until a solution appears.
__________________
Blair
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
Blair is offline   Reply With Quote
Old 11-04-2010, 06:24 PM   #5
Customer
 
Join Date: Sep 2006
Posts: 68
Rep Power: 19
rockabilly is on a distinguished road
Default

Thank you Blaire for the tips. I got it figured out :-)
rockabilly is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set nofollow tag on the link field of viewlisting template ronin Customizations 7 11-20-2009 01:24 PM
Template variables and sub categories castus Technical Support 2 10-01-2007 12:04 PM


All times are GMT -4. The time now is 10:46 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0