add in ability for users to override nodes picked by similarterms?
| Project: | Similar By Terms |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
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.

#1
I 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
#2
Attached is a patch against 5.x-1.9. Please let me know what you think.
Thanks!
gwen
#3
I 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
#4
gwen,
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
#5
Found 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
#6
Ok 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
#7
opps wrong issue.
#8
Ok have done some clean up. No longer an all or nothing choice. Should be in the next release.
Thanks
Robert
#9
Fabulous, thanks for cleaning up code, Robert!
gwen
#10
Now 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
#11
I am going to pull from CVS as I am getting behind badly and can't get this to work under 6.
#12
This is still open and working on the update.
Thanks
Robert