I need some feedback here.
There is a whole block of code that I am pretty confident nobody is using because it does not seem to be documented.
I guess most people use this module and go to paths like ?q=directory and click to ?q=directory/xxx where xxx is the ID of the taxonomy term.
There is a whole block of code that caters for a special rendering for pages where the path is like ?q=directory/xxx/vid/yyy where xxx is the term ID, yyy is the vocabulary ID and 'vid' is simply the string 'vid'.
The arguments in the path are passed on to the function:
function directory_page($tid = null, $filter = null, $fid = null)
Now, you can try both with the actual $vid of the term and with any other integer. I.e. if $term 30 belongs to $vid 1, you try:
?q=directory/30/vid/1
and
?q=directory/30/vid/2
and simply:
?q=directory/30
See the difference in the way the things are displayed.
The listings where the 'vid' is set, is quite strange but I guess it can be useful is some very special cases where xx is not an integer, but a string, etc.
Am I right in guessing that nobody is actually using this feature?
Check also:
?q=directory/alpha
but then, what follows seems to be broken.
e.g. :
http://www.roadcarvin.com/directory/alpha
http://www.roadcarvin.com/directory/m
(the pages seems to be broken, too.
What gives??
We seem to be having a whole bunch of unreadable, undocumented code for some undocumented feature that nobody is using and that is broken anyway.
What do we do?
Do we remove the whole chunk of code and simplify the module?
Or do we fix and advertise the feature?
Comments
Comment #1
wim leersActually a client just requested this very feature: per-vocabulary directories. I'll try to come up with a patch that does this in a cleaner way.
Comment #2
beginner commentedWhat you're speaking about does not seem related to the current issue.
Can you open another issue, and explain what you want to implement?
I have been thinking about what you are proposing, and had some ideas, too: so we'd better coordinate our efforts so that your patch can be incorporated into the main release.
Do you use tagadelic.module? We can have a cloud per vocabulary (per chunk). I was thinking about doing something similar for directory.module.
Give here the link of the new issue, where we can follow up this discussion.
Comment #3
wim leersFast reply!
See this issue: http://drupal.org/node/147412
Comment #4
beginner commentedIt is unclear what the intentions of the original developer were with the code.
I am not sure he had the same thing in mind than you have.
@Wim: So, commenting on the original issue: what do you think? Do we roll a patch (either before or after your proposed patch) to get rid of all the code that doesn't seem to be used by anyone?
Comment #5
wim leers+200 :P
If you look at clean Drupal 5 code, it's so clean and elegant. But this is so difficult to understand. No offense to inactivist or the other developers, I guess that's just how Drupal has evolved, which is of course A Good Thing.
I'm working on the patch now.
Comment #6
mcurry commented@Wm:
No offense taken!
Just for the record, I didn't build this module - I needed the basic functionality, found this module in the 'orphaned' projects, and resurrected it (became the maintainer and created an official project page) after I made the minimal changes needed in order to make it work in Drupal 4.7 (it had been partially ported but was non-functional, and the original module developers seemed to have abandoned it - perhaps for good reasons.)
Anyway, after I did the initial port, my experience with the code is much the same as yours - the code is very dense, fragile, and needs 'refactoring' - frankly, my goal in taking over the maintainer role was to get this thing back into circulation and see what kind of response I get from the community - and up until recently (beginner, and now Wm!) it's been pretty underwhelming - not that much interest beyond the basic features - but perhaps that's due to the initial 4.7 version's low quality (as has been so aptly described beginner's recent issues and attempts to mitigate the worst of the problems.)
As I said before, the recent attention and offers to help are greatly appreciated, as there is a need for this kind of module in the community, I think.
Comment #7
beginner commentedGreat! :)
Neither Innactivist nor myself is the author of that code, so no offence taken anywhere :)
We don't know who was.
Innactivist salvaged the module from a sandbox and simply upgraded it for 4.7.
I dealt with the D5 upgrade.
There is a lot to take away!
Comment #8
beginner commentedI keep thinking about this issue.
What I hate the most about directory.module, is that it tries to replicate what taxonomy module is already doing.
Also, I just noticed this in the README.txt:
Well...
1) the "real beauty" has been broken for a long time (see everything above).
2) taxonomy.module can already do that, out of the box.
So, one day, we really should sit down and have a talk, man to man:
what is the specificity of directory.module?
What was it supposed to be at its inception?
How should it integrate with taxonomy.module?
How to prevent duplication of functionality (with taxonomy.module)?
I have been working hard for a while to clear every bug, so that we have a stable code base.
Currently, the only bug left in the queue (http://drupal.org/node/125587) talks about a display problem. I am reluctant to spend time on it, because I think this is the kind of functionality we could drop and use the corresponding functionality of taxonomy.module instead.
This is actually critical because the future directory of directory development depends on how we resolve those questions.
Comment #9
wim leersI agree that it's a complete mess.
I'm currently cleaning it up, to make "directory" use "directory/term" and "directory/vocabulary". I know that there are slightly more features in the latter two, but they're implemented in a crappy (developer perspective) and unusable (user perspective) way anyway. So I'm removing them.
At the same time, I'm cleaning up some code, and adding a new feature: to limit the results to a certain node type (this is the feature I'm being paid for to add). If I would try to apply that feature on the codebase, it'd just make the mess even messier and I would probably end up not understanding my own code anymore.
Any chance you could hop in on IRC to discuss this? IM/mail is fine too.
Comment #10
beginner commentedThanks for following up on this issue.
Before you rush to propose a patch that would remove plenty of code, wait we've (I've) decided what directory should be.
As hinted in #8, I am thinking to bring directory to the opposite direction.
What does directory/nnn (directory/term/nnn) do that taxonomy/term/nnn doesn't do better?
The node listing at directory/nnn is crappy at best. I want to remove THIS.
Directory.module should be what the name implies: a directory of terms. For each term, we can link to taxonomy/term/nnn.
People can then use taxonomy_block to add a block functionality, etc.
But the code we were about to remove should be restored instead. It once was functional. It shouldn't take much to fix it.
If we go this way, we have a nice directory.module that does something that no other module does. And directory.module should be made to work better with other taxonomy contrib modules, without replicating their functionality.
As for new features, don't mix them up with this issue. I won't commit any before this issue is resolved, anyway. I apologize if this contradicts your plans. :-/
I repeat the first question which is the most important at this stage: what does directory/nnn do that taxonomy/term/nnn doesn't do better?
Why should we keep this feature?
Comment #11
wim leerstaxonomy/term/nnn gives you teasers. Suppose 50 nodes are categorized under term nnn, that means 50 teasers, which can be described as "bad overview" at best. That's why directory/nnn is useful. I'm not saying it's high quality though.
Well, my client *needs* the "limit by content type" feature, so that's what I'm implementing. I sure hope you will accept the code, but it *is* pretty much refactored from top to bottom. If I had just added the content type feature, you wouldn't have accepted the patch, because it would make the code even more fuzzy and complex. So this is the best choice.
I've removed lots of leftovers (parameters that were no longer used, comments of the Drupal 4.7 age, etc.), refactored functions that did almost the same, separated the theming from the logic property (those theme_* functions contained a *lot* of logic!) and cleaned up the code in general.
It's not yet ready, but what I have, looks good. It only keeps the stuff that is *really* relevant to a "directory" module. I think (and sure hope) you are going to like it. The code "speaks" now: it looks again like Drupal code :) ;)
Comment #12
beginner commentedHow is directory/nnn useful? If you don't like the teaser listing of taxonomy, you can change the default presentation at the theming level, no?
Question to self: can we theme the taxonomy/term/nnn view separately from other teaser views, like on the front page?
The point here is the redundancy. With the current default, the user would browse the site this way:
1) go to /directory
2) click on term to /directory/nnn
3) click on teaser to /node/nnn
4) within node, click on taxonomy term to /taxonomy/term/nnn
5) now the user is confused because he came from one list of terms (directory) but eventually arrives to a different list (taxonomy).
This is confusing. One would expect the user to be able to go back to the directory from the node. But if the user is let back to the directory/nnn page when clicking on a term in the node, then we completely bypass taxonomy/term/nnn listings, which are still there, but unused. In that case, why not remove the directory/nnn listing and use the taxonomy listing instead: it can be themed if wanted.
This way, we don't have to change the default behavior of Drupal core too much (like changing a link to taxonomy/term/nnn to directory/nnn). I.e. less code, less maintenance, fewer bugs.
And we can make use of other taxonomy modules.
In short, you have not convinced me of the usefullness of the directory/nnn view.
Comment #13
beginner commentedAnother way to ask the same questions.
If it were completely up to you, how would you theme directory/nnn?
What would you put there so that 1) it looks good by default 2) it is functional (it works as a directory/index) ?
And how would you integrate the two (directory/nnn and taxonomy/term/nnn) so that it is not confusing for the end users?
Comment #14
wim leersYou've convinced me. directory/nnn (and directory/term/nnn for that matter) is (are) indeed exactly the same as taxonomy/term/nnn. If you don't like the output, theme it. Simple as that.
I will implement this in my refactored version.
Comment #15
wim leersThere's one UI glitch if you use taxonomy/term/nnn: the breadcrumbs. But that's not a real issue IMO, it is justifiable.
Comment #16
wim leersI just realized that using taxonomy/term/nnn is not possible due to the feature my client wants: filtering the results by content type. That's not supported by taxonomy/term/nnn, nor by the underlying function.
So I'll have to add this stuff again. Aside from that, everything was ready.
Comment #17
wim leersAnd I just noticed that taxonomy/term/nnn is NOT themable... boooooo at taxonomy.module!
Comment #18
beginner commentedIf you are serious about helping, please break your patch into manageable parts, starting with the obvious.
Remember I need to review and be able to make sense of your patch.
If you give me one large patch that mixes everything, features and all, it's as good as if you gave me nothing. I'll clean it my self ... but I'll do so when I find time.
First remove functionality which is obviously a duplicate. I want to test theming taxonomy/term/nnn, to see if we can do so without affecting teasers on the front page or in other listings, for example.
This is the first and most important step. We need to be able to tell people what they can do if they really want to restore the old behavior/look.
We'll need a legacy module, to redirect inbound traffic from directory/nnn to taxonomy/term/nnn.
Breadcrumbs? There is a way to manipulate them, even on a taxonomy/term page, no? This is the kind of thing we could do. Use taxonomy.module to the fullest extent, but adapt it a little to our needs for directory.
Comment #19
beginner commented#18 posted before reading #16 and #17.
For your client: why not having one vocabulary per node type? then the terms are automatically filtered by content type!
taxonomy/term/nnn not themable? Today that should be considered a bug. May changes have been made with theming functions for Drupal 6, so if it is not themable for D5, I am sure it is for D6. Or else, it can still be considered a bug in core.
Anyway, since this move is a fairly big departure from what people are used to have, another option is to make only cosmetic changes for the D5 module, and warn the users at the same time that in D6, things would look different.
You can still use a patched version of the module for your client for D5, and together we could make those profound changes in preparation for the first D6 release.
I need to check about the themability of taxonomy in D6.
Comment #20
beginner commentedhmmm.... following the trail...
/taxonomy/term/nnn is rendered by taxonomy_render_nodes() which calls node_view($node, $teaser =1), which in turn calls theme('node', $node, $teaser, $page);
So, if we want a different theming, we must go all the way through to node.tpl.php .
D6 seems to be the same as D5 in that respect.
So, if we want to do something, it must be done in node.tpl.php, probably checking for arg(0) and arg(1) to check if we are on a taxonomy/term page.
Comment #21
wim leersI can unfortunately not break this into smaller pieces, because it's a completely refactored module. Things are separeted much more clearly now though, so my hopes are good that you will accept it. I know this is not-done, but if the module's code was fairly clean, I wouldn't have to do it in the first place.
Legacy support is IMO not in order here. We're trying to clean things up, not to make things 100% backwards compatible. Few people use this module, and those who do will have to accept that their links are broken and that certain very inaccessible features will be gone. That's the same price you have to pay with every Drupal core update: no backwards compatibility.
Such a nasty way of theming (node.tpl.php and checking for arguments) is not acceptable IMO. And it's indeed a bug in core.
That's not acceptable. What's the point of taxonomy if you cannot apply the same vocabularies to multiple content types? Not to mention that his vocabulary consists of thousands of terms.
Comment #22
wim leersI posted my refactored version at http://drupal.org/node/161075.
Comment #23
beginner commentedCongratulations for completing your job for your client. It is however not relevant to this thread.
For a while, I thought you wanted to help.
For me, the next step would be to try to get a patch for core: see if we can get the 'bug' in taxonomy.module fixed.
The future of directory depends on that.
When I have time to prepare a patch, I'll provide a link to the core issue.
Comment #24
wim leersNo need to get sarcastic.
Please continue the discussion there.
Comment #25
wim leersNo need to get sarcastic.
Please continue the discussion there.
Comment #26
beginner commentedI certainly didn't mean to sound sarcastic. I apologize if I sounded so. I was just a bit discouraged.
I need to upgrade all my sites as per latest security release (D5.2) and I have other stuff to do, too. It may be a while before I can follow up on this issue.
Comment #27
zirafi commentedHi,
I would like to have a requirement in this module and not sure whether it will be considered.
I would assume directory module does have generally tree structure of categories where user can configure them. I would to have same categories and also content relation between Classified Ads and Directory.
For example, if i want to create a category called "Rental" either in real estate directory or Apartments directory, then users should be able to browse the Classified Ads posted under Rental category of Classifieds Modules.
Directory > Real Estate > Rental
Classifieds > Rental >
I'm not sure whether it is currently available, if not, i'm hoping this would be considered in further development.
Thanks,
Paradesi
Comment #28
venusrising commentedI would love to see this module updated to something that resembles the Moset Tree for Joomla. There is also a backend bulk upload feature along with related categories etc.
Comment #29
bric002 commentedI'm hoping that Directory continues to be developed and will eventually resemble a Yahoo style directory listing. This kind of directory listing is apparently hard to come by. Joomla seems to have one but I don't really want to switch to Joomla. I hope that Drupal can develop something that will rival phpmydirectory. Don't give up on Directory. I will wait patiently.
What is the latest stand on Directory?
Comment #30
beginner commentedThanks for the feedback. The main news is that the maintainer (me) is very busy (as is often the case with maintainers). Small, incremental patches are welcome.
It has never been question to ditch directory. Just to clarify what it does, do that well and nothing else.
Mentions of Moset Tree for Joomla and Yahoo directory is useless since I don't know what they look like, what they do, etc.
Comment #31
netentropy commentedI am looking in to helping out. People are very interested in this module. I think the alpha pager should be kept.
Directory has a very organized way to present all terms. It should just be that. showing the terms for that alphabet....it could work much like tagadelic with an alpha pager.
Comment #32
beginner commentedHi bjraines!
Small, incremental patches are welcome.
My first concern is to remove the duplication with taxonomy.module, if possible. Unfortunately, that may require a core patch.
If you want to work on this or another issue, create a new issue. Patches should only cover one issue at a time, otherwise it's nearly impossible to review them. Also, don't work on new features just yet: we need to clarify the scope of this module first.
I want the function of this module to be well defined, and to allow it work nicely with other core (taxonomy) and contrib modules so that there is no replication of effort between modules.
If you do produce some good patches, I will review them as promptly as I can, so that you're not wasting your time.
Thanks.
Comment #33
don@robertson.net.nz commentedHi - not too sure about all the options for posting. Just wanted a minor comment.
I have added the Directory module to my site - soon to be live - to list links to useful sites on the internet. The only nodes in the Directory are Janodes - a node type for internet links.
I like it because I want users to see a Description of the site - too many times I see lists of links with no description and no indication of what the site linked to is about.
Anyway - I have come to the Drupal site because I would like users to be able to rate the items in the directory.
I have installed Fivestar - and the ratings show up in the teaser but not in the Directory list - where I would like them too.
Reading this discussion has made me think I should use a Taxonomy module. In the past I have installed heaps of Taxonomy modules and additions and have still not been able to get what I want ... but then I have been using drupal a lot longer now :-)
Anyway - just my comments. I'll try to keep track of this conversation. Internet access is a bit limited where I am - so do not always keep up with this stuff.
And I am going to look into the 'undocumented features' :-) They look useful
Don
Comment #34
greg.harveySince feedback and comment is directed here...
First, I am about to use the Directory module as a starting point for a project I'm working on. It's a nice start, but at the moment the view it outputs is too simple for me. I'll try and do this with the wider community in mind, and perhaps I'll have a useful patch when I'm done. What I'm going to build is this:
- True "DMOZ"-style home page (search and tier one taxonomy items + teasers of tier two items)
- True "DMOZ"-style listing pages (e.g. click on a category and get the sub-category, listing it's sub-categories first and then all relevant nodes underneath that)
- An option to turn these views on and off
- Additional search forms for searching within a sub-category only
Regarding the future of this module, since Category is *not* being adopted (for now) by the Drupal core team, Taxonomy will be around for a few years to come. In the past I have ditched Taxonomy entirely because the Category module, combined with Views, makes directory creation much more flexible.
HOWEVER, it is not easy - Category is still a little shakey (in my experience) and building complex Views can be a skill in it's own right. Also (IMHO) the default taxonomy pages are not hugely flexible. Currently NO ONE makes an easy-to-use directory building module. Many other directory solutions to this use case involve doing large chunks of logic in the template layer, which is WRONG WRONG WRONG.
So I believe this module could actually become an important addition to Drupal given a bit more attention. It is nicely lined up to become the Directory module for Drupal. I will help where I can, starting with my work for this client. =)
Comment #35
greg.harveyPs - is this module still being maintained? Any thoughts on Drupal 6.x port?
Comment #36
greg.harveyAnother thought - what do you guys think about making the Directory module depend on Views, tearing out the query building functions and replacing them with provided views coded in to the module? I think I will do this anyway, as I don't see the sense in maintaining a query builder for node selection within a module, when that's essentially what Views is, but interested to hear what you think...
Comment #37
wim leersThis will module will probably become obsolete in Drupal 6 when Views 2 (which will be Drupal 6 only) is released: Views 2 is no longer limited to the node table as the base table.
Comment #38
greg.harveyReally? So you'll be able to make Taxonomy views? Wow. Still a few months away though... =(
Comment #39
greg.harveyARG! Double-post... =(
Comment #40
drewish commentedhesitant to believe that views2 will be the end all of node browsing... the one feature that sold me on directory is that it's a relatively simple hierarchical term browser. i needed a simple tool to find nodes in a deeply nested taxonomy... the core taxonomy module is useless for that and i don't think you'd be able to construct such a thing with views2 arguments but we'll see.
Comment #41
wim leersdrewish: then look at the code of this module and you won't like it anymore ;) At the very least, it will require a rewrite for D6, to be somewhat manageable.
Comment #42
greg.harveyThat's the truth! I am half way through a re-write using the Views module instead. The code in my version is now about 75% less by embedding exported views instead of re-writing all the presentation code, as the current module does. I'm not finished yet, but I intend to post my re-write for review when done. It will be for Drupal 5.x (D6 isn't ready yet, as far as I'm concerned, cos CCK and Views are still in alpha and beta states, respectively, so you'd be insane to deploy any site using those modules in a Production environment - and none of my sites DON'T use both those modules). I will probably do a D6 port of the same code at a later date. It's all a case of time and money (I'm doing the job for a paying client, so if he pays for it, I will build it - otherwise I don't have time).
Comment #43
venusrising commentedI have the Moset Code (I paid the $119.00 for then switched to Drupal from Joomla) if you are interested in looking at it. It was a real nice directory.
http://www.mosets.com/tree/
This is a real important module and we really need this for Drupal.
Comment #44
himagarwal commentedIs directory module working?
Comment #45
drewish commentedhimagarwal, don't hijack issues. if you're having a problem with the module open a new support request.
Comment #46
netentropy commentedI am rewriting something basic for a taxonomy directory based off joomla's alpha content
it shouldn't be hard to customize to show the nodes like mosets
this is very basic, i should be done by the end of the month.
Comment #47
venusrising commentedbjraines
That would be awesome! Moset Tree was great on Joomla so this will be a great addition for the Directory module.
Comment #48
niklp commented@ #37, #40
Does someone want to give a brief explanation of how #40 can be achieved using #37? I have to do this real soon and I have no idea how it works/might work...
Comment #49
netentropy commentedcould you give me a better idea of what you want
I am currently writing a very simple taxonomy directory. one that works the way I wish Views did.
however i am keeping the structure in mind to write a node directory as well as a different node based glossary.
Comment #50
niklp commentedWim is basically convinced that this can be achieved with Views 2 and a style plugin(?) as I have spoken to him on several occasion about this.
Basically, for me, I want something similar to the Mosets thing, but of course it would be nice to have some contextual information in there as well (not sure what) which Panels 2 can provide (admittedly not yet) and perhaps also V2 can?
Comment #51
wim leersNikLP: Basically what you want to do is:
- in Views 2, you can set a different base table than the node table. This allows you to do listings of users, taxonomy terms, comments, whatever, instead of nodes. Since you want a taxonomy term listing, you'd join against taxonomy's table.
- In order to present this information in a way like the Directory module does, you'll need a Views style plugin that does this. In Views 2, this has changed a lot; it became much more advanced. You'll have to consult the Views 2 documentation to find out how to do this.
Comment #52
niklp commentedI'm personally terrified of this, but... bounty, anyone?
Comment #53
beginner commentedRe #20 ( http://drupal.org/node/144743#comment-556661 )
where it was noted that the taxonomy listing was not themable.
It so happens that a few months later, a patch was committed in core so that now, taxonomy listing IS themeable with D6. See #180719: Display term description on pages - CHANGELOG.txt.
It's a shame I didn't notice it earlier.
It seems we can now go ahead and rely on taxonomy theming and rip that part of the code in D6 directory.module.
Comment #54
venusrising commentedThat makes two of us that are terrified lol
Comment #55
beginner commenteddirectory.module no longer handle the display of node teasers.
See the new D6 alpha release announcement:
http://drupal.org/node/283259
I leave this issue open only because there are a few tidbits of information that I would like to review.
Comment #56
wim leersI want this out of my list of issues.