Jump to content
Sign in to follow this  
rootKID

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

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! :)

Share this post


Link to post
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}?>

Share this post


Link to post
Share on other sites

nope, but it works.. thanks! :)

Share this post


Link to post
Share on other sites

Np "stewie", let my death be quick and painless when you're ruling the world!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...