I have a client who requires the ability to override the nodes that are picked automatically by on a node by node basis. I've been modifying similarterms (great module, btw) and can submit a patch when the work is done. Before I go to the trouble of genericizing, I wanted to see if it was even of interest to others. Basically, I added a hook_form_alter() to add some extra fields to the the node forms where users can enter links to other pages on the site. The data is populated into a db table and when the block is viewed, there's a check to see if any overrides are defined. If so, the block lists the overrides; if not, it uses the ones normally generated.
If this sounds like a useful feature to integrate, let me know and I'm happy to contribute the patch when it's done. I haven't gotten around to doing any drupal 6.x yet, so the patch will just be for 5.x.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | similarterms.patch | 12.54 KB | gwen |
Comments
Comment #1
rmiddle commentedI would certainly look at the patch. I am personally very open to add on as long as there is an option/override and what is does it pretty clear cut.
Thanks
Robert
Comment #2
gwen commentedAttached is a patch against 5.x-1.9. Please let me know what you think.
Thanks!
gwen
Comment #3
rmiddle commentedI am looking at it. This is 1 hell of a patch. Not sure why you are doing a few things but I am testing. If it works well I will include and port.
Thanks
Robert
Comment #4
rmiddle commentedgwen,
Something seems to be wrong with the hook_form_alter. Maybe I am looking at the wrong place but nothing seems to be pulling up that form.
Thanks
Robert
Comment #5
rmiddle commentedFound the issue. If you don't go into the block configuration and set simterms_sametype_vid then this variable_get('simterms_sametype_'. $v->vid, array()); just returns a blank array were every were else is the code it assumes none. That needs to be fixed.
Thanks
Robert
Comment #6
rmiddle commentedOk it is fixed and working in my test environment. It is a cool enough option I think I will work it into the module. Needs a little work to make it an option. Right now it is on by default.
Thanks
Robert
Comment #7
rmiddle commentedopps wrong issue.
Comment #8
rmiddle commentedOk have done some clean up. No longer an all or nothing choice. Should be in the next release.
Thanks
Robert
Comment #9
gwen commentedFabulous, thanks for cleaning up code, Robert!
gwen
Comment #10
rmiddle commentedNow if I could figuire out why this line breaks in 6 but works fine in 5 I would be golden.
foreach ($alias['similarterms_paths'] as $id => $path) {
Thanks
Robert
Comment #11
rmiddle commentedI am going to pull from CVS as I am getting behind badly and can't get this to work under 6.
Comment #12
rmiddle commentedThis is still open and working on the update.
Thanks
Robert
Comment #13
rmiddle commentedNo Longer relevant.
Closing as wont fix.
Thanks
Robert