Template link to go directly to board root

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Template link to go directly to board root

Post by stevemaury »

I need to make all the prosilver templates, other than index_body.html, contain only a link back to the root index.php file, so that no matter what .php file is typed into the browser address bar, the user only sees a link back to /index.php. If I use ../index.php, it does not work for those php files that take the user down more than on folder level. For example, typing http://MyBoardRoot/faq,php in the browser takes the user to http://MyDomainRoot/app.php/help/faq, so a link using ../index.php only goes back to http://MyDomainRoot/app.php/help/index.php.

I realize that this task is accomplished all the time in phpBB by using a link to [c]{U_INDEX}
, but I am not smart enough to construct a link that will always go back to /index.php. Something like

Code: Select all

<a href="{U_INDEX}">CLICK HERE</a>
A little help, please?
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
pit-PL
Registered User
Posts: 3212
Joined: Sat Nov 21, 2009 12:24 pm

Re: Template link to go directly to board root

Post by pit-PL »

<a href="{ROOT_PATH}">CLICK HERE</a>
or
<a href="{ROOT_PATH}index.php">CLICK HERE</a>
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Template link to go directly to board root

Post by stevemaury »

Thanks. Easy when you know how, eh?
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Template link to go directly to board root

Post by 3Di »

stevemaury wrote: Sun Feb 11, 2018 11:03 pm Thanks. Easy when you know how, eh?
This, placed on the very top of overall_header.html, should do the follow

If the user is not a Moderator or Admin and is not already in index, then the link appears. Just one edit.

Code: Select all

	<!-- IF SCRIPT_NAME neq "index" or (U_MCP or U_ACP) -->
		<p>
			<a href="{U_INDEX}">CLICK HERE</a>
		</p>
	<!-- ENDIF -->
Just one note, I didn't test it :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Template link to go directly to board root

Post by david63 »

To be technically correct it should be
pit-PL wrote: Sun Feb 11, 2018 7:56 pm <a href="{ROOT_PATH}index.{PHP_EXT}">CLICK HERE</a>
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
Post Reply

Return to “[3.2.x] Styles Support & Discussion”