Difference between revisions of "How does the JReviews Theme Engine work"

From JReviews Documentation
Jump to: navigation, search
Line 22: Line 22:
 
You can create your own theme the same way, but instead of creating it in <span style="color: blue">/components/com_jreviews/jreviews/views/themes/</span> folder, you should use the [[JReviews Code Overrides]] functionality to place your custom theme outside the '''/com_jreviews''' folder.
 
You can create your own theme the same way, but instead of creating it in <span style="color: blue">/components/com_jreviews/jreviews/views/themes/</span> folder, you should use the [[JReviews Code Overrides]] functionality to place your custom theme outside the '''/com_jreviews''' folder.
  
 
 
 
 
 
== Modifying theme files ==
 
 
Creating your own theme is not necessary if you only want to modify several files from the default theme.
 
 
Instead, use the [[JReviews Code Overrides]] feature to create a copy of theme files you want to modify outside the '''/com_jreviews''' folder, and those files will be used instead of the ones in /themes/default folder.
 
 
For example, if you want to make modifications to the detail page theme file:
 
*<span style="color: blue">/themes/default/listings/detail.thtml</span>
 
 
 
Create a copy of the file into this folder:
 
*<span style="color: blue">joomla_root/templates/jreviews_overrides/views/themes/default/listings/detail.thtml</span>
 
 
and then make the modifications.
 
 
 
Do the same for any other theme file.
 
 
After copying the files into /jreviews_overrides folder, you need to click on 'Clear File Registry' link in JReviews Administration.
 
  
  
 
[[Category:JReviews]]
 
[[Category:JReviews]]
 
[[Category:Themes]]
 
[[Category:Themes]]

Revision as of 10:05, 20 August 2010

JReviews uses a php templating system. This means you can mix html with php code, which provides a lot of flexibility to create conditionals and add snippets of php code.


JReviews Themes

JReviews themes are located in this folder:

  • /components/com_jreviews/jreviews/views/themes/
  • the theme files have the .thtml extension.

In that folder you'll find several themes:

  • /components/com_jreviews/jreviews/views/themes/default/
  • /components/com_jreviews/jreviews/views/themes/default_02/
  • /components/com_jreviews/jreviews/views/themes/default_dark/ - for using with dark joomla templates


You will notice that /default_02 and /default_dark theme folders contain less files than the /default theme folder.

The /default folder contains all the necessary theme, css and image files, while /default_02 and /default_dark are variations of the default theme and contain only "modified" files and images. Files that don't exist in those folders are used from the /default theme folder.

This is because the /default theme should always be intact to make JReviews upgrades easier.

You can create your own theme the same way, but instead of creating it in /components/com_jreviews/jreviews/views/themes/ folder, you should use the JReviews Code Overrides functionality to place your custom theme outside the /com_jreviews folder.