Difference between revisions of "How to output user fields from Community Builder in JReviews themes"
From JReviews Documentation
Line 6: | Line 6: | ||
<?php echo $listing['Community']['cb_fieldname'];?> | <?php echo $listing['Community']['cb_fieldname'];?> | ||
</source> | </source> | ||
+ | |||
This code can be used in the: | This code can be used in the: | ||
Line 22: | Line 23: | ||
<?php echo $review['Community']['cb_fieldname'];?> | <?php echo $review['Community']['cb_fieldname'];?> | ||
</source> | </source> | ||
+ | |||
This code can be used in the theme file of user and editor reviews: | This code can be used in the theme file of user and editor reviews: |
Revision as of 13:02, 2 November 2011
JReviews stores all Community Builder data in $listing['Community'] array for listings and $review['Community'] array for reviews.
To output a certain CB field value in listings, use this code:
<?php echo $listing['Community']['cb_fieldname'];?>
This code can be used in the:
- theme file of the listing detail page:
- /com_jreviews/jreviews/views/themes/{theme_name}/listings/detail.thtml
- theme file of the listings module:
- /com_jreviews/jreviews/views/themes/{theme_name}/modules/listings.thtml
- theme files of the category/search list pages:
- /com_jreviews/jreviews/views/themes/{theme_name}/listings/listings_blogview.thtml
- /com_jreviews/jreviews/views/themes/{theme_name}/listings/listings_tableview.thtml
- /com_jreviews/jreviews/views/themes/{theme_name}/listings/listings_thumbview.thtml
To output a certain CB field value in reviews, use this code:
<?php echo $review['Community']['cb_fieldname'];?>
This code can be used in the theme file of user and editor reviews:
- /com_jreviews/jreviews/views/themes/{theme_name}/reviews/review_layout.thtml
Replace cb_fieldname with the name of the CB field you want to output. The names of the fields can be checked in CB Field Manager: