Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
February 12, 2012, 04:11:24 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
149621
Posts in
21098
Topics by
7537
Members
Latest Member:
lotte2
WebsiteBaker Community Forum
English
Templates, Menus & Design
(Moderator:
Argos
)
a:current?
Pages: [
1
]
Go Down
Author
Topic: a:current? (Read 909 times)
Ogierini
Offline
Posts: 269
a:current?
«
on:
March 13, 2010, 05:09:49 PM »
Hi
I have a question about the menu css.
I would like to have a hover, no problem. But than as well I would like
on the active page
, the page you visite a t that moment: a little symbol appears in the menu.
It can't be a:visited because when visited al pages have the symbol in the menu.
I thought a:current but it doesn't exist?
Can someone help out?
Logged
Kind regards,Irene
Bramus
Forum Team
Offline
Posts: 600
Re: a:current?
«
Reply #1 on:
March 13, 2010, 05:40:44 PM »
wasnt this menu-current?
Logged
BRAMUS Internet Services
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #2 on:
March 13, 2010, 05:51:30 PM »
Hello Irene.
You'll need to apply the css class to these List Items or to the A Tags of the current pages.
See the example ( by $aItemOpen):
Code:
<?php
show_menu2
(
$aMenu
=
0
,
$aStart
=
SM2_ROOT
,
$aMaxLevel
=
SM2_CURR
+
1
,
$aOptions
=
SM2_ALL
,
$aItemOpen
=
'<li [if(class==menu-current){class="active"}]>[if(class==menu-current) { [a]<span>[menu_title]</span>} else {[a][menu_title]}]</a>'
,
$aItemClose
=
'</li>'
,
$aMenuOpen
=
'<ul class="mymenu">'
,
$aMenuClose
=
'</ul>'
,
$aTopItemOpen
=
false
,
$aTopMenuOpen
=
false
);
?>
This is just a example.
You also can use the standard SM2 behaviour, as roposed by Bramus in the post above.
However, you should read the SM2 documentation in order to fully understand this topic.
Kind Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #3 on:
March 13, 2010, 05:55:37 PM »
gonna try ! Thanks, guys, let you know!
Logged
Kind regards,Irene
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #4 on:
March 14, 2010, 03:42:39 PM »
Ai doesn't work yet.
If you klick the logo appears but it should only appear when it is the page in question
http://www.idealcooking.nl/cms
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #5 on:
March 14, 2010, 03:56:28 PM »
Dear Irene,
you did it right.
You only forgot your css file.
Change/Expand the following selector:
#nav li a:hover {
to:
#nav li a:hover,#nav li.active a {
and you'll get there..
Kind Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #6 on:
March 14, 2010, 04:04:53 PM »
Thanks Stefek, IT WORKED!
There is just 1 minor thing left: the "#nav ul ul li" are shown in the menu, while I want them only to be shown when clicked on the "#nav li"
Can I delete the _ROOT from: $aStart = SM2_ROOT,
?
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #7 on:
March 14, 2010, 04:11:28 PM »
Do I understand right, you want this behaviour only for the parents, not for its childs?
R,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #8 on:
March 14, 2010, 04:16:32 PM »
yeah that's right!
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #9 on:
March 14, 2010, 04:17:09 PM »
In that case, use the following CM2 call:
( only $aItemOpen changed):
Code:
<?php
show_menu2
(
$aMenu
=
0
,
$aStart
=
SM2_ROOT
,
$aMaxLevel
=
SM2_CURR
+
1
,
$aOptions
=
SM2_ALL
,
$aItemOpen
=
'<li [if(level==0 && class==menu-current){class="active"}]>[if(class==menu-current) { [a]<span>[menu_title]</span>} else {[a][menu_title]}]</a>'
,
$aItemClose
=
'</li>'
,
$aMenuOpen
=
'<ul class="mymenu">'
,
$aMenuClose
=
'</ul>'
,
$aTopItemOpen
=
false
,
$aTopMenuOpen
=
false
);
?>
This should do the trick.
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #10 on:
March 14, 2010, 04:30:40 PM »
No, wait.
This is not right.
I'll take a look further into it....
just wait a second.
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #11 on:
March 14, 2010, 04:34:06 PM »
It still shows the children, we should make them appear on click...
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #12 on:
March 14, 2010, 04:40:15 PM »
Hello Irene,
this should solve your child-items problem:
replace $aItemOpen, with the following:
$aItemOpen
=
'<li><a href="[url]" target="[target]"[if(level==0 && class==menu-current){ class="active"}]>[menu_title]</a>'
,
then, change your selector name
#nav li.active a
.mymenu li a.active {
color: #efaf0f;
background-image: url(images/logomenu1.png);
background-repeat: no-repeat;
background-position: left center;
}
Will do the trick.
Let me know.
Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #13 on:
March 14, 2010, 04:48:52 PM »
Hi Stefek,
That helps, the logo only appears with the parents.
Only the children shouldn't be visible at the start, only at click. Should I change their css?
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #14 on:
March 14, 2010, 05:15:57 PM »
I see..
you need to specify this in the
$aOptions
Parameter.
Please try flag
SM2_TRIM
instead of
SM2_ALL
.
There are infinite possibilities with show_menu2.
Consider to read the manual / help file
Kind regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #15 on:
March 14, 2010, 05:30:39 PM »
You are fantastic,
Thank you very much.
It wasn't lazyness... I just don't see the solution. But the more you try the more it seems to be logic.
anywell, Thanks a lot!
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #16 on:
March 14, 2010, 05:50:38 PM »
Quote from: Ogierini on March 14, 2010, 05:30:39 PM
But the more you try the more it seems to be logic.
That's right, Irene...
I am glad that I was able to help you out with this.
Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current? | menu disappears now and then
«
Reply #17 on:
March 16, 2010, 02:34:59 PM »
Maybe the site is tired.... but all of a suddon the menu disappears now and then.
When you click throu the website sometimes it's gne, and after clicking F5 it appears again, but that's a bit balen....
http://www.idealcooking.nl/cms/
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #18 on:
March 16, 2010, 03:16:17 PM »
Hello Irene,
I cant't help you with this, because I can't reproduce this bug on my browser.
But I have another hint for your show_menu2 call.
Change:
$aItemOpen
=
'<li><a href="[url]" target="[target]"[if(level==0 && class==menu-current){ class="active"}]>[menu_title]</a>'
,
into:
$aItemOpen
=
'<li><a href="[url]" target="[target]"[if(level==0 && class==menu-current || class==menu-parent){ class="active"}]>[menu_title]</a>'
,
In this case, the "icon/logo" will show in the menu on the parent, when it's child is active.
I have overseen this before.
Try it out and let me know if you like it
R,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Ogierini
Offline
Posts: 269
Re: a:current?
«
Reply #19 on:
March 16, 2010, 03:32:06 PM »
Yes,
this is beautifull thank you!
I haven't seen the disapear thingie again. Strange but fortunate!
Well thanks again for your help!
Logged
Kind regards,Irene
Stefek
WebsiteBaker Org e.V.
Offline
Posts: 4753
Re: a:current?
«
Reply #20 on:
March 16, 2010, 04:04:24 PM »
You're welcome!
Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
-----------------------------
English
-----------------------------
=> Help & Support
-----------------------------
General
-----------------------------
=> WebsiteBaker Website Showcase
-----------------------------
English
-----------------------------
=> Modules
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
-----------------------------
General
-----------------------------
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
-----------------------------
General
-----------------------------
=> Security Announcements
-----------------------------
Deutsch (German)
-----------------------------
=> Hilfe/Support
-----------------------------
General
-----------------------------
=> Documentation
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
=> Module & Snippets
-----------------------------
English
-----------------------------
=> Archive (posts up to 2007)
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Deutsch (German)
-----------------------------
=> jQuery
=> Tutorials
=> Templates & Design
-----------------------------
English
-----------------------------
=> jQuery
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
===> Suggestions
-----------------------------
Deutsch (German)
-----------------------------
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
===> Vorschläge
-----------------------------
English
-----------------------------
===> Software bugs
-----------------------------
Deutsch (German)
-----------------------------
===> Softwarefehler
=====> Module / Extensions
-----------------------------
English
-----------------------------
=====> Modules / Extensions
-----------------------------
Deutsch (German)
-----------------------------
===> Erfahrungs und Testberichte
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...