Jump to content

how to make div appear if inside specific file via global design? Oo


rootKID

Recommended Posts

Okay, this is a little hard to explain, but i try.

 

As you see on the attached/uploaded picture, i wish to make a div like the page i found some days ago, it's easy i know..

BUT, here comes my problem.

 

I am using a template/global design via a file called template.php inside (root/templates/template.php), and in there i have my menu to be shown...

 

now, i wish this sub-menu to be shown, and i have done that, only problem is, that file is to be used on global design, meaning this div will be shown on ALL files (pages).

 

Now my question, is it possible with if and else statements (possible functions also), to make it show only on 1 file, the file called:

 

webshop.php

 

this is how my code inside template.php looks like right now:

//=======MENU$HTMLOUT .= "<div id='menu'>";	$HTMLOUT .= "<a href='#'>123</a>";	$HTMLOUT .= "";$HTMLOUT .= "</div>";//=====SUB$HTMLOUT .= "<div id='under_menu'>";	$HTMLOUT .= "123";$HTMLOUT .= "</div>";//=====SUB//=======MENU

my first thought was to use a if isset statement saying if a file was open, i did try search on google and other few forums/places, but without luck.. any ideas would be awsome! :)

Link to comment
Share on other sites

Have you tried this

<?php$currentFile = $_SERVER["PHP_SELF"];$parts = Explode('/', $currentFile);$currentpage = $parts[count($parts) - 1];if ($currentpage == "webshop.php") {//Display script here}?>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...