Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Theme selection for categories, custom theme for a specific category
Pages: [1]   Go Down
  Print  
Author Topic: Theme selection for categories, custom theme for a specific category  (Read 4705 times)
0 Members and 1 Guest are viewing this topic.
sgherzo
Newbie
*

Karma: 0
Offline Offline

Posts: 1


« on: September 21, 2010, 15:56:34 »

Hello all!
After i've created some theme for the wonderful JComment, but i need to associate categories with custom template.

I've found a way to have a custom template for a category, that is:

1 - Edited jcomment.class.php, at function getTemplate(), near this lines:

      if (empty($templateName)) {
         $templateName = 'default';
         $config->set('template', $templateName);         
      }

and added this before:

      $mycat = JRequest::getVar('catid');
      $mycat = substr($categ,0,strpos($categ,':'));
      
      if(intval($categ) == 72){
         $templateName = 'myCommTemplate';
         $config->set('template', $templateName);
      }

This work but the loaded CSS is the same of the configured theme at the back end!
So i've edited even the file:

2 - com_jcomments/helper/system.php, getCSS() function and add some simil to previous:

      $categ = JRequest::getVar('catid');
      $categ = substr($categ,0,strpos($categ,':'));
   
      if( intval($categ) == 72){         
         $template = 'myCommTemplate';
      }

Now i can see for catid 72 my custom template and i can mantain the default template selected in the backend.

I don't know if this could be the right and simplest way to achive the pourpouse, but work!

Some suggestion?
Thanks!

ps. sorry 4 my english errors! Smiley
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Theme selection for categories, custom theme for a specific category
 
Jump to: