Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 custom header link only visible on threadlist
Marc Offline
Junior Member
**
Posts: 3
Joined: Mar 2011
Post: #1
custom header link only visible on threadlist
Using the conditionals plugin, I would like to display a custom link in the header template which should only be visible on the threadlist, and possibly the thread page. Is there a variable I can use to check which page you are on?

Also - this is a seperate issue - when you are reading a thread, is there a variable available that holds the name or ID of the board the thread is in?
(This post was last modified: 03-05-2011 03:23 AM by Marc.)
03-05-2011 03:18 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: custom header link only visible on threadlist
(03-05-2011 03:18 AM)Marc Wrote:  Using the conditionals plugin, I would like to display a custom link in the header template which should only be visible on the threadlist, and possibly the thread page. Is there a variable I can use to check which page you are on?
Do you want to displaying the same link in the forumdisplay and the showthread?
Basically, you can try using THIS_SCRIPT

(03-05-2011 03:18 AM)Marc Wrote:  Also - this is a seperate issue - when you are reading a thread, is there a variable available that holds the name or ID of the board the thread is in?
I think it depends on where you want to use the variable (already defined or not)
If you want to use it in showthread template, try to use $thread['fid']

03-05-2011 04:44 AM
Find all posts by this user Quote this message in a reply
Marc Offline
Junior Member
**
Posts: 3
Joined: Mar 2011
Post: #3
RE: custom header link only visible on threadlist
(03-05-2011 04:44 AM)RateU Wrote:  Do you want to displaying the same link in the forumdisplay and the showthread?
Basically, you can try using THIS_SCRIPT

Yes it is the same link on those pages. What script are you referring to?

(03-05-2011 04:44 AM)RateU Wrote:  I think it depends on where you want to use the variable (already defined or not)
If you want to use it in showthread template, try to use $thread['fid']

Actually I want to use it in the header, so the variable you mention is not defined at that stage, I guess.
03-05-2011 05:23 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: custom header link only visible on threadlist
(03-05-2011 05:23 AM)Marc Wrote:  Yes it is the same link on those pages. What script are you referring to?

Something like this:

Code:
<if THIS_SCRIPT == 'forumdisplay.php' || THIS_SCRIPT == 'showthread.php' then>
Your link here
</if>

I think you can use $current_page variable too.

(03-05-2011 05:23 AM)Marc Wrote:  Actually I want to use it in the header, so the variable you mention is not defined at that stage, I guess.
If you want to put it in header template, unfortunately, yes, the $thread variable is not defined yet. But maybe you can use $style variable to get the forum id, and use forum cache to get the forum name.

(This post was last modified: 03-05-2011 05:56 AM by RateU.)
03-05-2011 05:50 AM
Find all posts by this user Quote this message in a reply
Marc Offline
Junior Member
**
Posts: 3
Joined: Mar 2011
Post: #5
RE: custom header link only visible on threadlist
Thanks, I will look into those Wink2
03-05-2011 10:17 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: