Add a link to usercp.tmpl [message #39391] |
Fri, 19 October 2007 16:10 |
warc
Messages: 7 Registered: July 2007
Karma: 0
|
Junior Member |
|
|
Can someone please explain
{SECTION: usercp_lnk3}
{ROOT}?t=index&{DEF: _rsid}
{SECTION: END}
{SECTION: warc_home}<a class="UserControlPanel nw" href="http://www.warc.org.uk/">WARC HOME</a>
{SECTION: END}
{SECTION: u_forum_search}<a class="UserControlPanel nw" href="http://www.warc.org.uk/">WARC HOME</a> ~ <a class="UserControlPanel nw" href="{TEMPLATE: usercp_lnk}"><img src="{THEME_IMAGE_ROOT}/top_search{DEF: img_ext}" alt="{MSG: search}" /> {MSG: search}</a>
{SECTION: END}
{SECTION: warc_home_2}<a class="UserControlPanel nw" href="{TEMPLATE: usercp_lnk}">XZXX<img src="{THEME_IMAGE_ROOT}/top_search{DEF: img_ext}" alt="{MSG: search}" /> {MSG: search}</a>
{SECTION: END}
I have modified my usercp.tmpl file and I would like to know how this section works.
If I add a link to u_forum_search it is OK but I would like to add a new section so I made "warc_home"
but "warc_home" and "warc_home_2" never display, how can I add a new section which will display, also what is "usercp_lk3", this does not display either?
It opens in the Comntrol Panel OK and compiles the template file when a change is made.
This is doubtless something basic in the way the templates work but I do not understand what I need to do.
|
|
|
Re: Add a link to usercp.tmpl [message #39398 is a reply to message #39391] |
Sun, 21 October 2007 15:51 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You've created the sections correction, but you have not referenced them, which is why they don't show up. The forum simply does not know where to put them.
You need to add {TEMPLATE: warc_home} where ever you want this text to appear.
FUDforum Core Developer
|
|
|
|
Re: Add a link to usercp.tmpl [message #39478 is a reply to message #39476] |
Fri, 26 October 2007 03:22 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
it has {SECTION} you can reference another section from an existing section using the TEMPLATE tag.
FUDforum Core Developer
|
|
|
|
|
|
|
Re: Add a link to usercp.tmpl [message #40237 is a reply to message #39391] |
Sun, 27 January 2008 12:40 |
Dustin Kowalski
Messages: 62 Registered: August 2006 Location: Leicester
Karma: 0
|
Member |
|
|
OK, one of the members on this site PM'd me to ask whether I had understood what was written here and whether I'd successfully implemented the changes.
I'm not a computer-minded person either, and lots of the comments, suggestions, and instructions fly over my head when they come from people who are professionals in the field, so I'll write a layman's version of how I successfully make changes when I manage to.
In this case, I wanted to add two items to the user control panel (the links that scroll across the top of the page for private messaging, members, and so on).
I wanted to add something saying "Jebsite" which would link to my homepage, and another reading "Vortaroj" (Esperanto for "dictionaries") which would take me to a separate page.
Here's the finished version:
To do this you need to:
1) Visit usercp.tmpl and select usercp.
The default looks like this:
<div class="UserControlPanel">{TEMPLATE-DATA: private_msg} {IF: ($FUD_OPT_1 & 8388608 || (_uid && $FUD_OPT_1 & 4194304) || $usr->users_opt & 1048576)}{TEMPLATE: member_search}{ENDIF} ...
2) Amend this to include the name of something that you wish to add. In my case, I was going to add two things. I'm going to call them "jebsite" and "dictionaries".
The first line of usercp.tmpl now looks like this:
<div class="UserControlPanel">{TEMPLATE: jebsite} {TEMPLATE: dictionaries} {TEMPLATE-DATA: private_msg} {IF: ($FUD_OPT_1 & 8388608 || ...
3) All the forum knows so far is to display the new things; you need to tell it what "jebsite" and "dictionaries" are.
To do this, go to "file manager", head to the relevant theme folder, and download the file usercp.tmpl.
Open this with WordPad, Notepad or whatever.
You'll notice that lots of familiar things are individually referenced between [SECTION] tags, such as "login". This is where the computer visits to get the details of the shorthand {TEMPLATE-DATA: private_msg} that was displayed when you displayed usercp.tmpl.
So now follow the lead and add the details for whatever you're adding. My jebsite link looks like:
{SECTION: jebsite}<a class="UserControlPanel nw" href="http://www.jeb.org.uk/" target="_blank"><img src="{THEME_IMAGE_ROOT}/jebsiteLogo.png" alt="Jebsite" /> Jebsite</a> {SECTION: END}
4) Save this and put it back where you got it from.
5) Visit your forum to verify that it's working.
6) Repeat this for your other themes.
That's how I did it. I hope that this may be of use to someone else who, like me, is not very experienced with computers.
-
Attachment: adpanel.jpg
(Size: 64.68KB, Downloaded 1313 times)
|
|
|
|
Re: Add a link to usercp.tmpl [message #40239 is a reply to message #40238] |
Sun, 27 January 2008 14:26 |
Dustin Kowalski
Messages: 62 Registered: August 2006 Location: Leicester
Karma: 0
|
Member |
|
|
I think the problem that I had there was that the space between the image and the text was underlined (so had the formatting effects) when I hovered over it. When you do that to the other (sub-templated) ones, this doesn't happen.
I didn't want it to look out of place, which it did when the added link wasn't behaving like the other links that were already there.
To get around this, I created the sub-templates to mimic the behaviour of those that I was trying to emulate, and it worked.
So yes, you can just add the link (which is how I had it before) but there is that slight negative drawback when you do take that approach.
|
|
|