Exclude a template page from a page

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
HerzeleidMeister
Registered User
Posts: 31
Joined: Sat Feb 25, 2012 3:00 pm
Location: Little Rock, AR
Name: Len Kaiser
Contact:

Exclude a template page from a page

Post by HerzeleidMeister »

I need to know how to exclude a page from a page. My situation is I'm using a mod for clubs and I also have a custom sidebar template that I have made. On only one part of the clubs pages the sidebar works on the other its misplaced. I'm pretty sure the template code for the clubs mod is pretty screwed up code wise so I need to exclude my sidebar from all the club pages until I can rewrite the template and split it into several templates that are smaller and make more sense and find the code error. Here is the code I have in my overall footer for my sidebar:

Code: Select all

    <div class="page-sidebar">
        <!-- INCLUDE sidebar.html -->
    </div>
I need to exclude the following template file: clubs_body.html

So basically I would need to add whatever code to the <!-- INCLUDE sidebar.html --> to exclude the sidebar from the clubs page. I have tried to move the sidebar code but it will not work anywhere else in the templates and it makes the sidebar disappear when I move the code elsewhere.
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Exclude a template page from a page

Post by Oyabun1 »

Depends on the MOD code.

To receive MOD support please visit our Modifications Database and post in the specific MOD’s designated support area. The link to the support area for each released MOD is also available in the first post of each released MOD listed in the MOD Database Releases forum.

No support is available here for MODs not obtained from this site or for MODs marked as abandoned.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53379
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Exclude a template page from a page

Post by Brf »

You will want to do something like this:

Code: Select all

   
<!-- IF SCRIPT_NAME ne 'clubs' -->
 <div class="page-sidebar">
        <!-- INCLUDE sidebar.html -->
    </div>
<!-- ENDIF -->
User avatar
HerzeleidMeister
Registered User
Posts: 31
Joined: Sat Feb 25, 2012 3:00 pm
Location: Little Rock, AR
Name: Len Kaiser
Contact:

Re: Exclude a template page from a page

Post by HerzeleidMeister »

Brf wrote:You will want to do something like this:

Code: Select all

   
<!-- IF SCRIPT_NAME ne 'clubs' -->
 <div class="page-sidebar">
        <!-- INCLUDE sidebar.html -->
    </div>
<!-- ENDIF -->
Thanks will give that a try. Does the "ne" stand for not to mean that it would not show on that template page?
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Exclude a template page from a page

Post by Lumpy Burgertushie »

it stands for "not equal".

the "clubs" part is the name of you clubs.php file that you created as part of your custom page.

you do not put the complete file name with the extension, just the filename like he posted above.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
HerzeleidMeister
Registered User
Posts: 31
Joined: Sat Feb 25, 2012 3:00 pm
Location: Little Rock, AR
Name: Len Kaiser
Contact:

Re: Exclude a template page from a page

Post by HerzeleidMeister »

Lumpy Burgertushie wrote:it stands for "not equal".

the "clubs" part is the name of you clubs.php file that you created as part of your custom page.

you do not put the complete file name with the extension, just the filename like he posted above.


robert
Thanks for the info :)

Well the code worked except there is still a place setting area for the sidebar and I need it to be regular on those pages. I need to exclude it in the template files probably not the php file. So instead of calling a php file I need something along these lines:

Code: Select all

<!-- IF SCRIPT_NAME ne 'clubs_body.html' -->
 <div class="page-sidebar">
        <!-- INCLUDE sidebar.html -->
    </div>
<!-- ENDIF -->
Now I realize that using this code will not work, I have not tried it because its asking for the php file script name and not a template file name. Is it possible to use something to leave a template file out?
User avatar
RMcGirr83
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Exclude a template page from a page

Post by RMcGirr83 »

Code: Select all

<!-- IF SCRIPT_NAME ne 'clubs' -->
 <div class="page-sidebar">
        <!-- INCLUDE sidebar.html -->
    </div>
<!-- ENDIF -->
SCRIPT_NAME relates to a PHP file, not an HTML file.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
HerzeleidMeister
Registered User
Posts: 31
Joined: Sat Feb 25, 2012 3:00 pm
Location: Little Rock, AR
Name: Len Kaiser
Contact:

Re: Exclude a template page from a page

Post by HerzeleidMeister »

RMcGirr83 wrote:

Code: Select all

<!-- IF SCRIPT_NAME ne 'clubs' -->
 <div class="page-sidebar">
        <!-- INCLUDE sidebar.html -->
    </div>
<!-- ENDIF -->
SCRIPT_NAME relates to a PHP file, not an HTML file.
No kidding, I know that, I said that in my post above. Like I said I knew that would not work because it related to a php file not a html template file. I need to know if its possible to have a code that related to a template page instead of a PHP page.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53379
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Exclude a template page from a page

Post by Brf »

HerzeleidMeister wrote: No kidding, I know that, I said that in my post above. Like I said I knew that would not work because it related to a php file not a html template file. I need to know if its possible to have a code that related to a template page instead of a PHP page.
No.
As we already said, you should be checking against the PHP file in the URL.
Brf wrote:You will want to do something like this:

Code: Select all

   
<!-- IF SCRIPT_NAME ne 'clubs' -->
User avatar
HerzeleidMeister
Registered User
Posts: 31
Joined: Sat Feb 25, 2012 3:00 pm
Location: Little Rock, AR
Name: Len Kaiser
Contact:

Re: Exclude a template page from a page

Post by HerzeleidMeister »

Thanks for your help, I've fixed my issue for the most part.
Locked

Return to “[3.0.x] MOD Writers Discussion”