Difference between revisions of "Custom module positions in JReviews theme files"

From JReviews Documentation
Jump to: navigation, search
(Created page with "== Adding custom module positions == in JReviews 2.4 it is possible to add custom module positions to any theme file. The code to load a specific module position is: <source l...")
 
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Adding custom module positions ==
+
<div class="successbox" style="width: 95%">
  
in JReviews 2.4 it is possible to add custom module positions to any theme file.
+
[https://www.jreviews.com/docs/theme-resources/custom-template-positions There's a new version of this article]
 +
 
 +
</div>
 +
 
 +
 
 +
== Adding custom module positions ==
  
The code to load a specific module position is:
+
You can create a custom module position in a JReviews theme file using this code:
  
 
<source lang="php">
 
<source lang="php">
 
<?php $Jreviews->loadModulePosition('user1'); ?>
 
<?php $Jreviews->loadModulePosition('user1'); ?>
 
</source>
 
</source>
 
  
 
Replace <span style="color: blue">user1</span> with the actual position name that you want.
 
Replace <span style="color: blue">user1</span> with the actual position name that you want.
 
  
 
== Assigning modules to default module positions in JReviews themes. ==
 
== Assigning modules to default module positions in JReviews themes. ==
  
JReviews 2.4 has some default module positions (useful for assigning modules with ads between listings and reviews):
+
JReviews has some default module positions (useful for assigning modules with ads between listings and reviews):
 +
 
 +
'''All list pages:'''
 +
*jr-listpage-below-pagetitle
 +
*jr-listpage-below-map
 +
 
  
 
'''Blogview list page:'''
 
'''Blogview list page:'''
Line 21: Line 29:
 
*jr-blogview-below-listing2
 
*jr-blogview-below-listing2
 
*jr-blogview-below-listing3
 
*jr-blogview-below-listing3
 
+
*jr-blogview-below-listing4
 
+
*jr-blogview-last
'''Tableview list page:'''
+
*jr-tableview-below-listing1
+
*jr-tableview-below-listing2
+
*jr-tableview-below-listing3
+
  
  
Line 32: Line 36:
 
*jr-detail-below-fields
 
*jr-detail-below-fields
 
*jr-detail-below-socialbookmarks
 
*jr-detail-below-socialbookmarks
 +
*jr-detail-below-bottom-media
 +
*jr-detail-above-reviews ← also below map
 +
*jr-detail-above-map ← only shows if map is present on page
 +
*jr-detail-below-map ← only shows if map if present on page
 
*jr-detail-below-editorreviews
 
*jr-detail-below-editorreviews
 
*jr-detail-below-review1
 
*jr-detail-below-review1
Line 38: Line 46:
  
  
=== Example ===
+
'''Listing Card Layouts'''
To display a module below first listing on blogview page, edit the module in Module Manager and paste '''jr-blogview-below-listing1''' to the Position input:
+
*jr-listings-card-position-1
 +
*jr-listings-card-position-2
 +
*jr-listings-card-position-3
 +
*jr-listings-card-position-4
 +
*jr-listings-card-position-last
  
  
 +
''' All pages with a list of reviews '''
 +
*jr-reviewspage-above-reviews
 +
 +
=== Example ===
 +
To display a module below first listing on blogview page, edit the module in Module Manager and paste '''jr-blogview-below-listing1''' to the Position input. Then press "Enter" to add it.
  
 
[[File:CustomModulePosition1.png]]
 
[[File:CustomModulePosition1.png]]
Line 47: Line 64:
  
 
The module will be displayed like this:
 
The module will be displayed like this:
 
  
 
[[File:CustomModulePosition2.png]]
 
[[File:CustomModulePosition2.png]]

Latest revision as of 23:57, 8 July 2020


Adding custom module positions

You can create a custom module position in a JReviews theme file using this code:

<?php $Jreviews->loadModulePosition('user1'); ?>

Replace user1 with the actual position name that you want.

Assigning modules to default module positions in JReviews themes.

JReviews has some default module positions (useful for assigning modules with ads between listings and reviews):

All list pages:

  • jr-listpage-below-pagetitle
  • jr-listpage-below-map


Blogview list page:

  • jr-blogview-below-listing1
  • jr-blogview-below-listing2
  • jr-blogview-below-listing3
  • jr-blogview-below-listing4
  • jr-blogview-last


Listing detail page:

  • jr-detail-below-fields
  • jr-detail-below-socialbookmarks
  • jr-detail-below-bottom-media
  • jr-detail-above-reviews ← also below map
  • jr-detail-above-map ← only shows if map is present on page
  • jr-detail-below-map ← only shows if map if present on page
  • jr-detail-below-editorreviews
  • jr-detail-below-review1
  • jr-detail-below-review2
  • jr-detail-below-review3


Listing Card Layouts

  • jr-listings-card-position-1
  • jr-listings-card-position-2
  • jr-listings-card-position-3
  • jr-listings-card-position-4
  • jr-listings-card-position-last


All pages with a list of reviews

  • jr-reviewspage-above-reviews

Example

To display a module below first listing on blogview page, edit the module in Module Manager and paste jr-blogview-below-listing1 to the Position input. Then press "Enter" to add it.

CustomModulePosition1.png


The module will be displayed like this:

CustomModulePosition2.png