I'm using taxonomy for drupal 5 as found here: http://drupal.org/node/108972
Looking for a particular answer led me to Lowell's version of taxonomy_menu for use with pathauto: http://drupal.org/node/41450
Lowell's code is for drupal 4.7, and was never comitted to CVS. So I tried making a drupal 5 version. Time constraints meant this is as far as I got:
I took Lowells taxonomy_menu.module (http://drupal.org/node/41450#comment-169796) applied the "#21 patch" (http://drupal.org/node/108972#comment-184357).
patch got stuck on the first hunk. The rest were fine. I tested it, and it actually kind of works. menu table gets populated correctly, but on output, the <li>'s don't get nested -- even though the table has the correct pid. Any ideas?
I've zipped the folder including the .rej file and attached it.
Additionally it breaks DHTML menu.
| Comment | File | Size | Author |
|---|---|---|---|
| taxonomy_menu.zip__0.txt | 18.45 KB | Bevan |
Comments
Comment #1
riemann commentedHi bevan,
did you get Lowell's hack working in Drupal 5?
I played around with it, but I always end up with subcategories/subterms being placed all over the navigation-root-level of the menu instead of being hierarchically ordered. Also, many items show up twice or trice.
Otherwise, links, path etc. are correct.
Where do you think the problem is burried? In the menu.inc or in the taxonomoy_menu.module?
Regards, riemann
Comment #2
Bevan commentedHi there,
No I ddin't get it working. And there doesn't seem to be a maintainer for this module either. :(
B/
Comment #3
manne35 commentedHello all ,
i also worked 4 days to bring it to run. But no change for me.
(Maybe also my english was a too big shit...smile...)
I will wait now.
If there will be a solution i want to change from a joomla installation to drupal, cause i think its the better system (... but without the navigation i prefere to wait ).
Thanks for all who work for drupal and bring it forward.
best regards
manne
Comment #4
Bevan commentedAs a temporary solution, you can probably manually create the menus for your site. That's what joomla does by default. As far as I know joomla doesn't have this functionality in it's default distribution. Maybe in it's extensions...?
Comment #5
Bevan commentedI'm using this code in .htaccess to rewrite taxonomy_menu URLs as taxonomy/term/nn, which global-redirect then takes care of, by redirecting the user appropriately:
# Rewrite taxonomy menu urls. this would ideally be done in taxonomy menu module
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /taxonomy_menu/.*$
RewriteRule ^.*/(.*)$ /index.php?q=taxonomy/term/$1 [L]
Above
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
The taxonomy_menu/nn/n urls are still output to the source, but are always redirected once clicked on.
If you want the ideal solution, I suggest you have a go at peterx's solution here: http://drupal.org/node/41476#comment-181146 and here http://drupal.org/node/103539. Core menu is such that it is impossible for taxonomy to write menu tree-paths that are different to drupal paths using hook_menu. So peterx's solution is rather complicated and requires several core hacks.
Comment #6
manne35 commentedHello,
yes, theses threads i had also tested 3 days . Now it seems to work , only if i want to hide the
>taxonomy term< in the breadcrump i get the error
Fatal error: Call to undefined function: function_stripos() in /kunden/steinschmuck.de/webseiten/stneu/themes/garland/page.tpl.php on line 72
maybe its because on the server is php5 installed..?
Thank you all for your environment such a intuitiv user-orientationed CMS.
best regards
manne
Comment #7
htxt commented@bevan,
Can you clarify how you have global redirect setup?
I tried the .htaccess trick but I just get 404s for all the taxonomy_menu links.
Thanks :)
Comment #8
Bevan commented@graphicsplus
I installed Global Redirect (latest dev version, not official release), Pathauto 5.x-1.1, DHTML Menus 5.x-0.7, and Taxonomy Menu 5.x-1.x-dev. Show the taxonomy menu block in admin/build/blocks, then check that the menu items in that block link to taxonomy_menu/[tid]/[tid]/[tid]. Where [tid] is an integer that is the tid of the term, or one of it's ancestor terms. Make sure clear URLs are enabled and working.
Now look for this code at the bottom of .htaccess:
Replace it with this:
The bit that's different here is
which is essentially the same as
just below it. Except that it has an extra condition, and it changes the path. I've commented it extensively below. These give a complex instruction to apache about how to handles an http request.
This causes drupal (index.php) to look for a page or node that maps to drupal path 'taxonomy/term/[tid]', where [tid] is the part of the path after the last slash, or the tid of the current term. Global redirect intercepts this and redirects to the url_alias for taxonomy/term/[tid], which was probably set by pathauto when the term was created, or when pathauto mass generated url_aliases.
This method unfortunately means that taxonomy menu can no longer set the active term with <li class="active">. As menu.module can no longer see what path through the (taxonomy_menu) menu was taken to get to this menu item. To be able to do that, a change is being made to menu.module in drupal 6: http://drupal.org/node/103539. However I recently heard that hx is rewriting menu.module for d6. I'm not sure if/how this will affect peterx's patch.
For the above reason we've undone the hack described here in my client's site. You might find it useful for how the modules are configured though: http://www.bwmsnow.co.nz. We're using DHTML menu on the taxonomy menu, so defining the active menu item is necessary in the 'shop' taxonomy menu. For many other sites, especially if the taxonomy menu is working on a flat vocabulary, like the 'brand' taxonomy menu, this hack might still be useful though.
Comment #9
htxt commentedGreat writeup, thanks for the info ;)
I could only get this to work by removing the [L] flag, so the code looks like:
But it works, which is what counts :)
I also cleared the url_alias table, reinstalled pathauto, and bulk-updated all the category paths, if anyone's having similar problems.
Comment #10
Bevan commentedInteresting. Not sure why it only worked without [L].
Comment #11
tille commentedi was installing the taxonomy_menu.zip_.. as a replacement for taxonomy_menu.module .. - ..and now literally desperately trying to get this working - but i'm having these 'nice' problems:
• getting very nice url-aliasses after bulk url generation trough pathauto.. - ..hurray..:]
• but the menu kind of exploded - instead of heavin a hirachy in a seperate menu its all on 'top level' in the main navi-menu..
• getting negative id-numbers in the admin area
• cant modify nor delete nor do whatever to the dynamically created menu items
..does anyone have a 1-2-3-instruction on how to do this on drupal 5..?
..thank you very much, greetz, till..
Comment #12
tille commented..sorry - didnt want to change the title - so this post is now only for changing it back...
greetz, t..
Comment #13
Bevan commentedPlease read my first post starting this thread -- actually the whole thread... I wouldn't try and run this on your site, it needs a lot of work, and there are better solutions coming from other peoople anyway...
Comment #14
summit commentedHi,
I tried this .htaccess hack in Drupal 4.7...but it didn't work.
Should it normally also work for drupal 4.7?
Thanks in advance for your reply.
greetings,
Martijn
Comment #15
summit commentedHi,
I made a mistake myself. I needed to make manually the vocabulary taxonomy_menu items, and than it worked.
Are there other issues with the .htaccess solution, than stated above?
greetings,
Martijn
Comment #16
summit commentedoeps changed the title..sorry
Comment #17
Bevan commentedHi, not that I know of, although we're not implementing this system, so I haven't tested it extensively
Comment #18
tille commentedhello everybody - once again..:]
I used 'category' in between.. but that brings sooo many little helpers (and problems) that I went back to taxonomy menu.. or lets say I'm trying to give it another try..:]
@ bevan. 'there are better solutions coming from other people anyway'. - ..what do you mean..? ..is there..?! the htaccess-'hack'..? ..wel - if thats the only way to do a clean taxonomy menu - I'll go for it.
whatever - kind of 'down' after installing and 'de-installing' various modules again - and again - and again.. cant really believe that theres no solution to this 'problem' of having a 'nice' menu AND 'nice' urls for the beloved taxonomy.....?!¿
well - greetingz, till..
Comment #19
gregglesThis seems like a better title. If it does ever get implemented, note that the Pathauto API has changed since this was originally written...
Comment #20
arlinsandbulte commentedThis is quite old and according to #19, probably does not even apply anymore anyway...
Marking as won't fix
Comment #21
johnvReassigning, to not show anymore in 7.x issues.