Difference between revisions of "JReviews:Tips & Tricks"

From JReviews Documentation
Jump to: navigation, search
(How to load specific module positions within the JReviews theme files?)
Line 1: Line 1:
 
== General ==
 
== General ==
=== How do I display the list of users with the most reviews? ===
+
*[[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:
+
 
+
<pre>http://www.example.com/index.php?option=com_jreviews&url=reviewers</pre>
+
  
  
 
== Submit Form ==
 
== Submit Form ==
=== How do I fix the wysiwyg editor's background problem? ===
+
*[[How do I fix the wysiwyg editor's background problem?]]
Add this to your joomla template's css file:
+
*[[How do I sort values of custom fields alphabetically when submitting/editing an entry?]]
<source lang="css">
+
*[[How to submit a listing without having to review it at the same time?]]
* TinyMCE specific rules */
+
*[[How to add a tooltip for a standard form field like Title, Name, E-mail?]]
body.mceContentBody {
+
*[[How do I modify and add additional submission instructions?]]
  background: #FFF !important;
+
  background-image: none;
+
}
+
</source>
+
 
+
 
+
=== 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:
+
<source lang="php">
+
<span class="jr_infoTip" title="This is the tooltip text"></span>
+
</source>
+
 
+
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 ==
 
== Themes ==
=== How can I add tabs to listing detail page? ===
+
*[[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?]]
*[[Adding tabs to listing detail page]]
+
*[[How to make part of theme visible only to administrators?]]
 +
*[[How to change the rating star images?]]
 +
*[[How do I change the order of user reviews so that oldest reviews are on top?]]
 +
*[[How to load specific module positions within the JReviews theme files?]]
 +
*[[How to change the number of results per page for the thumbview layout?]]
  
 
=== How do I hide Summary text on listing detail page? ===
 
Edit \com_jreviews\jreviews\views\themes\d{theme_name}\listings\detail.thtml and replace
 
<source lang="php">
 
<?php echo nl2br($listing['Listing']['text']);?>
 
</source>
 
 
With:
 
<source lang="php">
 
<?php echo nl2br($listing['Listing']['description']);?>
 
</source>
 
 
 
=== How to make part of theme visible only to administrators? ===
 
<source lang="php">
 
<?php if($this->Access->isAdmin():?>
 
  // Everything here will be available only to admins
 
<?php endif;?>
 
</source>
 
 
 
=== 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
 
<source lang="php">
 
default:
 
$order = '`Review.created` DESC';
 
break;
 
</source>
 
 
change to:
 
 
<source lang="php">
 
default:
 
$order = '`Review.created` ASC';
 
break;
 
</source>
 
 
 
=== 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).
 
 
<source lang="php">
 
<?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;
 
?>
 
</source>
 
 
=== 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
 
 
<source lang="php">
 
<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>
 
</source>
 
 
For the frontend pagination list, edit /components/com_jreviews/jreviews/views/themes/default/listings/listings_thumbview.thtml
 
 
<source lang="php">
 
<?php echo $Paginator->display_items_per_page('page',array(4,8,12));?>
 
</source>
 
 
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 ==
 
== Modules ==
=== How do I prevent modules from disappearing on the search results page? ===
+
*[[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 ==
 
== Joomla ==
=== How to remove Joomla edit button from listing detail page? ===
+
*[[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:
+
<source lang="php">
+
<?php if ($canEdit) : ?>
+
<td align="right" width="100%" class="buttonheading">
+
<?php echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>
+
</td>
+
<?php endif; ?>
+
 
+
 
+
</source>
+

Revision as of 20:47, 4 November 2009

General


Submit Form


Themes


Modules


Joomla