dynamic menu with show hide capabilities - understanding possible workflow
dynamic menu with show hide capabilities - understanding possible workflow
am 26.10.2009 14:28:08 von talofo talofo
Hello all,
I'm on my way to build my first dynamic menu using php.
However, each time I say this, people start jumping at me crying out =
loud:
"Jquery" .
I don't need js for this. Really. (At least, this is what I believe).
So I was wondering if It's possible to accomplish it, by using css and =
php
only.
If so, I'm wondering if something like this it's a good way for doing =
this:
1)
Generate a multidimensional array from database table containing =
categories
and subcategories.
2)
Create a css file with two classes one that shows, another that hides.
3)
Grab that array and:=20
3.1) print it recursively (no idea how to accomplish this)
3.2) print it with some sort of class=3D"showThis" inside the generated =
html
element.
3.3) make a conditional somewhere (I really don't know where, and this =
may
be related with the recursion doubt), in order to display the children
elements, only when we click the parent element.
And here resides my main doubt: Is the point 3.3 feasible without the =
use of
js?
I just need some directions please,
Regards,
M=E1rcio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: dynamic menu with show hide capabilities - understandingpossible workflow
> Hello all,
>=20
> I'm on my way to build my first dynamic menu using php.
> However, each time I say this, people start jumping at me crying out loud=
:
> "Jquery" .
> I don't need js for this. Really. (At least, this is what I believe).
>=20
> So I was wondering if It's possible to accomplish it, by using css and ph=
p
> only.
>=20
>=20
> If so, I'm wondering if something like this it's a good way for doing thi=
s:
>=20
> 1)
> Generate a multidimensional array from database table containing categori=
es
> and subcategories.
>=20
> 2)
> Create a css file with two classes one that shows, another that hides.
>=20
> 3)
> Grab that array and:=20
> 3.1) print it recursively (no idea how to accomplish this)
> 3.2) print it with some sort of class=3D"showThis" inside the generated =
html
> element.
> 3.3) make a conditional somewhere (I really don't know where, and this m=
ay
> be related with the recursion doubt), in order to display the children
> elements, only when we click the parent element.
>=20
> And here resides my main doubt: Is the point 3.3 feasible without the use=
of
> js?
>=20
>=20
>=20
> I just need some directions please,
>=20
> Regards,
> Márcio
>=20
>=20
>=20
Everything there is feasible without Javascript except for the clicking
part, which is pretty essential to what you want. Pure CSS-only menus
are still unavailable because of IE, so using some Javascript is your
only option really.
Is there a particular reason you are shying away from Javascript in this
case? There are ways you can construct drop-down menus in a way that if
Javascript is unavailable, then they fall back to becoming a
bog-standard navigation bar.
Also, before anyone mentions them,
RE: dynamic menu with show hide capabilities - understanding possible workflow
Thank you all.
=20
Ok. Please stay with me, cause I still have some doubts.=20
Not only do I need to display the subitems on click but also, when the =
user clicks on one menu item, I need to change the URI as well.
Why? Because, each time the user clicks on a menu item (whateaver that =
item as childs or not), I want to display a list of products related to =
the clicked item.
=20
So, I was trying to avoid js, because, I donâ=99t know that much =
about js. However, Iâ=99d like to do it properly, so, the only way =
I was allowing the use of js, was by do not disabling the back button =
functionality and by allowing a add to favorites option as well, =
allowing the URI changingâ=A6 O.o
=20
Anyway, letâ=99s face it:=20
Js is my only option, could this be a nice workflow, for an unobtrusive =
solution?
=20
=20
1) Generate the multidimensional array from query.
2) Generate the ul / li menu (echo + foreach) displaying all child =
elements as well.
3) Apply the anchor to the list items.
4) Apply some js to that ul / li that:=20
4.1) will be responsible for show/hide elements.
4.2) Will be responsible to show/hide elements only when some DOM =
node(?) as children.
4.3) Change the URI on click, so that some information can be showed =
based on uri segment.=20
=20
Can I have your help to fill the blanks here, or, if there are to many, =
just an orientation reference, in order to get startedâ=A6
=20
=20
=20
Thanks a lot once again,
Márcio
=20
=20
=20
=20
From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]=20
Sent: segunda-feira, 26 de Outubro de 2009 14:38
To: MEM
Cc: php-general@lists.php.net
Subject: Re: [PHP] dynamic menu with show hide capabilities - =
understanding possible workflow
=20
On Mon, 2009-10-26 at 13:28 +0000, MEM wrote:=20
=20
Hello all,
=20
I'm on my way to build my first dynamic menu using php.
However, each time I say this, people start jumping at me crying out =
loud:
"Jquery" .
I don't need js for this. Really. (At least, this is what I believe).
=20
So I was wondering if It's possible to accomplish it, by using css and =
php
only.
=20
=20
If so, I'm wondering if something like this it's a good way for doing =
this:
=20
1)
Generate a multidimensional array from database table containing =
categories
and subcategories.
=20
2)
Create a css file with two classes one that shows, another that hides.
=20
3)
Grab that array and:=20
3.1) print it recursively (no idea how to accomplish this)
3.2) print it with some sort of class=3D"showThis" inside the generated =
html
element.
3.3) make a conditional somewhere (I really don't know where, and this =
may
be related with the recursion doubt), in order to display the children
elements, only when we click the parent element.
=20
And here resides my main doubt: Is the point 3.3 feasible without the =
use of
js?
=20
=20
=20
I just need some directions please,
=20
Regards,
Márcio
=20
=20
=20
Everything there is feasible without Javascript except for the clicking =
part, which is pretty essential to what you want. Pure CSS-only menus =
are still unavailable because of IE, so using some Javascript is your =
only option really.
Is there a particular reason you are shying away from Javascript in this =
case? There are ways you can construct drop-down menus in a way that if =
Javascript is unavailable, then they fall back to becoming a =
bog-standard navigation bar.
Also, before anyone mentions them,
RE: dynamic menu with show hide capabilities - understandingpossible workflow
On Mon, 2009-10-26 at 15:01 +0000, MEM wrote:
> Thank you all.
>=20
> =20
>=20
> Ok. Please stay with me, cause I still have some doubts.=20
>=20
> Not only do I need to display the subitems on click but also, when the
> user clicks on one menu item, I need to change the URI as well.
>=20
> Why? Because, each time the user clicks on a menu item (whateaver that
> item as childs or not), I want to display a list of products related
> to the clicked item.
>=20
> =20
>=20
> So, I was trying to avoid js, because, I donâ=99t know that much abo=
ut
> js. However, Iâ=99d like to do it properly, so, the only way I was
> allowing the use of js, was by do not disabling the back button
> functionality and by allowing a add to favorites option as well,
> allowing the URI changingâ=A6 O.o
>=20
> =20
>=20
> Anyway, letâ=99s face it:=20
>=20
> Js is my only option, could this be a nice workflow, for an
> unobtrusive solution?
>=20
> =20
>=20
> =20
>=20
> 1) Generate the multidimensional array from query.
>=20
> 2) Generate the ul / li menu (echo + foreach) displaying all
> child elements as well.
>=20
> 3) Apply the anchor to the list items.
>=20
> 4) Apply some js to that ul / li that:=20
>=20
> 4.1) will be responsible for show/hide elements.
>=20
> 4.2) Will be responsible to show/hide elements only when some DOM
> node(?) as children.
>=20
> 4.3) Change the URI on click, so that some information can be showed
> based on uri segment.=20
>=20
> =20
>=20
> Can I have your help to fill the blanks here, or, if there are to
> many, just an orientation reference, in order to get startedâ=A6
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> Thanks a lot once again,
>=20
> Márcio
>=20
> =20
>=20
> =20
>=20
> =20
>=20
> =20
>=20
>=20
> From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]=20
> Sent: segunda-feira, 26 de Outubro de 2009 14:38
> To: MEM
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] dynamic menu with show hide capabilities -
> understanding possible workflow
>=20
>=20
>=20
> =20
>=20
> On Mon, 2009-10-26 at 13:28 +0000, MEM wrote:=20
>=20
>=20
> =20
> Hello all,
> =20
> I'm on my way to build my first dynamic menu using php.
> However, each time I say this, people start jumping at me crying out loud=
:
> "Jquery" .
> I don't need js for this. Really. (At least, this is what I believe).
> =20
> So I was wondering if It's possible to accomplish it, by using css and ph=
p
> only.
> =20
> =20
> If so, I'm wondering if something like this it's a good way for doing thi=
s:
> =20
> 1)
> Generate a multidimensional array from database table containing categori=
es
> and subcategories.
> =20
> 2)
> Create a css file with two classes one that shows, another that hides.
> =20
> 3)
> Grab that array and:=20
> 3.1) print it recursively (no idea how to accomplish this)
> 3.2) print it with some sort of class=3D"showThis" inside the generated h=
tml
> element.
> 3.3) make a conditional somewhere (I really don't know where, and this ma=
y
> be related with the recursion doubt), in order to display the children
> elements, only when we click the parent element.
> =20
> And here resides my main doubt: Is the point 3.3 feasible without the use=
of
> js?
> =20
> =20
> =20
> I just need some directions please,
> =20
> Regards,
> Márcio
> =20
> =20
> =20
>=20
>=20
>=20
> Everything there is feasible without Javascript except for the
> clicking part, which is pretty essential to what you want. Pure
> CSS-only menus are still unavailable because of IE, so using some
> Javascript is your only option really.
>=20
> Is there a particular reason you are shying away from Javascript in
> this case? There are ways you can construct drop-down menus in a way
> that if Javascript is unavailable, then they fall back to becoming a
> bog-standard navigation bar.
>=20
> Also, before anyone mentions them,
Re: dynamic menu with show hide capabilities - understandingpossible workflow
am 26.10.2009 16:49:47 von List Manager
MEM wrote:
> Thank you all.
>
> Ok. Please stay with me, cause I still have some doubts.
> Not only do I need to display the subitems on click but also, when the user clicks on one menu item, I need to change the URI as well.
> Why? Because, each time the user clicks on a menu item (whateaver that item as childs or not), I want to display a list of products related to the clicked item.
>
> So, I was trying to avoid js, because, I donât know that much about js. However, Iâd like to do it properly, so, the only way I was allowing the use of js, was by do not disabling the back button functionality and by allowing a add to favorites option as well, allowing the URI changing⦠O.o
The JS part isn't for clicking at all. Rather, it is for hovering.
Since IE doesn't have hover on any element besides the anchor, it is used to
mimic hovering in IE.
Use the following example to add the hover ability to your app.
>
> Anyway, letâs face it:
> Js is my only option, could this be a nice workflow, for an unobtrusive solution?
Remember, JS is only used to create the ability for IE to hover over elements :)
>
>
> 1) Generate the multidimensional array from query.
> 2) Generate the ul / li menu (echo + foreach) displaying all child elements as well.
> 3) Apply the anchor to the list items.
NO!!! don't do the following!
> 4) Apply some js to that ul / li that:
> 4.1) will be responsible for show/hide elements.
> 4.2) Will be responsible to show/hide elements only when some DOM node(?) as children.
> 4.3) Change the URI on click, so that some information can be showed based on uri segment.
>
> Can I have your help to fill the blanks here, or, if there are to many, just an orientation reference, in order to get startedâ¦
>
>
Now to satisfy the people that are going to ask the inevitable question "What if
JS is turned off??"
Show everything by default. Then, using JS, hide all that should be hidden and
go from their.
>
> Thanks a lot once again,
> Márcio
>
>
>
>
> From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]
> Sent: segunda-feira, 26 de Outubro de 2009 14:38
> To: MEM
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] dynamic menu with show hide capabilities - understanding possible workflow
>
> On Mon, 2009-10-26 at 13:28 +0000, MEM wrote:
>
> Hello all,
>
> I'm on my way to build my first dynamic menu using php.
> However, each time I say this, people start jumping at me crying out loud:
> "Jquery" .
> I don't need js for this. Really. (At least, this is what I believe).
>
> So I was wondering if It's possible to accomplish it, by using css and php
> only.
>
>
> If so, I'm wondering if something like this it's a good way for doing this:
>
> 1)
> Generate a multidimensional array from database table containing categories
> and subcategories.
>
> 2)
> Create a css file with two classes one that shows, another that hides.
>
> 3)
> Grab that array and:
> 3.1) print it recursively (no idea how to accomplish this)
> 3.2) print it with some sort of class="showThis" inside the generated html
> element.
> 3.3) make a conditional somewhere (I really don't know where, and this may
> be related with the recursion doubt), in order to display the children
> elements, only when we click the parent element.
>
> And here resides my main doubt: Is the point 3.3 feasible without the use of
> js?
>
>
>
> I just need some directions please,
>
> Regards,
> Márcio
>
>
>
>
> Everything there is feasible without Javascript except for the clicking part, which is pretty essential to what you want. Pure CSS-only menus are still unavailable because of IE, so using some Javascript is your only option really.
>
> Is there a particular reason you are shying away from Javascript in this case? There are ways you can construct drop-down menus in a way that if Javascript is unavailable, then they fall back to becoming a bog-standard navigation bar.
>
> Also, before anyone mentions them,
Re: dynamic menu with show hide capabilities - understandingpossible workflow
On Mon, 2009-10-26 at 08:49 -0700, Jim Lucas wrote:
> MEM wrote:
> > Thank you all.
> > =20
> > Ok. Please stay with me, cause I still have some doubts.=20
> > Not only do I need to display the subitems on click but also, when the =
user clicks on one menu item, I need to change the URI as well.
> > Why? Because, each time the user clicks on a menu item (whateaver that =
item as childs or not), I want to display a list of products related to the=
clicked item.
> > =20
> > So, I was trying to avoid js, because, I donâ=99t know that much a=
bout js. However, Iâ=99d like to do it properly, so, the only way I wa=
s allowing the use of js, was by do not disabling the back button functiona=
lity and by allowing a add to favorites option as well, allowing the URI ch=
angingâ=A6 O.o
>=20
> The JS part isn't for clicking at all. Rather, it is for hovering.
>=20
> Since IE doesn't have hover on any element besides the anchor, it is used=
to
> mimic hovering in IE.
>=20
> Use the following example to add the hover ability to your app.
>=20
> http://snipplr.com/view/1912/internet-explorer-ie6-css-hover /
>=20
> > =20
> > Anyway, letâ=99s face it:=20
> > Js is my only option, could this be a nice workflow, for an unobtrusive=
solution?
>=20
> Remember, JS is only used to create the ability for IE to hover over elem=
ents :)
>=20
> > =20
> > =20
> > 1) Generate the multidimensional array from query.
> > 2) Generate the ul / li menu (echo + foreach) displaying all child=
elements as well.
> > 3) Apply the anchor to the list items.
>=20
> NO!!! don't do the following!
>=20
> > 4) Apply some js to that ul / li that:=20
> > 4.1) will be responsible for show/hide elements.
> > 4.2) Will be responsible to show/hide elements only when some DOM node(=
?) as children.
> > 4.3) Change the URI on click, so that some information can be showed ba=
sed on uri segment.=20
> > =20
> > Can I have your help to fill the blanks here, or, if there are to many,=
just an orientation reference, in order to get startedâ=A6
> > =20
> > =20
>=20
> Now to satisfy the people that are going to ask the inevitable question "=
What if
> JS is turned off??"
>=20
> Show everything by default. Then, using JS, hide all that should be hidde=
n and
> go from their.
>=20
> > =20
> > Thanks a lot once again,
> > Márcio
> > =20
> > =20
> > =20
> > =20
> > From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]=20
> > Sent: segunda-feira, 26 de Outubro de 2009 14:38
> > To: MEM
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] dynamic menu with show hide capabilities - understan=
ding possible workflow
> > =20
> > On Mon, 2009-10-26 at 13:28 +0000, MEM wrote:=20
> > =20
> > Hello all,
> > =20
> > I'm on my way to build my first dynamic menu using php.
> > However, each time I say this, people start jumping at me crying out lo=
ud:
> > "Jquery" .
> > I don't need js for this. Really. (At least, this is what I believe).
> > =20
> > So I was wondering if It's possible to accomplish it, by using css and =
php
> > only.
> > =20
> > =20
> > If so, I'm wondering if something like this it's a good way for doing t=
his:
> > =20
> > 1)
> > Generate a multidimensional array from database table containing catego=
ries
> > and subcategories.
> > =20
> > 2)
> > Create a css file with two classes one that shows, another that hides.
> > =20
> > 3)
> > Grab that array and:=20
> > 3.1) print it recursively (no idea how to accomplish this)
> > 3.2) print it with some sort of class=3D"showThis" inside the generate=
d html
> > element.
> > 3.3) make a conditional somewhere (I really don't know where, and this=
may
> > be related with the recursion doubt), in order to display the children
> > elements, only when we click the parent element.
> > =20
> > And here resides my main doubt: Is the point 3.3 feasible without the u=
se of
> > js?
> > =20
> > =20
> > =20
> > I just need some directions please,
> > =20
> > Regards,
> > Márcio
> > =20
> > =20
> > =20
> >=20
> > Everything there is feasible without Javascript except for the clicking=
part, which is pretty essential to what you want. Pure CSS-only menus are =
still unavailable because of IE, so using some Javascript is your only opti=
on really.
> >=20
> > Is there a particular reason you are shying away from Javascript in thi=
s case? There are ways you can construct drop-down menus in a way that if J=
avascript is unavailable, then they fall back to becoming a bog-standard na=
vigation bar.
> >=20
> > Also, before anyone mentions them,
RE: dynamic menu with show hide capabilities - understanding possible workflow
am 27.10.2009 01:55:03 von talofo talofo
Thanks a lot for your replies.=20
Let's see if I understand, if not, please, let me know, I'm not that =
proficient in English.=20
Second try, in order to accomplish this, I have to:
1) Generate the multidimensional array from query.
2) Generate the ul / li menu (echo + foreach) displaying all child =
elements as well.
3) Apply the anchor to the list items.
=20
3.1) Each anchor on this list should point to a new URL (I don't care =
if the page refreshes on this case).
4) Print all this on a nice way to the browser. (unobtrusive)
5) Apply js to:
5.1) HIDE the elements that need to be hidden.=20
5.2) SHOW what needs to be displayed.
I don't want to have any onHover effect. The submenus will not appear on =
a onhover effect.=20
They should appear when the user either clicks on a parent menu item, or =
navigates to a specific URL.=20
Should this make me change this workflow somehow?=20
Please have patience... :s
Thanks again,
Márcio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Strange behaviour with uploaded files .. XAMPP on Windows
am 27.10.2009 02:31:42 von Angus Mann
Hi all. I'm not sure if this is really a PHP question or specific to XAMPP,
or windows in general...
I have XAMPP including PHP 4.29 running on a Vista machine.
When I use a form to upload a file, using $_FILES['uploadedfile']['name']
and move_uploaded-file($_FILES['uploadedfile']['name'], $targetpath) strange
effects happen.
The file is uploaded to the target directory just as it should.
But when I access this directory as a network share on a different machine,
the file is not visible.
When I go to delete the file, or the entire uploads folder, the file is not
deleted, nor the folder. If the folder contains anything I put there
manually (ie. not uploaded as above) that is deleted, but the uploaded
content remains.
This reminds me a bit of "symbolic links" behaviour but I'm really stumped
if that's the case.
Any ideas?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Strange behaviour with uploaded files .. XAMPP on Windows
am 27.10.2009 04:35:08 von Brady Mitchell
On Mon, Oct 26, 2009 at 6:31 PM, Angus Mann wrote:
> When I use a form to upload a file, using $_FILES['uploadedfile']['name']
> and move_uploaded-file($_FILES['uploadedfile']['name'], $targetpath) strange
> effects happen.
>
> The file is uploaded to the target directory just as it should.
>
> But when I access this directory as a network share on a different machine,
> the file is not visible.
This sounds more like a windows permissions problem than PHP or XAMPP
related. Make sure the user that is connecting to the network share
has rights to view files on the windows box. It sounds like the user
that is running XAMPP has full control (or at least read/write/delete)
to that directory, but the user connecting to the network share
doesn't.
> When I go to delete the file, or the entire uploads folder, the file is not
> deleted, nor the folder. If the folder contains anything I put there
> manually (ie. not uploaded as above) that is deleted, but the uploaded
> content remains.
Yeah, definitely sounds like a permissions issue.
I'm not much of a windows admin, but this looks like it might help:
http://www.mydigitallife.info/2007/05/25/how-to-take-ownersh ip-and-grant-permissions-in-windows-vista/
HTH,
Brady
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Strange behaviour with uploaded files .. XAMPP on Windows
am 27.10.2009 07:03:48 von Angus Mann
Yep, you were right. When I look, now I see that the permissions for the
file are different to locally created files.
Thanks for that !
>
> Yeah, definitely sounds like a permissions issue.
>
> I'm not much of a windows admin, but this looks like it might help:
> http://www.mydigitallife.info/2007/05/25/how-to-take-ownersh ip-and-grant-permissions-in-windows-vista/
>
> HTH,
>
> Brady
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: dynamic menu with show hide capabilities - understandingpossible workflow
> Thanks a lot for your replies.=20
>=20
> Let's see if I understand, if not, please, let me know, I'm not that prof=
icient in English.=20
> Second try, in order to accomplish this, I have to:
>=20
>=20
> 1) Generate the multidimensional array from query.
>=20
> 2) Generate the ul / li menu (echo + foreach) displaying all child elemen=
ts as well.
>=20
> 3) Apply the anchor to the list items.
> =20
> 3.1) Each anchor on this list should point to a new URL (I don't care if=
the page refreshes on this case).
>=20
> 4) Print all this on a nice way to the browser. (unobtrusive)
>=20
> 5) Apply js to:
> 5.1) HIDE the elements that need to be hidden.=20
> 5.2) SHOW what needs to be displayed.
>=20
>=20
> I don't want to have any onHover effect. The submenus will not appear on =
a onhover effect.=20
> They should appear when the user either clicks on a parent menu item, or =
navigates to a specific URL.=20
>=20
> Should this make me change this workflow somehow?=20
>=20
>=20
>=20
> Please have patience... :s
>=20
> Thanks again,
> Márcio
>=20
>=20
I think the term drop-menu is bad in this case, as essentially what you
are saying is:
1) user is presented with the basic navigation menu
2) user clicks an item and page navigates somewhere else
3) because of the item user clicked in 2) display some extra menu items
That's not a menu, it's just a navigation bar that changes slightly
depending on where you are in the site...
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-bsV4pTPGO0M67lpg9qPY--
Re: Strange behaviour with uploaded files .. XAMPP on Windows
On Tue, 2009-10-27 at 11:31 +1000, Angus Mann wrote:
> Hi all. I'm not sure if this is really a PHP question or specific to XAMPP,
> or windows in general...
>
> I have XAMPP including PHP 4.29 running on a Vista machine.
>
> When I use a form to upload a file, using $_FILES['uploadedfile']['name']
> and move_uploaded-file($_FILES['uploadedfile']['name'], $targetpath) strange
> effects happen.
>
> The file is uploaded to the target directory just as it should.
>
> But when I access this directory as a network share on a different machine,
> the file is not visible.
>
> When I go to delete the file, or the entire uploads folder, the file is not
> deleted, nor the folder. If the folder contains anything I put there
> manually (ie. not uploaded as above) that is deleted, but the uploaded
> content remains.
>
> This reminds me a bit of "symbolic links" behaviour but I'm really stumped
> if that's the case.
>
> Any ideas?
>
>
>
Also, try not to hijack someone elses thread. When making a new thread,
you shouldn't just use a reply to all from another message but create a
whole new email, because a lot of us use email clients that are thread
aware, and group message by thread, which is not the same as by subject!
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-67/6LI8Pcamj1hOR4Ene--
RE: dynamic menu with show hide capabilities - understanding possible workflow
am 27.10.2009 11:25:52 von talofo talofo
>I think the term drop-menu is bad in this case, as essentially what you =
are saying is:
>
>1) user is presented with the basic navigation menu
>2) user clicks an item and page navigates somewhere else
>3) because of the item user clicked in 2) display some extra menu items
>
Exactly.
>That's not a menu, it's just a navigation bar that changes slightly =
depending on where you are in the site...
Ok...
So the focus should not be on the click events, but on the URL changes.
=20
Since it will be based on URL changes and not, on click/hover events, I =
can rely this navigation system entirely on php. Right?
If this is correct, the only think I need then, is to create a =
condition, to show/hide ul/li items based on:
a) the url changes.
OR
b) the existence or non-existence of child array elements that needs to =
be verified each time the user navigates to a page.
Is this correct?
Thanks again,
Márcio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: dynamic menu with show hide capabilities - understandingpossible workflow
> >I think the term drop-menu is bad in this case, as essentially what you =
are saying is:
> >
> >1) user is presented with the basic navigation menu
> >2) user clicks an item and page navigates somewhere else
> >3) because of the item user clicked in 2) display some extra menu items
> >
>=20
> Exactly.
>=20
>=20
> >That's not a menu, it's just a navigation bar that changes slightly depe=
nding on where you are in the site...
>=20
> Ok...
>=20
> So the focus should not be on the click events, but on the URL changes.
> =20
> Since it will be based on URL changes and not, on click/hover events, I c=
an rely this navigation system entirely on php. Right?
>=20
> If this is correct, the only think I need then, is to create a condition,=
to show/hide ul/li items based on:
>=20
> a) the url changes.
>=20
> OR
>=20
> b) the existence or non-existence of child array elements that needs to b=
e verified each time the user navigates to a page.
>=20
>=20
>=20
> Is this correct?
>=20
>=20
> Thanks again,
> Márcio
>=20
That sounds about right yeah. You could also get a little bit clever and
only retrieve the rows from your db that will go to make the array
elements you'll need. It doesn't make sense to retrieve a full product
list each time someone visits the page, so you only need to retrieve
those that the user is interested in, which is shown by what they click
on.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-BFVHYwQkJxN/GWpDK+kj--
RE: dynamic menu with show hide capabilities - understanding possible workflow
am 27.10.2009 12:39:11 von talofo talofo
>That sounds about right yeah. You could also get a little bit clever =
and only retrieve the rows from your db that >will go to make the array =
elements you'll need. It doesn't make sense to retrieve a full product =
list each time >someone visits the page,=20
Ok.=20
>so you only need to retrieve those that the user is interested in, =
which is shown by what they click on.
The relation between click and the display of the corresponded array =
child elements, without using js, is the hardest to understand:
=20
The user will click on a link / the URL will change / the new page will =
be loaded to the user / the information displayed on that page should be =
related with the element clicked on the first step.=20
So, the next page, should know what we have clicked before, in order to =
display the information accordingly.=20
One of the ways that this can be done, is by passing params over the =
URL. The URL param will tell us what element have we clicked, so it =
should be based on URL. Once we have that, we need to ask: as that value =
passed on the url a correspondent array element that contains children? =
If so, display them.=20
(I realize my incapacity of talking technically, by referring to "pages" =
and other odd entities. I'm sorry for that).
Does the above makes any sense?
Thanks a lot,=20
Márcio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: dynamic menu with show hide capabilities - understandingpossible workflow
> >That sounds about right yeah. You could also get a little bit clever and=
only retrieve the rows from your db that >will go to make the array elemen=
ts you'll need. It doesn't make sense to retrieve a full product list each =
time >someone visits the page,=20
>=20
> Ok.=20
>=20
> >so you only need to retrieve those that the user is interested in, which=
is shown by what they click on.
>=20
> The relation between click and the display of the corresponded array chil=
d elements, without using js, is the hardest to understand:
> =20
> The user will click on a link / the URL will change / the new page will b=
e loaded to the user / the information displayed on that page should be rel=
ated with the element clicked on the first step.=20
>=20
> So, the next page, should know what we have clicked before, in order to d=
isplay the information accordingly.=20
> One of the ways that this can be done, is by passing params over the URL.=
The URL param will tell us what element have we clicked, so it should be b=
ased on URL. Once we have that, we need to ask: as that value passed on the=
url a correspondent array element that contains children? If so, display t=
hem.=20
>=20
>=20
>=20
> (I realize my incapacity of talking technically, by referring to "pages" =
and other odd entities. I'm sorry for that).
>=20
> Does the above makes any sense?
>=20
> Thanks a lot,=20
> Márcio
>=20
Think of it a bit like an online shop selling operating systems:
1) All the main OS's you sell are on the front page - Linux, MacOS &
Windows
2) User clicks on Linux, and is taken to the url /products/linux and
they are shown all the Linux OS's on offer (Fedora, SuSe, Ubuntu,
Knoppix, etc)
3) User clicks on Fedora and is taken to the URL /products/linux/fedora
and they are shown all the versions of Fedora up to 11
4) etc
The URL belies what section you are on, which makes it easy for the user
to remember, and easy for you to extract information from to know
exactly where the user is. Obviously in the above URLs I'm assuming
mod_rewrite is being used.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-6K02TfUge5m5IkXClCT3--
RE: dynamic menu with show hide capabilities - understanding possible workflow
am 27.10.2009 13:05:03 von talofo talofo
>Think of it a bit like an online shop selling operating systems:
>
>1) All the main OS's you sell are on the front page - Linux, MacOS & =
Windows
>2) User clicks on Linux, and is taken to the url /products/linux and =
they are shown all the Linux OS's on offer >(Fedora, SuSe, Ubuntu, =
Knoppix, etc)
>3) User clicks on Fedora and is taken to the URL /products/linux/fedora =
and they are shown all the versions of Fedora >up to 11
>4) etc
>
>The URL belies what section you are on, which makes it easy for the =
user to remember, and easy for you to extract >information from to know =
exactly where the user is. Obviously in the above URLs I'm assuming =
mod_rewrite is being >used.
>Thanks,
>Ash
>http://www.ashleysheridan.co.uk
Thanks a lot! Really.
I will now start coding based on all this information and see what I =
will get.
I'm sure that the designer will kill me later, by telling me... couldn't =
we just... fade in this a little bit... Ahhrrggg!!!
Regards,
Márcio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: dynamic menu with show hide capabilities - understanding possible workflow
am 30.10.2009 10:48:27 von talofo talofo
> -----Original Message-----
> From: MEM [mailto:talofo@gmail.com]
> Sent: terça-feira, 27 de Outubro de 2009 12:05
> To: 'ash@ashleysheridan.co.uk'
> Cc: 'Jim Lucas'; 'php-general@lists.php.net'
> Subject: RE: [PHP] dynamic menu with show hide capabilities -
> understanding possible workflow
>=20
> >Think of it a bit like an online shop selling operating systems:
> >
> >1) All the main OS's you sell are on the front page - Linux, MacOS &
> Windows
> >2) User clicks on Linux, and is taken to the url /products/linux and
> they are shown all the Linux OS's on offer >(Fedora, SuSe, Ubuntu,
> Knoppix, etc)
> >3) User clicks on Fedora and is taken to the URL
> /products/linux/fedora and they are shown all the versions of Fedora
> >up to 11
> >4) etc
> >
> >The URL belies what section you are on, which makes it easy for the
> user to remember, and easy for you to extract >information from to =
know
> exactly where the user is. Obviously in the above URLs I'm assuming
> mod_rewrite is being >used.
> >Thanks,
> >Ash
> >http://www.ashleysheridan.co.uk
>=20
>=20
>=20
> Thanks a lot! Really.
> I will now start coding based on all this information and see what I
> will get.
>=20
> I'm sure that the designer will kill me later, by telling me...
> couldn't we just... fade in this a little bit... Ahhrrggg!!!
>=20
>=20
> Regards,
> Márcio
Hello once again,=20
I have take my time to think on this for a while.
And I end up on the W3C recommendations about URIs:=20
In a phrase: Keep it semantic, lifetime, and short.
Several questions arise at this moment:
I was having a url like this:
http://www.mysite.com/c_mycontroller/method/1/3/4/54
Where the numbers where Id's of categories or products. Well...=20
this could be as far as we can get from the W3C recommendations. :s
So, let's say I short those urls to names, and I remove/hide(?)
from the URL the controller and method information's.=20
We could end up on something like this:
It's more semantic. But what if we have, 4 subcategories for example? =
This could get quite long.=20
A possible solution to this, is to have something like this:
http://www.mysite.com/categoryname/subcategoryname/productna me
In a way that we always get no more than 3 URI segments.
So, if the user navigates to a sub sub sub sub level on the hierarchy, =
the address could be:
1) What are your thoughts on this? Should I follow this track on your =
opinions?
2) In order to be semantic, I intend to pass through the URI segments, =
NOT the Category id's but the Category names.
This will bring two issues (at least):
2.1) - I need to query the database, not by ID but by Name. (I'm not =
sure if they always be unique, I'm not sure if I will have a performance =
issue). As a note: This is a VERY little website. Nothing too fancy.=20
2.2) I will grab the categories name from the database, and build the =
URL with those names, however, some category names will have INVALID =
chars, like á, ç, spaces... etc... What would be the best way =
of doing this? Having a new column on the database categories table with =
a "slug" field? Or, grab the category name, and prepare that name to be =
"url friendy" using a function for that? If it's possible to answer, =
where on a MVC structure would this function be?
Regards,
Márcio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php