View previous topic :: View next topic |
Author |
Message |
sriramchitta Smarty Rookie
Joined: 14 Oct 2004 Posts: 14 Location: Hyderabad
|
Posted: Tue Dec 14, 2004 10:04 am Post subject: problem with smarty menu |
|
|
hi,
SmartyMenu is not working for me
this is my code i created a object for Smartymenu in my config file and using it.....
the following code doesn't show any ouput.
<?php
include_once("config.inc.php");
global $gSmarty,$gSmartyMenu,$SITE_URL;
/* Sub Menu for Masters */
$gSmartyMenu->menuInit($sub_menu);
$gSmartyMenu->initItem($item);
$gSmartyMenu->setItemText($item,"Employee Salary");
$gSmartyMenu->setItemLink($item,"$SITE_URL/index.php?qs=".
base64_encode("act=48&t=".time()));
$gSmartyMenu->setItemClass($item, 'subnav');
$gSmartyMenu->addMenuItem($sub_menu, $item);
/* Main Menu for Masters */
$gSmartyMenu->initMenu($menu);
$gSmartyMenu->initItem($item);
$gSmartyMenu->setItemText($item,"Masters");
$gSmartyMenu->setItemLink($item,"$SITE_URL/index.php?qs=".
base64_encode("act=65&t=".time()));
$gSmartyMenu->setItemClass($item, 'topnav');
$gSmartyMenu->setItemSubmenu($item, $sub_menu);
$gSmartyMenu->addMenuItem($menu, $item);
//print_r($menu);
$gSmarty->assign("menu",$menu);
?>
Template
<head>
{menu_init css="$CSS_REF/outline_h.css"}
</head>
{menu data=$menu}
I need this working please help .....
thanks,
Sriram. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Dec 14, 2004 2:53 pm Post subject: |
|
|
What does print_r($menu) show? does your javascript console give any errors? What browser? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Dec 14, 2004 3:00 pm Post subject: |
|
|
Maybe start with a very simple array:
Code: |
$menu = array(
array(
'text' => 'Yahoo',
'link' => 'http://www.yahoo.com',
'class' => 'topnav'
),
array(
'text' => 'Google',
'link' => 'http://www.google.com',
'class' => 'topnav'
),
); |
Get that working first, then try yours again.
Also, there shouldn't be a reason to create in instance of SmartyMenu, you should probably use it statically as it was intended. |
|
Back to top |
|
sriramchitta Smarty Rookie
Joined: 14 Oct 2004 Posts: 14 Location: Hyderabad
|
Posted: Tue Dec 14, 2004 3:00 pm Post subject: smarty menu problem |
|
|
i commented it amd no javascript errors. i also tried to print the $menu in samrty template ({php} print_r($menu){/php}) and nothing is displayed.
What could be the problem???
can you send me a working copy of the script if you have one
thanks
Sriram |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Dec 14, 2004 3:03 pm Post subject: |
|
|
The print_r($menu) you have in your PHP code commented out, that is where you execute it.
The smarty menu demo shows a "working copy", try to get that working first. |
|
Back to top |
|
sriramchitta Smarty Rookie
Joined: 14 Oct 2004 Posts: 14 Location: Hyderabad
|
Posted: Tue Dec 14, 2004 3:15 pm Post subject: hello Mr.Monte |
|
|
i mean a sample script that you have. and the source which i have is downloaded from that site and tried to execute in the way its mentioned in the site.
what version of smarty do we need for smarty menu. i have 2.3.X is this sufficient for it
i am sorry if i hurt in my previous message. you sounded very angry in your reply
Thanks
Sriram |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Dec 14, 2004 3:32 pm Post subject: |
|
|
no anger here...
The online demo shows all of the source for a working demonstration, so I'm not sure what you want me to send you. |
|
Back to top |
|
sriramchitta Smarty Rookie
Joined: 14 Oct 2004 Posts: 14 Location: Hyderabad
|
Posted: Tue Dec 14, 2004 3:34 pm Post subject: smarty menu |
|
|
which version of smarty source do we need
sriram |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Dec 14, 2004 4:00 pm Post subject: |
|
|
I've only tested it on the lastest release, although nothing comes to mind why it wouldn't work on older versions.
I'd suggest follow the installation instructions to the tee, make a simple single-level menu and get that working first. |
|
Back to top |
|
sriramchitta Smarty Rookie
Joined: 14 Oct 2004 Posts: 14 Location: Hyderabad
|
Posted: Tue Dec 14, 2004 4:22 pm Post subject: hello |
|
|
i tried it but still didn't worked.i had the same kind of problem with smarty paginate where i was using 3.0.x version of smarty source and it didn't worked util i upgraded it. so i will also try it with the latest version of smarty. I will contact you again if i there a problem still
thanks
Sriram. |
|
Back to top |
|
sriramchitta Smarty Rookie
Joined: 14 Oct 2004 Posts: 14 Location: Hyderabad
|
Posted: Tue Dec 14, 2004 5:17 pm Post subject: thank you |
|
|
Hello Mr.Monte,
It started worked working with new source of smarty.
THnak you for your help
Sriram. |
|
Back to top |
|
|