JReviews:Tips & Tricks

From JReviews Documentation
Revision as of 15:07, 4 November 2009 by Alejandro (Talk | contribs) (How to load specific module positions within the JReviews theme files?)

Jump to: navigation, search

General

How do I display the list of users with the most reviews?

To get a Top 10 users page, create a menu item for this link:

http://www.example.com/index.php?option=com_jreviews&url=reviewers


Submit Form

How do I fix the wysiwyg editor's background problem?

Add this to your joomla template's css file:

* TinyMCE specific rules */
body.mceContentBody {
   background: #FFF !important;
   background-image: none;
}


How do I sort values of custom fields alphabetically when submitting/editing an entry?

Edit the custom field, click on advanced options and change the ordering to A-Z


How to submit a listing without having to review it at the same time?

Go to JReviews Configuration, tab Standard Fields, Listing Form: 'Review form shown to' -> Don't show.


How to add a tooltip for a standard form field like Title, Name, E-mail?

Edit the theme file of the submit form:

  • \com_jreviews\jreviews\views\themes\{theme_name}\listings\create_form.thtml

Use this code to include a tooltip:

<span class="jr_infoTip" title="This is the tooltip text"></span>

Add the code inside the <label> tag of any form field


How to change the frontend Submission instructions?

Edit this theme file:

  • \com_jreviews\jreviews\views\themes\{theme_name}\listings\create.thtml

Search for "Submission instructions"


Themes

How can I add tabs to listing detail page?

You can use one of the Joomla Tabs content plugins, or you can use built-in jQuery UI tabs (better solution). Adding jQuery UI tabs is explained here:


How do I hide Summary text on listing detail page?

Edit \com_jreviews\jreviews\views\themes\d{theme_name}\listings\detail.thtml and replace

<?php echo nl2br($listing['Listing']['text']);?>

With:

<?php echo nl2br($listing['Listing']['description']);?>


How to make part of theme visible only to administrators?

<?php if($this->Access->isAdmin():?>
   // Everything here will be available only to admins
<?php endif;?>


How to change the rating star images?

Star images are located in \com_jreviews\jreviews\views\themes\{theme_name}\theme_css\images folder. Edit those images or create your own, but make sure new images have the same dimensions, otherwise you'll have to modify css styles also.


How do I change the order of user reviews so that oldest reviews are on top?

Edit \com_jreviews\jreviews\models\reviews.php

default:
	$order = '`Review.created` DESC';
	break;

change to:

default:
	$order = '`Review.created` ASC';
	break;


How do I modify and add additional submission instructions?

Submission instructions are located in \com_jreviews\jreviews\views\themes\default\listings\create.thtml theme file.

How to load specific module positions within the JReviews theme files?

You can use the code below in any JReviews theme file to load modules assigned to the specified position (i.e. user1 in this case).

<?php 
$position = 'user1';
$params		= array('style'=>'');
$document	= &JFactory::getDocument();
$renderer	= $document->loadRenderer('module');
$contents = '';
foreach (JModuleHelper::getModules($position) as $mod)  {	
	$contents .= $renderer->render($mod, $params);
}
echo $contents;
?>

How to change the number of results per page for the thumbview layout?

If you want to show 12 listings per page instead of the default 10 you need to change the page options in the dropdown lists in both admin and frontend.

For the configuration settings, List Page tab, edit /components/com_jreviews/jreviews/views/admin/themes/default/configuration/index.thtml

<td width="250">Number of listings per page?</td>
<td>
   <?php
   echo $Form->selectNumbers('list_limit',4,48,4,$this->Config->list_limit,array('class'=>'inputbox','size'=>'1'));				
   ?>
</td>

For the frontend pagination list, edit /components/com_jreviews/jreviews/views/themes/default/listings/listings_thumbview.thtml

<?php echo $Paginator->display_items_per_page('page',array(4,8,12));?>

If your page is a menu link, make sure to adjust the number of items shown there which could be set to 10 by default.

Modules

How do I prevent modules from disappearing on the search results page?

There is a setting in JReviews Configuration, tab Search:

"Use current page Itemid for search results".

Set this to yes and the search results page should inherit the modules from previous page.


Joomla

How to remove Joomla edit button from listing detail page?

You need to edit Joomla's com_content template file:

  • \components\com_content\views\article\tmpl\default.php

And delete this:

<?php if ($canEdit) : ?>
<td align="right" width="100%" class="buttonheading">
	<?php echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>
</td>
<?php endif; ?>