Super Ultra Mega Dynamic Menu Post - all gurus and no gurus invited |
[eluser]MEM[/eluser]
[quote author="jedd" date="1256792396"] In practice you say you're going to have three levels, and only three levels (...) In theory you say you want something that will scale to 'infinite' levels - which suggests absolute generations are wrong, and you instead need to emulate a nested set. [/quote] To put it on another perspective: In practice and theory I will need an unlimited level scale. Then, on the backend administration, I may consider ways to limit this menu usage,on some levels, . [quote author="jedd" date="1256792396"] If you have just three levels, then constructing the last segments of your URL is easy - you pull $grandparent, $parent, and $child from somewhere - say your session data, your current URL, etc - and reconstruct the new URL with that information appended. [/quote] I see... explode from /, implode, with / and follow that root... ? Right now, I've been introduced to stack methods by using array_push and array_pop I will see where this takes me as well... [quote author="jedd" date="1256792396"] I really do believe that if all your entities are contained in one table - that is, the 27, 42, and 69 (for example) all come from one thing.id column - and you have a thing.parent column in that same table - that you should only use ONE parameter, ONE number, to denote your current thing. As I mentioned before, it's easy to work out what's above and beneath any thing with two very simple model functions. [/quote] And I still believe is tempting, with means, it makes sense to me. [quote author="jedd" date="1256792396"] Can you fork here - are you using a CVS? [/quote] No. What I'm using is a fabulous "save as..." with some prefix. But the problem with this "method" is that I can't keep track of different separate files at once, so I believe I REALLY need to change my methodology. [quote author="jedd" date="1256792396"] if not I recommend git [/quote] I'm on micro$oft. And I really need a big introduction on how control versions work... [quote author="jedd" date="1256792396"] When I talk about preserving the parentage, I don't mean in the URL - I just mean on-screen, within the browser window proper. [/quote] Yes. [quote author="jedd" date="1256792396"] I think URL's need to be consistent over time, but they don't need words, and they don't need to be long. [/quote] I believe they need to be more semantic (Tim Lee is clapping now), so yes they need words. But still, be consistent over time. How? No idea. But I believe this is the path to follow. I agree with the long. [quote author="jedd" date="1256792396"] It's not a breadcrumb in the sense that it lets the user go back to where they came from - just context so they can work out where they are - and obviously you'd provide links to the context elements so they can move up and down the hierarchy more easily. This definitely gets difficult to make a decision about when you've got 2 or 3 (but no more) levels of hierarchy - as you'd obviously be better off showing them as 2 or 3 columns, and the user can see the whole thing laid out in front of them. As soon as you go for more columns or levels of hierarchy it gets really confusing, visually, as well as code, I think. [/quote] I totally agree. [quote author="jedd" date="1256792396"] My final comment - on using names rather than ID's - in your URL. I think this would be bad, for a number of reasons. [/quote] Ok... [quote author="jedd" date="1256792396"] First, long URLs are painful, especially once they breach 72 characters. [/quote] I've found nothing specific about 72 characters, but thanks to your comment I've found: http://www.w3.org/QA/Tips/uri-choose http://www.w3.org/Provider/Style/URI http://www.w3.org/TR/chips/#uri I've learn new things. For anyone else, including myself when I forget, here's a resume: Make your efforts to create: Short, Persistent, Semantic Relevant - URIs. [quote author="jedd" date="1256792396"] Second, IDs for a given thing tend to stay the same forever, but names sometimes change - which reduces the longevity of URL's, which annoys users (directly or indirectly because it also annoys search engines). [/quote] Partially agree. As stated, the optimal should be to have semantic names on the URI that persists (ideally) forever. Herbicidas is one of those names. Of course the category name could change one day, but at the limit, a comet could arrive to earth, and deal with this internet think at once, so, I would never say forever, but, ideally forever. [quote author="jedd" date="1256792396"] Third, words tend to have characters in them that need translating - such as spaces - so that they may appear in a URL, and that makes them look different to the actual name of the thing. [/quote] The same as ID. We could have 1024 or 1 024. What you are saying is valid, but not an argument against words. Words can have pontuation, accentuation, unite language chars... such as รง. They could, they tend, but it's easy to not allow that on uris. If you do not allow that on the URI the word possibilities are not an issue. [quote author="jedd" date="1256792396"] Fourth, names are possibly not going to be guaranteed unique in this context - insofar as you may have a product that matches the name of a product category, for example. [/quote] Single names no. But a path of names yes. www.mysite.com/categories/car/ www.mysite.com/products/car/ A short path of names however. :-) The worst URI we can have? A long id uri. And that's what I'm getting if I follow the path I'm in. So I really need to change this path. I'm just not yet sure, If I change on this project or on the next project. If you have nothing against, let's go back to the menu main question on the next thread... |
Welcome Guest, Not a member yet? Register Sign In |