Difference between revisions of "JReviews:Tips & Tricks"

From JReviews Documentation
Jump to: navigation, search
Line 16: Line 16:
 
}
 
}
 
</source>
 
</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 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? ===
 
=== How to make part of theme visible only to administrators? ===
 
<source lang="php">
 
<source lang="php">
Line 25: Line 65:
 
<?php endif;?>
 
<?php endif;?>
 
</source>
 
</source>
 +
  
 
=== How to change the rating star images? ===
 
=== 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.
  
== Troubleshooting ==
+
 
*[[Modules missing from content pages]]
+
=== 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.
 +
 
 +
 
 +
== 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:
 +
<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 23:00, 28 October 2009

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 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.


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; ?>