This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Extensions » User Keyword/Tags
expandshrink

User Keyword/Tags

User Keyword/Tags

Thursday 05 January 2012 12:33:17 am - 8 replies

I am looking for a way to let front end users add keywords/tags to the articles they are reading. Looking in the projects I came across eZ Tags and was wondering if anybody has used it like this. eZ Tags provides a great way to manage all the tags so it is definitely the route I would prefer to pursue but before doing so I was wondering if anybody else has done this, or knows what I would have to change in eZ Tags to make this possible.

Thursday 05 January 2012 6:23:38 am

We don't use eZ Tags on this site, but we do have the functionality you're describing:

http://canadianbookshelf.com/Books/W/Water-For-Elephants

We wrote our own module view, called via Ajax, to add user tags. It simply updates the Tags attribute via the fromString method.

Thursday 05 January 2012 9:58:58 am

Hi Tyler,

yes, it's certainly possible to achieve that kind of functionality with eZ Tags, however, not out of the box. I've modified eZ Tags datatype edit template for couple of projects to achieve exactly this. Since I'm the author of eZ Tags, I also considered including said modifications as a feature, but never got around to it.

Do you think that something like this would be useful to include in the extension? For now, I can share my modifications to datatype edit template if you want.

I have to warn you, letting users adding tags at will, will build up the number of tags pretty quickly unless you actively manage enetered tags through admin interface (merging duplicates, placing them in the tree structure where they belong and so on.). If left unmanaged, tags tree in the admin side of eZ Tags could slow down if there are many tags (thousands) under one parent. This is tackled in new version (2.0) of eZ Tags that should be out in a month or so. It limits the number of tags displayed under a single parent, as well as introduces the YUI counterpart of tag child listing.

Thursday 05 January 2012 3:48:43 pm

Thanks for the quick replies! Edi, I think it would be great if this functionality was added to eZ Tags, but only as a controlled options, and turned off by default. You are right that they can become quickly out of control, adding an attribute to the tag to describe where it was created might also be helpful. Our site will be actively moderated and only logged in users will have this functionality anyway. Your modifications would be great! I can so far get the tag to be added, but it doesn't get a location when it is added on the frontend, it would be nice to see how you did it. Thanks! 

Friday 06 January 2012 5:10:24 pm

Hello Tyler,

here are the modifications necessary to achieve desired functionality:

https://gist.github.com/1571177

Besides replacing the files in question, you need to choose the placement of tags by selecting one of the tags in "Limit by tags subtree" option in datatype class edit interface. If you do not select a tag, entered tags will simply be placed under the root.

Let me know if you managed to get it working happy.gif Emoticon

EDIT: This hack ofcourse enables this functionality on all eztags attributes, so I would suggest to enable it only on your frontend, that is, put the files only in your custom frontend design, instead of "standard", so you don't accidentally apply it in the admin interface.

Modified on Friday 06 January 2012 5:13:36 pm by Edi Modrić

Friday 06 January 2012 8:47:25 pm

Thanks Edi! I still can't get me keywords added on the front end to stick. What is your form's action when you get this to work?

Friday 06 January 2012 9:59:14 pm

Thanks Edi! I still can't get me keywords added on the front end to stick. What is your form's action when you get this to work?

It's a classic /content/edit/xyz form.

Maybe I missunderstood you. You need a custom implementation to adding tags and not content/edit interface?

In that case, I would suggest a custom eZ JSCore handler that attaches tags to objects. It shouldn't be that hard to implement, you need to create and store two PHP objects (eZPersistentObject implementations), eZTagsObject and eZTagsAttributeLink for each tag you wish to add.

Monday 09 January 2012 6:48:50 pm

Thanks for all your help Edi! We got this working with a custom ezjscore call. I based my custom tag add file off of your add.php module file, with the addition of the eZTagsAttributeLinkObject to the mix. All is now working well!

Monday 09 January 2012 8:00:02 pm

Good to hear that! happy.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from