• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Add a link to trophies you've been awarded on your Account view navigation bar

Paul B

XenForo moderator
Staff member
A very simple edit this one.

Open the navigation_visitor_tab template and find this:
HTML:
<li><a href="{xen:link account/likes}">{xen:phrase likes_youve_received}</a></li>

Below it add this:
HTML:
<li><a href="{xen:link members/trophies, $visitor}">{xen:phrase trophies}</a></li>

The result is a new link in the navigation bar like so:
trophies1.webp

Which when clicked loads your trophies page:
trophies2.webp


I do plan to add the Trophies tab as I suggested in this thread but until I do, this will suffice as a stop gap.
 
Is there any way to replace either the number or the text with an image? So that each trophy awarded would be a different image?
 
Not using this template modification as it uses the default trophy page view.

When I get around to doing the Trophy tab then that might be an option.
 
Hi Brogan,
Great mod although it didnt work for me at all? No errors... but no trophie link either. I am using beta 4, could this be the issue? Thanks.
 
It's a basic template mod' so works the same in Beta 3 and 4.

The link only appears on your account page: http://localhost/community/account/personal-details

Is it not showing there?

Hi Brogan,
I tried again thinking I might of stuffed it up.. but i followed all the steps.
Here is a screenshot of what I added. I notice your quoted codes above are a little different? So as you can see by the screenshot below I searched for "watched/threads" to find the code your referring to, this is where I may have gone wrong?
1.webp
Heres the other screenshot of my account.
2.webp
 
Yes, you've edited the template in the wrong place.

You need to look for the commented out entry as I posted in my the first post:
<!--<li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li>--> </ul>

For reference, it's this section:
nav_vis_tabs.webp
 
Yes, you've edited the template in the wrong place.

You need to look for the commented out entry as I posted in my the first post:
<!--<li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li>--> </ul>

For reference, it's this section:
View attachment 7039

Hi Brogan,

I just realised I never wrote back to you. Sorry about that, wasnt being rude, just probably thought I did but didnt... i have a fantastic memory you see. I did try this again and got it to work perfectly, great little addition, thank you.
 
I wonder if, in the future, we'll be able to have a different trophy, or different colored trophy, for each achievement?
 
There aren't even trophy images.

The ones in the screenshot above is something I added myself.
 
Might be an idea for xF 1.1

You could have themed "trophies".

For a racing car site:
Trophy (1) = Welcome Trophy - Now you've got a race car !
Trophy (2) = First Message Trophy - You've completed your first lap of the track !
Trophy (5) = Double figures Trophy - You are becoming a serious racecar driver.
Trophy (6) = Like Trophy - Someone likes your car !
Trophy (7) = Keeps coming Back Trophy - you've completed your first race ! Congrats !

Trophies would be associated with a hidden trophy specific page and images. (end user customizable).
At the bottom of the themed trophy-specific page.

It might mention the users new abilities.

You've replied to 10 posts, you can now make your own posts !
You've posted 200 times, you can now post every 10 seconds, not 30 !
You've contributed finances to our site, you can now read and post in the VIP forum. Thank you !
 
Might be an idea for xF 1.1

You could have themed "trophies".

For a racing car site:
Trophy (1) = Welcome Trophy - Now you've got a race car !
Trophy (2) = First Message Trophy - You've completed your first lap of the track !
Trophy (5) = Double figures Trophy - You are becoming a serious racecar driver.
Trophy (2) = Like Trophy - Someone likes your car !
Trophy (7) = Keeps coming Back Trophy - you've completed your first race ! Congrats !

Trophies would be associated with a hidden trophy specific page and images. (end user customizable).
At the bottom of the themed trophy-specific page, it might mention the users new abilities.

That would be great for a site like brogans. I am developing an MMA site. I could use belts. white belts, yellow belts etc etc
 
View attachment 7061
7061

How about releasing an addon that allows the admin to choose a trophy image :) ?
 
How about releasing an addon that allows the admin to choose a trophy image :) ?
Well eventually I plan to do a trophy tab so I could include it as part of that.
In the meantime, this is how to get a trophy image to display.

Add this to EXTRA.css:
Code:
/* Trophy icon */
.trophy_icon {
display: block;
width: 24px;
height: 30px;
float: left;
background: url('@imagePath/images/trophy.png');
}

Open the trophy template and after this:
Code:
<div class="trophy" id="trophy-{$trophy.trophy_id}">

Add this:
Code:
<div class="trophy_icon"></div>

The trophy icon I am currently using is attached.
You will need to upload it to the relevant directory - I created a /images directory in the style I am using and placed it there.
 

Attachments

  • trophy.webp
    trophy.webp
    724 bytes · Views: 15
Top Bottom