Note this may be related to issue 652152 but it was already marked won't fix so I wasn't sure it was appropriate to attach it there.

Attached is the beginning of some code that will allow nodeword data related to a node to be output as a view field. It may be feasible to extend this to allow for finding nodes without a particular type of meta tag.

I wanted to get feedback on whether building this type of integration with views is deemed valuable before continuing further.

To install, unpack the attached file in the nodewords module directory and add the following to nodewords.module:

function nodewords_views_api() {
return array('api' => 2.0);
}

Once installed clear your views cache and you should see a Nodewords group available when adding fields to a view. Currently it will only print the value of the nodeword but it should be possible to print the actual meta tag output.

Files: 
CommentFileSizeAuthor
#4 nodwords-views.tgz1.55 KBtekante
nodewords-views.tgz664 bytestekante

Comments

Anonymous’s picture

Status: Active » Closed (duplicate)

This feature request is actually a duplicate of #652152: Integration with Views; the explanation of why it's not possible to integrate with Views is explained in that issue.

tekante’s picture

I believe the information in #652152 is incorrect. If I understand the nodewords table correctly the content for a nodeword entry for an object can be obtained using:

select content from nodewords join TABLE_FOR_OBJECT on id = OBJECT_ID_COLUMN and type = TYPE_ID_FOR_OBJECT and name = 'desired_nodeword_entry';

Views is able to handle this type of relationship in several ways from the extra element in the join definition for the table or by defining a custom relationship handler.

Do I misunderstand the nodewords table structure?

Anonymous’s picture

AFAIK, when you describe the relationship between the database table used by the module, and core tables it is not possible to say that the table is related with the table user, or the table node, which what happen to the table node that can contains meta tags associated with a node, or a user profile (or neither of them).

tekante’s picture

FileSize
1.55 KB

Attached is some code that demonstrates the ability to pull in the content from the nodewords content column as a field for node or user based views. It also has the beginnings of the ability to pull in the content via a relationship though it has a bug at the moment in that you can't specify to use the relationship when picking a field.

To use unpack in the nodewords directory and define

function nodewords_views_api() {
return array('api' => 2.0);
}

in nodewords.module.

After doing so and clearing the views cache you should see the Nodewords group when choosing Fields for any node or user based views. It should list all meta tags available at the time the views cache was cleared and the output should be the raw string from the value array. From there you will be able to see the SQL generated and let me know if I am joining to the nodewords table incorrectly.

Anonymous’s picture

Status: Closed (duplicate) » Needs review
kiamlaluno’s picture

Component: Code » Third-party modules integration
DamienMcKenna’s picture

Will review this for inclusion after the v6.x-1.12 release.

DamienMcKenna’s picture

Tagging.

Dave Reid’s picture

Marked #912430: How to get a list of metatags by node? as a duplicate of this issue

iantresman’s picture

I was also hoping that the Views fields would let me select Nodeword meta fields. I assumed that since my nodes each have their own optional nodeword meta field, then it would be possible to access them.

DamienMcKenna’s picture

De-tagging, will review priorities after the next stable release.

DamienMcKenna’s picture

Status: Needs review » Needs work

Will need to be re-rolled at the very least. Also, a proper patch file should be provided.

richH’s picture

Hi guys,

does anyone know if this change made it into one of the latest releases?

thanks for all the work
Rich

DamienMcKenna’s picture

It didn't, I might see if I can take a look prior to 1.14, otherwise it'll be 1.15.

DamienMcKenna’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Unless someone specifically needs this and wants to roll a patch compatible with the current v1 codebase, i'm bumping this to v2.

DamienMcKenna’s picture

Status: Needs work » Postponed

Marking all v2 issues as postponed while v1 is finished off.

DamienMcKenna’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Postponed » Active

Re-opening it, a proper patch would need to be built of the code from #4 above and then possibly do some work to make it work correctly.