Support Center

Knowledgebase
View categorized listing of all common frequently asked questions.
Video Tutorials
Create a Movie & TV Show review website.
Customize the jReviews themes.
Review user profiles with the Everywhere addon.
Forum
Community forum
Submit a Ticket
Use your client area email to access the ticket system.
Downloads
Guides, modules and more...
 
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 07, 2009, 03:38:37 PM
22774 Posts in 5217 Topics by 2974 Members
Latest Member: Vijitha
News: Do not post any jReviews files or large amounts of code in the forums please. Only template files and code are allowed.
 
jReviews Support Forum  |  jReviews 1.x  |  Templates  |  Icons on content page « previous next »
Pages: [1]
Author Topic: Icons on content page  (Read 4473 times)
Solari
Full Member
***
Offline Offline

Posts: 51


« on: August 16, 2006, 05:22:58 PM »

Greetings,

Not sure if this belongs in templates.... If so, please feel free to move this there.

We're going to have reviews of parks, etc, so we will have a set of visual icons to show what amneties a park has, i.e. restrooms, picnic tables, etc. You can see example icons here: (put http in front)

www.camis.com/camisimg/images/gui/wa/icolgd.gif

I'm wondering what the best way is to implement this.  I know I would set up a field using checkboxes in the field manager, but how would I have the content page show the icons for the fields that were selected?

Hope I make sense.

Thanks,
Ray
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8996


« Reply #1 on: August 16, 2006, 05:28:51 PM »

When you add the options to the checkbox field there's an optional image field. Just put the name of the image there, including the path starting from the /components/com_jreviews path. So for example if it is the picnic tables and the image is picnic.gif and you have the images in /components/com_jreviews/images/parks, then you would write this in the image field

images/parks/picnic.gif
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
Solari
Full Member
***
Offline Offline

Posts: 51


« Reply #2 on: August 16, 2006, 06:55:06 PM »

Man, I can't get over how powerful and flexible this baby is!

Thanks,
Ray
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8996


« Reply #3 on: August 16, 2006, 07:00:25 PM »

Thanks, as an example of what it looks like you can go to the haitiwebs website. He used this option for the payment and amenities fields. However, he made some minor modifications so that when you click on the amenities fieldgroup-name it displays a picture like the one on the link above with all the explanations.
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
Solari
Full Member
***
Offline Offline

Posts: 51


« Reply #4 on: August 16, 2006, 08:12:04 PM »

Hmm, I wonder how he did that.  Hopefully he'll see this and let us know.

Ray
Logged
smoe
Newbie
*
Offline Offline

Posts: 14


« Reply #5 on: August 22, 2006, 09:31:45 AM »

I have been trying to figure out the same thing as Solari mentioned.
What does it entail to call an image (or other elements) so they appear within the same page as the legend does on the haitiwebs site? I see that there is a call to onclick="new Effect.toggle('contribute','appear') , but I am not sure how to set this up within the newitemform.html file

Thanks
Steve
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8996


« Reply #6 on: August 22, 2006, 11:15:43 AM »

ok, I didn't help him with this so this instructions may not be perfect.

Like you mentioned Steve, there's indeed an onclick call, but he put it directly in the group title in the backend. So you can add something like this to the group title:

Quote
<a href="javascript:void(0);" onclick="new Effect.toggle('divname','appear'); return false;">Group title</a>
Try with and without the return false above.

Now, there's nothing to do on the newitemform, but instead you need to hardcode the image to the com_content template. You can use the template manager to use a custom template for this particular category. Add this to the com_content.html template:

Quote
<div id="divname" style="display:none;"><img src="..your image path here.."></div>

Change "divname" in both codes to an id that is more representative of your image like "parks".

If you find there was something missing, let me know Wink
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
smoe
Newbie
*
Offline Offline

Posts: 14


« Reply #7 on: August 22, 2006, 01:06:53 PM »

That did it!
Thanks for the great (and quick) support!
Logged
Fiona
Jr. Member
**
Offline Offline

Posts: 26


« Reply #8 on: December 19, 2006, 07:41:10 PM »

Hello,
I am also trying to add this feature to my site and did the following as suggested:

ok, I didn't help him with this so this instructions may not be perfect.

Like you mentioned Steve, there's indeed an onclick call, but he put it directly in the group title in the backend. So you can add something like this to the group title:

Quote
<a href="javascript:void(0);" onclick="new Effect.toggle('divname','appear'); return false;">Group title</a>
Try with and without the return false above.

