silensho
Junior Member
Posts: 3
Registered: 8/30/2005
Location: Guatemala
Member Is Offline
|
| posted on 8/30/2005 at 07:13 PM |
|
|
Using php to add parameters to Tiger Menu Links
Greetings. I've been recently introduced to php and a really tiny bit of javascript, so trying to use both correctly is starting to be more than a
challenge.
The situation is this: I used a Tiger Menu elaborated by these webpages. It's the "White Steps" type. Thing is, I'm also using it with frames,
as a navigation bar, and I'm supposed to open a link that a Menu Item points to, in another frame. I thought I'd be able to do so by editing the
menu_items.js,either manually or with php, but I haven't got any results the way I've been trying.
What am I doing wrong? Must I edit another file or add something else? Must I alter something using php so it can do what I want?
I'm also supposed to add parameters to some of the pages the items point to (which are php). I think I can solve this some other way, but I't be
good to know how to do it if possible.
Your help is greatly appreciated in this case.
[EDIT] For whatever's worth, I've solved the frame displaying issue. I was using several wrong approaches.
Now for the issue about adding parameters to the Links of the Menu Items, I think I also have a solution. It might not be a very bright one, but
since I have to implement a solution as quickly as possible, I won't complain.
|
|
|
tigra
Administrator
Posts: 1986
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 8/30/2005 at 10:34 PM |
|
|
If you need to modify the links in the items structure you'll have to rename the file to menu_items.php so the server knows that file has php code
inside. Alternatively you can move the content of that structure inside the main documnet (php file) and place it in the <script> tag. Then you
can insert php code inthe structure.
|
|
|
silensho
Junior Member
Posts: 3
Registered: 8/30/2005
Location: Guatemala
Member Is Offline
|
| posted on 8/31/2005 at 12:16 AM |
|
|
Thank you for your reply.
I hadn't thought about the solution you provide first. I think was troubling myself by trying the alternate solution. However, I might be missing
something, because when I do that, the Menu stops showing up.
Here's what the php file with javascript routhly looks like:
<html>
<style>...</style>
<?php
print '
<head>
<script language=\"JavaScript\">
<!--
/*Here go the modified contents of menu.js, trying to put it as intact as possible */
-->
</script>
<script language=\"JavaScript\"src=\"menu_items.js\"></script>
<script language=\"JavaScript\"src=\"menu_tpl.js\"></script>
<script language=\"JavaScript\">
<!--//
new menu (MENU_ITEMS, MENU_POS, MENU_STYLES);
//-->
</script>
</head>
'
?>
</html>
I put the contents of menu.js first, as I thought order would matter. Nevertheless I haven't been able to make the menu appear after that.
[EDIT] Problem solved. Used the alternate solution you provided. Thank you.
|
|
|