Difference between revisions of "Variables you can use in theme files"

From JReviews Documentation
Jump to: navigation, search
(Created page with '== Listing Data == {| class="wikitable" cellpadding="0" cellspacing="0" |- | <source lang="php"><?php echo $listing['Listing']['listing_id'];?></source> || Listing ID |- | <sour…')
 
Line 66: Line 66:
  
 
To output certain custom field in detail.thtml read [[How to customize the layout of custom fields in Theme files]]
 
To output certain custom field in detail.thtml read [[How to customize the layout of custom fields in Theme files]]
 +
 +
 +
[[Category:JReviews]]
 +
[[Category:Themes]]
 +
[[Category:Listing Detail Page]]

Revision as of 11:54, 29 October 2009

Listing Data

<?php echo $listing['Listing']['listing_id'];?>
Listing ID
<?php echo $listing['Listing']['title'];?>
Listing Title
<?php echo $listing['Listing']['summary'];?>
Listing summary text
<?php echo $listing['Listing']['description'];?>
Listing description text
<?php echo $listing['Listing']['text'];?>
Summary + Description
<?php echo $listing['Listing']['hits'];?>
Number of visits
<?php echo $Time->nice($listing['Listing']['created']);?>
Created date
<?php echo $Time->nice($listing['Listing']['modified']);?>
Modified date
<?php echo $listing['Listing']['category_image'];?>
Category Image
<?php echo $listing['Listing']['section_id'];?>
Section ID
<?php echo $listing['Section']['title'];?>
Section Title
<?php echo $listing['Listing']['cat_id'];?>
Category ID
<?php echo $listing['Category']['title'];?>
Category Title
<?php echo $listing['Directory']['title'];?>
Directory Title
<?php echo $listing['User']['user_id'];?>
Listing author's ID
<?php echo $listing['User']['name'];?>
Listing author's real name
<?php echo $listing['User']['username'];?>
Listing author's username
<?php echo $listing['Review']['user_rating'];?>
User rating
<?php echo $listing['Review']['user_rating_count'];?>
Number of user ratings
<?php echo $listing['Review']['user_rating_exists'];?>
Returns true if user rating exists
<?php echo $listing['Review']['review_count'];?>
Number of user reviews
<?php echo $listing['Review']['review_count_exists'];?>
Returns true if user review exists
<?php echo $listing['Favorite']['favored'];?>
Number of users who added listing to their favorite list


Conditionals

You can use any of the above data to create conditionals, for example:

<?php if($listing['Review']['review_count_exists']): // if user review exists ?>
  // display something
<?php else: ?>
  // display something else
<?php endif;?>


Custom Fields

To output certain custom field in detail.thtml read How to customize the layout of custom fields in Theme files