add in ability for users to override nodes picked by similarterms?

gwen - August 19, 2008 - 20:36
Project:Similar By Terms
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:patch (to be ported)
Description

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

rmiddle - August 19, 2008 - 21:06

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

gwen - August 23, 2008 - 01:49
Status:active» needs review

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

Thanks!

gwen

AttachmentSize
similarterms.patch 12.54 KB

#3

rmiddle - August 23, 2008 - 02:31

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

rmiddle - August 24, 2008 - 00:43
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

#5

rmiddle - August 24, 2008 - 03:07

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

rmiddle - August 24, 2008 - 03:38

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

rmiddle - August 24, 2008 - 16:56

opps wrong issue.

#8

rmiddle - August 24, 2008 - 17:28
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

#9

gwen - August 25, 2008 - 18:02

Fabulous, thanks for cleaning up code, Robert!

gwen

#10

rmiddle - September 24, 2008 - 20:22

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

rmiddle - December 6, 2008 - 01:43
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.

#12

rmiddle - January 29, 2009 - 20:47

This is still open and working on the update.

Thanks
Robert

 
 

Drupal is a registered trademark of Dries Buytaert.