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.

CommentFileSizeAuthor
#2 similarterms.patch12.54 KBgwen

Comments

rmiddle’s picture

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

gwen’s picture

Status: Active » Needs review
StatusFileSize
new12.54 KB

Attached is a patch against 5.x-1.9. Please let me know what you think.

Thanks!

gwen

rmiddle’s picture

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

rmiddle’s picture

Status: Needs review » Needs work

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

rmiddle’s picture

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

rmiddle’s picture

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

rmiddle’s picture

opps wrong issue.

rmiddle’s picture

Status: Needs work » Patch (to be ported)

Ok have done some clean up. No longer an all or nothing choice. Should be in the next release.

Thanks
Robert

gwen’s picture

Fabulous, thanks for cleaning up code, Robert!

gwen

rmiddle’s picture

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

rmiddle’s picture

Version: 5.x-1.9 » 5.x-1.x-dev

I am going to pull from CVS as I am getting behind badly and can't get this to work under 6.

rmiddle’s picture

This is still open and working on the update.

Thanks
Robert

rmiddle’s picture

Status: Patch (to be ported) » Closed (won't fix)

No Longer relevant.

Closing as wont fix.

Thanks
Robert