Difference between revisions of "Using Custom Params, Custom Where and Custom Order settings"

From JReviews Documentation
Jump to: navigation, search
Line 25: Line 25:
 
When checking the value of a multiple select or checkboxes custom field, use LIKE with option value inside percentages:
 
When checking the value of a multiple select or checkboxes custom field, use LIKE with option value inside percentages:
 
<pre>Field.jr_genre LIKE '%comedy%'</pre>
 
<pre>Field.jr_genre LIKE '%comedy%'</pre>
 
 
We can also check if the field is not empty:
 
<pre>Field.jr_model != ''</pre>
 
  
  
 
To check if a decimal or integer field is higher than certain number, we can use this:
 
To check if a decimal or integer field is higher than certain number, we can use this:
 
<pre>Field.jr_price > 999</pre>
 
<pre>Field.jr_price > 999</pre>
 +
 +
 +
We can also check if the field is not empty:
 +
<pre>Field.jr_brand != ''</pre>
  
  

Revision as of 14:49, 21 November 2011

Custom WHERE and Custom ORDER BY parameters are available in the Listings Module and in the Custom List JReviews menu item.

You can use them to filter listings based on certain values and order listings based on certain fields.

For example, to get all listings that have Cannon value for jr_brand custom field, we can use this in Custom WHERE parameter:

Field.jr_brand LIKE '%canon%'


If we want to order those listings by highest price, we can enter this in the Custom ORDER BY parameter:

Field.jr_price DESC


Field.jr_brand and Field.jr_price are examples of the columns in the database that can be used for Custom WHERE and Custom ORDER BY. For every listing custom field you created in the Fields Manager you can use Field.jr_fieldname format.


When checking the value of a text custom field, use this:

Field.jr_model = 'xyz'


When checking the value of a single select or radiobuttons custom field, use this (option value inside asterisks):

Field.jr_city = '*new-york*'


When checking the value of a multiple select or checkboxes custom field, use LIKE with option value inside percentages:

Field.jr_genre LIKE '%comedy%'


To check if a decimal or integer field is higher than certain number, we can use this:

Field.jr_price > 999


We can also check if the field is not empty:

Field.jr_brand != ''



Other available columns are:

Listing.title
Listing title
Listing.created
Listing submission date
Listing.modified
Listing update date
Listing.created_by
User ID
Listing.hits
Number of views
Frontpage.content_id
Joomla frontpaged listing (value > 0)
Field.featured
JReviews featured listing
Totals.user_rating
Average user rating
Totals.user_rating_count
Number of user ratings
Totals.editor_rating
Average editor rating
Totals.editor_rating_count
Number of editor ratings