Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
IOS Hotels
and
IOS Rentals
online booking systems for Elxis CMS.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Administration
»
Top module[SOLVED]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Top module[SOLVED] (Read 12331 times)
xenios
Hero Member
Posts: 528
Top module[SOLVED]
«
on:
March 07, 2008, 00:00:54 »
Hello,
i changed the mod_mainmenu code between the lines 256-278 because i couldn't use my top menu right....
I used the code of 2006.4 mod_mainmenu and it worked fine.
BUT I DON'T KNOW IF THIS IS BAD FOR THE REST OF ELXIS USE........
this was the change:
from this
$menuclass = 'mainlevel'.$params->get( 'class_sfx' );
if (count( $links )) {
switch ($style) {
case 1:
echo '<ul id="'. $menuclass .'">';
foreach ($links as $link) {
echo '<li>' . $link . '</li>';
}
echo '</ul>';
break;
default:
echo '<table width="100%" border="0" cellpadding="0" cellspacing="1">';
echo '<tr>';
echo '<td nowrap="nowrap">';
echo '<span class="'. $menuclass .'"> '. $params->get( 'end_spacer' ) .' </span>';
echo implode( '<span class="'. $menuclass .'"> '. $params->get( 'spacer' ) .' </span>', $links );
echo '<span class="'. $menuclass .'"> '. $params->get( 'end_spacer' ) .' </span>';
echo '</td></tr>';
echo '</table>';
break;
}
to this:
case 1:
echo '<ul id="'. $menuclass .'">';
foreach ($links as $link) {
echo '<li>' . $link . '</li>';
}
echo '</ul>';
break;
default:
echo '<table width="100%" border="0" cellpadding="0" cellspacing="1">';
echo '<tr>';
echo '<td nowrap="nowrap">';
echo '<span class="'. $menuclass .'"> '. $params->get( 'end_spacer' ) .' </span>';
echo implode( '<span class="'. $menuclass .'"> '. $params->get( 'spacer' ) .' </span>', $links );
echo '<span class="'. $menuclass .'"> '. $params->get( 'end_spacer' ) .' </span>';
echo '</td></tr>';
echo '</table>';
break;
}
«
Last Edit: March 09, 2008, 20:09:38 by Ivan Trebješanin
»
Logged
xenios
Hero Member
Posts: 528
Re: Top module
«
Reply #1 on:
March 07, 2008, 14:38:46 »
Does anybody knows if this is bad change???
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Top module
«
Reply #2 on:
March 07, 2008, 19:33:52 »
Where is the difference? Except if you mean that you removed the surrounding code (remove the "switch" and leave the "case"s as is) which generates PHP error.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
xenios
Hero Member
Posts: 528
Re: Top module
«
Reply #3 on:
March 08, 2008, 00:24:24 »
yes, but i don't have any php error.... i attached the file!!!
[old attachment deleted by admin]
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Top module
«
Reply #4 on:
March 08, 2008, 01:18:42 »
I have no time to check your file. You pasted here 2 blocks of code that seems to me identical. Where is the difference? What are your modifications?
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
xenios
Hero Member
Posts: 528
Re: Top module
«
Reply #5 on:
March 08, 2008, 02:37:29 »
This is the original module code:
$menuclass = 'mainlevel'.$params->get( 'class_sfx' );
if (count( $links )) {
switch ($style) {
case 1:
$random = rand(100, 999);
echo '<ul id="'.$menuclass.$random.'" class="'.$menuclass.'">'._LEND;
foreach ($links as $link) {
echo '<li>'.$link.'</li>'._LEND;
}
echo '</ul>'._LEND;
break;
case 0:
default:
$ends = $params->get( 'end_spacer');
$mids = $params->get( 'spacer' );
//echo '<div>'._LEND;
if ($ends != '') { echo '<span class="'.$menuclass.'">'.$ends.'</span>'._LEND; }
if ($mids != '') {
echo implode( '<span class="'.$menuclass.'"> '.$mids.' </span>', $links );
} else {
foreach($links as $link) { echo $link."\n"; }
}
if ($ends != '') { echo '<span class="'.$menuclass.'">'.$ends.'</span>'._LEND; }
//echo '</div>'._LEND;
unset($ends);
unset($mids);
break;
And this is how i changed:
$menuclass = 'mainlevel'. $params->get( 'class_sfx' );
if (count( $links )) {
switch ($style) {
case 1:
echo '<ul id="'. $menuclass .'">';
foreach ($links as $link) {
echo '<li>' . $link . '</li>';
}
echo '</ul>';
break;
default:
echo '<table width="100%" border="0" cellpadding="0" cellspacing="1">';
echo '<tr>';
echo '<td nowrap="nowrap">';
echo '<span class="'. $menuclass .'"> '. $params->get( 'end_spacer' ) .' </span>';
echo implode( '<span class="'. $menuclass .'"> '. $params->get( 'spacer' ) .' </span>', $links );
echo '<span class="'. $menuclass .'"> '. $params->get( 'end_spacer' ) .' </span>';
echo '</td></tr>';
echo '</table>';
break;
}
IT HAS A BIG DIFERRENCE, I REPLACED THE OLD CODE FROM MODULE 2006.4 TO WORK PROPERLY MY TOP MODULE...
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Top module
«
Reply #6 on:
March 08, 2008, 08:57:12 »
Now you pasted the right code blocks.
If you examine your changes you will see that the 2008.0 code is much better. Elxis 2008 does not uses tables, so you should use CSS to place the html elements. An other important parameter is that you make your html code xhtml invalid as you removed the $random from the ul ID. I prefer 2008.0's html, if you wish to use 2006's, it is your site!
«
Last Edit: March 08, 2008, 18:54:17 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
xenios
Hero Member
Posts: 528
Re: Top module
«
Reply #7 on:
March 08, 2008, 14:15:56 »
Ok, i agree with your answer, but i tried a lot of changes to my css mainmenu an top menu and nothing happened. Any suggestion??
Thank for your precious time on replying..
Logged
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: Top module
«
Reply #8 on:
March 08, 2008, 18:08:10 »
Hi, I just had to ask you: what are you trying to achive? I couln't see your point in above changes to the code. As you said in your first post, you should use CSS for visual formatting, not PHP. Can you explain or give us example of how you want your menu to look like?
Logged
I've got a snap in my finger...
Got rhythm in my walk...
xenios
Hero Member
Posts: 528
Re: Top module
«
Reply #9 on:
March 08, 2008, 21:14:28 »
Ivan, thank you for answering. I am trying to upgrade my old website from 2006.4 to 2008 elxis...
I found this problem that i cannot fix through topmenu module settings or css code..... after a lot of searching i found this solution: To change this part of code in module, this was causing the error..
Look at the images please. And if you need login and password to take a look please pm me!
[old attachment deleted by admin]
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Top module
«
Reply #10 on:
March 08, 2008, 21:42:19 »
You can easily do this with CSS. No need to hack Elxis source code for this.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Ivan Trebješanin
Elxis Team
Hero Member
Posts: 1663
Re: Top module[SOLVED]
«
Reply #11 on:
March 09, 2008, 20:13:22 »
Here's the point: you cannot use #mainlevel-nav for styling your menu. You have to use ul.mainlevel-nav!!! That's all I did, and it took me 30 sec to login, do the neccecery change in CSS and log out. No need to hack Elxis core.
Logged
I've got a snap in my finger...
Got rhythm in my walk...
xenios
Hero Member
Posts: 528
Re: Top module[SOLVED]
«
Reply #12 on:
March 09, 2008, 20:26:59 »
Thaaaaanks!!!!!!
Ivan you are a pro!! I am an amature....
You are great!
It's almost ironic because i tried this change yesterday morning it seems due to cache reasons on my computer i didn't saw any change!!!
I am very huppy/
«
Last Edit: March 09, 2008, 20:32:51 by a_xenias
»
Logged
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
Administration
»
Top module[SOLVED]