Now, there's nothing to do on the newitemform, but instead you need to hardcode the image to the com_content template. You can use the template manager to use a custom template for this particular category. Add this to the com_content.html template:

Quote
<div id="divname" style="display:none;"><img src="..your image path here.."></div>

Change "divname" in both codes to an id that is more representative of your image like "parks".

If you find there was something missing, let me know Wink

My problem is that my image just doesn't show up and as far as I can tell it is not an address issue. I have tried simply inserting an image link on com_content.html as a test and the image box appears for a second and dissapears again even when I take out the toggle/hide code.

Any ideas?
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8996


« Reply #9 on: December 19, 2006, 09:26:05 PM »

Try adding both code lines to com_content.html, later when you get it to work you can move the first one to the group title.

First add this to com_content.html:

<div id="divname" style="display:block;"><img src="..your image path here.."></div>


If the image shows correctly, then change it to this:

<div id="divname" style="display:none;"><img src="..your image path here.."></div>


and add this to com_content.html which is the link to show/hide it:
<a href="javascript:void(0);" onclick="new Effect.toggle('divname','appear'); return false;">Group title</a>


If that works, then move the above line to the group title.
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
Fiona
Jr. Member
**
Offline Offline

Posts: 26


« Reply #10 on: December 20, 2006, 02:16:31 PM »

Hello, thanks for the reply - unfortunately this hasn't worked either

My code looks like this in com_content.html

<div id="legend" style="display:block;"><img src="./images/legend.gif" alt="legend" width="300" height="209"></div>

<a href="javascript:void(0);" onclick="new Effect.toggle('legend','appear'); return false;">Legend</a>

My image file is sitting on the server in components/com_jreviews/templ/default/images so as far as i know this is the right address to work with the com_content.html file.

I am still getting a ghost image box appearing momentarily so something is trying to happen and my alt text shows instead.

It is an image problem - the toggle code works fine as my alt text appears and dissapears when I toggle - I did try it with just the image link first as you suggested but no image.

any further ideas would be much appreciated when you have time

cheers
« Last Edit: December 20, 2006, 02:21:43 PM by Fiona » Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8996


« Reply #11 on: December 20, 2006, 09:19:09 PM »

Hi, the problem seems to be the image path, if you are using a version before 1.2RC2 try this:

<div id="legend" style="display:block;"><img src="{LIVE_SITE}/components/com_jreviews/tmpl/default/images/legend.gif" alt="legend" width="300" height="209"></div>

If you are using 1.2RC2:

<div id="legend" style="display:block;"><img src="{TEMPLATE}/images/legend.gif" alt="legend" width="300" height="209"></div>

It's very easy to see where the browser is trying to get the image from by right clicking on the alt text and then on properties or view image so you know what path it is actually using.
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
Fiona
Jr. Member
**
Offline Offline

Posts: 26


« Reply #12 on: December 21, 2006, 08:26:44 AM »

Thank you so much - it worked using the first suggestion. Grin
Logged
Larry Farquhar
Newbie
*
Offline Offline

Posts: 9


« Reply #13 on: December 17, 2007, 11:35:30 PM »

This may be an old thread, but I'm trying to accomplish the same thing. I got my legend graphic to appear, but not in the correct location. I've changed my group title to include the javascript line. The "Legend" option appears fine next to the group title. Clicking on this "Legend" link works, but the legend graphic appears in the wrong place.

How do I get the Legend graphic to appear under the Group Title I'm using? Currently, the legend graphic either appears at the top of the page, or directly above the information and photos. This depends on where I place the <div id=....> line in com_content.html.

Logged
Alejandro
Global Moderator
Administrator
Hero Member
*****
Offline Offline

Posts: 8996


« Reply #14 on: December 18, 2007, 05:49:08 PM »

You will need to hide the default display of the filed and put the whole code in your com_content.html template.

That means something like this:

Code:
<a href="javascript:void(0);" onclick="new Effect.toggle('divname','appear'); return false;">Group title</a>
<div id="divname">Code for custom field</div>

You need to read the Knowledge base to find the article that explains how to put custom fields in templates. Since it's a multiple select or checkbox field you can't just put the {JR_FIELD} tag, it's a bit more complicated.
Logged

Please take the time to vote and to write a review: http://extensions.joomla.org
Reviews Ahoy! - Submit your jReviews site here.
Pages: [1]
« previous next »
    Jump to: