Support from Acquia helps fund testing for Drupal Acquia logo

Comments

subspaceeddy’s picture

Status: Active » Needs review
FileSize
9.99 KB

Here's my upgrade to 5.0. I think I've covered everything, I have it working fine on my local XP, PHP5.1 machine and the Linux, PHP4.4 server - both Apache, but I can't say I've exhaustively tested all features of it, just the one's I use (which for all I know could be all of them). .info file to follow. Oh... I hacked the module on XP so it may have cr/lf line endings... and also I may have used the occasional tab instead of double space.

subspaceeddy’s picture

FileSize
151 bytes

.info file...

DayShallCome’s picture

Hmm, it seems that this doesn't add the expanding menu functionality. It is only showing me the 1st level of words. Any ideas?

subspaceeddy’s picture

FileSize
9.54 KB

Ok. At the start of today I knew nothing about javascript, and never really wished to know anything about javascript. Now not only did i force myself to understand it, but i also worked my way around jQuery enough to know that it is a fantastic addition to Drupal.

So, here is the module again. I rewrtote the javascript interface so that it is actually much smaller and simpler than before using jQuery, and it seems to work for me. There is a new 'menuexpandable4.js' and 'menuexpandable4.css' too which i will post after this.

I hope this works, cos i don't really fancy hacking it more. The code could be tidied too - it is my first js attempt, and the use of jQuery has made a lot of the 'actuator' and 'menu_xx' code redundant, but i've left it in anyway just in case....

subspaceeddy’s picture

FileSize
9.8 KB

lol.... posted the original module back up.... here is the modified one..

subspaceeddy’s picture

FileSize
789 bytes

new js..

subspaceeddy’s picture

FileSize
1.05 KB

slightly altered css

subspaceeddy’s picture

Well it works fine in firefox... but i just tried ie7 and the menu seemed to disappear on mine. bummer.

subspaceeddy’s picture

FileSize
1 KB

This js works in Firefox, Opera and IE(7). Not tried IE6...

DayShallCome’s picture

Hmm, interesting. This doesn't seem to be working yet.

As it is right now, I have a vocabulary with 4 levels (including root level). For example, one path through the Vocabulary is (Animal(root)>Dog>Bad Dog>VeryBadDog). When I click on Dog, it expands to Bad Dog. However, it thinks that Bad Dog is the lowest level. Also, I don't see the plus.gif and minus.gif.

I've attached a picture to explain myself better.

Is this how it looks on your computer, or is it not working the same way?

And thank you so much for your assistance. Your help has been invaluable so far.

DayShallCome’s picture

hhmm, the pic didn't attach.

DayShallCome’s picture

FileSize
540.19 KB

So sorry... the picture was too big. Here it is.

subspaceeddy’s picture

Ah.. I've been fixing up the page view rather than the block view. OK, i will get on to this, but wont get chance now til middle of next week probably...

DayShallCome’s picture

Hmm, this is the page view - this is what I get when I go to .../taxonomy_dhtml.

subspaceeddy’s picture

FileSize
33.97 KB

Oh OK... i tried to reconstruct your taxonomy structure - here is the screenshot - i have no problem - +- show properly and all levels open as expected.

I can't understand why yours is not working...

There are a couple of problems with taxonomy_dhtml that are there in 4.7 - the +- graphics are referenced from the web root which means that if you have drupal installed in a sub folder the graphics wont show. I haven't fixed this.

The only other thing that i can think of, unless there is some other problem that needs tracking down is that you have the wrong files, since there are now so many posted on this thread, or that you didn't rename the files downloaded to their correct names. I noticed that the .css file had a .txt appended to it that needs removing, and the second js file i uploaded was called menuExpandable4_0.js and the _0 should be removed. I'm kinda clutching at straws here but hoping that that is what the problem is.

Could you let me know if you are running drupal from the web root and that all the files are the latest ones and named correctly, then maybe we should continue this over email so we can track down the problem without clogging up the thread, and just post the 'final' versions here...

:)

subspaceeddy’s picture

FileSize
33.63 KB

OK... here is a zipped folder of taxonomy_dhtml. I have altered the javascript/jquery once more since I was not happy with a conditional Internet Explorer check. This is now removed and the menu items are referenced by an explicit #id, which is the way i should have done it in the first place, but didn't know enough jQuery. I don't think this would have caused your problems though. But you never know.

Also, taxonomy_dhtml.module has altered to accommodate this, so i thought i'd zip the lot up rather than upload them one at a time again. There are translation files in here too but i have no idea if they still work.

Hope this works, let me know if it doesn't :)

DayShallCome’s picture

So an odd thing has happened... I was confused as to why this module wasn't working on my test site (sandbox), because the .js looks good to me (though to be fair, I'm not exactly a master). So I loaded this module up onto my live site, and it worked perfectly (in both firefox and IE7).

Do you have any idea why this would be the case? I'm using PHP 5.2 on my sandbox, and 4.x on my live site, but everything else should be the same. I wonder if this is the difference?

Very odd, to be honest. Let me know if you have any ideas why this would be the case.

Thank you very much, btw. You've done a great job, and I don't see why this module couldn't be committed to 5.0.

subspaceeddy’s picture

I really don't know why it wouldn't work on your sandbox. I'm glad it's not just working on my machine though!

I'm happy with the js now and think it should work universally. Did the latest version still not work? It's not anything like the browser cache is it?

I guess the only real difference is php 5.2 though... and i don't want to install that on my machine until drupal fully supports it...

anyway glad it's working :)

DayShallCome’s picture

It now works on my local machine. I'm guessing that, yes, it was the browser cache. :/ Pretty frustrating, but I'm happy that it seems to work now.

Again, thanks for all of your hard work. You should think about becoming the maintainer for this module.

canadrian’s picture

Another vote for a 5.x upgrade

joshua_cohen’s picture

FileSize
5.11 KB

I just downloaded the latest packaged release "taxonomy_dhtml.tar.gz (33.63 KB)" and installed it, however it does not seem to be working correctly. When viewing the page output, a listing of terms is shown, however the expand feature doesn't seem to work. Looking at the attached image, you'll see that Connecticut shows a total of two terms found, however the plus image is not shown to expand Connecticut. Any ideas? I have the same problem in both IE and Firefox.

Thank You,

Josh

joshua_cohen’s picture

My apologies, I just ported over to 5.1 from 4.7 and didn't add the new import js statement to my theme. Everything is working great!

Thanks,

Josh

subspaceeddy’s picture

Thanks for reporting back on that. Always useful to know solutions to potential problems with install/upgrade...

francoud’s picture

I also had the problem with the tree non expandable - and the "plus" sign didnt show. My problem is that my (testing) drupal5 website runs under an url "/drupal5" , something like: www.xxxxx.yy/drupal5/
In the menuExpandable4.js file, the plus.gif and minus.gif images were referred with an url like: "/modules/taxonomy_dhtml/plus.gif" (note the leading slash) - so they were searched in www.xxxxx.yy/modules/taxonomy_dhtml/ - not a correct place. I tried removing the leading slashes in menuExpandable4.js - but, I dont know why, it didnt worked still. I then tried hardcoding the entire path in menuExpandable4.js ("/drupal5/modules/taxonomy_dhtml/minus.gif", etc.) and now it works. Of course it's just for testing - I will try to understand why simply removing the leading slash didnt work... any idea?

Another problem I have, is with internationalization module (I18N) supporting; I've one vocabulary set to "no language" and some term inside, some with italian some with english language, translated with I18N - when using the taxonomy_dhtml block, the proper terms (depending from current language) are *correctly* displayed; but when browsing categories with "/taxonomy_dhtml", only the english vocabulary is shown -also when using italian as current language. Maybe it's just my error somewhere?

francoud’s picture

FileSize
927 bytes

Can I also suggest a little modification to the taxonomy_dhtml_vocab_vert function?

I often use the "block" feature ot taxonomy_dhtml to have a block with list of terms from a vocabulary - taxonomy_dhtml works great for this. Just, I honestly would prefer that each line would be listed with a "li" element, instead of the "- " hardcoded in that function. I would suggest changing that procedure to support a "<ul><li>$link</li>...</ul>" listing; I tried patching the taxonomy_dhtml_vocab_vert procedure (I attach the file) - should be reviewed, I don't know if this could broke something else...

Thanks to all for the wonderful work!

francoud’s picture

taxonomy_dhtml_vocab_vert - errata corrige...

Sorry an error in my previous posting - the "correct" patched version should be this one!

Ryanbach’s picture

Subscribing.

Ryanbach’s picture

@francoud

I think the Drupal PHP function: drupal_get_path('module', 'module-name') could do it...

See: http://drupal.org/node/64279#drupal-add-css

Just a suggestion.

Ryanbach’s picture

FileSize
212 bytes

Improved info file.

subspaceeddy’s picture

The module path needs passing to the .js code.

I think that all that is needed is to change this line in the .module file:

	 drupal_add_js("$(document).ready(function() { initializeMenu() } );", 'inline');

to something like this:

  $modpath = drupal_get_path('module', 'taxonomy_dhtml');
  drupal_add_js("$(document).ready(function() { initializeMenu(" . $modpath . ") } );", 'inline');

then change the .js code to something like this:

function initializeMenu(modpath) {
	$(".menubar").css("background-image", "url(/" + modpath + "/plus.gif)");
...
...
...
    $(this).css("background-image", "url(/" + modpath + "/minus.gif)");
...
    $(this).css("background-image", "url(/" + modpath + "/plus.gif)");

That's *roughly* what you need to do I think. I haven't got the time to test it. you may need to mess with the '/' at the end of 'url(/' and the start of the '/minus' and '/plus' to get it to work cos i don't know if these are passed or not.

Post back results :)

Ryanbach’s picture

I get the error "sites is not defined"

Here is the line it points to: "

$(document).ready(function() { initializeMenu(sites/all/modules/taxonomy_dhtml) } );

"

So I can't make the DHTML work correctly when I click but the images (all +'s) are there.

subspaceeddy’s picture

OK.

Again, without being able to try it myself, alter this line:

drupal_add_js("$(document).ready(function() { initializeMenu(" . $modpath . ") } );", 'inline');

to

drupal_add_js("$(document).ready(function() { initializeMenu('" . $modpath . "') } );", 'inline');

note the extra single quote before " in (" and after " in ") around the . $modpath . bit. This will pass the path as a string. Also indicated from the result is that the / in the css bit are needed.

Hope that makes sense.

I think that should work now, but let me know.

Ryanbach’s picture

Here is the patch (without the li element patch as it isn't working quite correctly yet...):

Someone ready to test it on HEAD? It should work.

Ryanbach’s picture

Thanks for the help sub, it indeed does work and above is the patch I made. I am pretty sure it will work.

mariagwyn’s picture

subscribing.

Is there a tar of this somewhere that does not require patching?
Thanks,
Maria

Ryanbach’s picture

meba’s picture

Hi, i got maintainership of this module today. I am creating 5.x branch and the release will be available ASAP. Thanks for the patches.

Ryanbach’s picture

Meba: That is good to hear, I considered doing it myself but I am not quite up to par as of yet.

meba’s picture

Status: Needs review » Needs work

5.x branch is created. But menuExpandable4.js and .css doesn't work with IE6/7.
Current development plan is:
5.x-1.0 release - 4.7 port with old javascript library
5.x-2.0 release - slight rewrite of the module - commit <li> patch, work on all critical bugs, IE7 compatibility and jQuery. wait for taxonomy_menu module maintainer and join both of the modules

meba’s picture

JavaScript file posted here doesn't work with IE6/7, because click event is hooked on .menubar. Therefore clicking a link to taxonomy/term/X in IE7 triggers this hook, because the link is a child of .menubar. Anybody knows a better solution?

mariagwyn’s picture

Category: bug » support

Ryanbach: you link says 'page not found.'

Meba: Thanks for taking this over. I looked around for for the 5.x branch, but I don't see it available for download anywhere (even in CVS). Is it somewhere that I can download and test?

Thanks,
Maria

meba’s picture

After some cooperation, we managed to make it work with IE7, but still IE6 is doing some crap. Subspaceeddy, can i publish your URL to allow some testing?

meba’s picture

Status: Needs work » Needs review

Please download 5.x-dev version files from CVS:
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/taxonomy_dhtm...

I need some testing. I will release 5.x "stable" version tomorrow.

Some notes:
- This is direct port of 4.7 version. No new features, no bugfixes (even it needs some)
- There is a little issue with IE6, you have to click on term names, not plus images.

After this release, 5.x-2.x will rise, including some bugfixes.

meba’s picture

Version: master » 5.x-1.1
Status: Needs review » Fixed
meba’s picture

Forgot to add info file :-) And due to my knowledge of CVS, i had to create 2.2 release, so more functionality and bugfixes will be in 3.0 :-)

Download here:
http://drupal.org/node/124654

meba’s picture

Status: Fixed » Closed (fixed)

Finally closing this. Thanks to all who have contributed, especially Rob Brown from Media Marjon.