How to select a Tag via an Asset Builder form

Is it possible in Matrix 3.22 to include a field in an Asset Builder form to allow somebody to select a Tag and associate it with the asset being created, i.e. add a Tag to the asset's Tagging screen?


I'm setting up a bunch of Calendar pages at the moment, and in association with them I'm developing an Asset Builder form that will let a user enter details for a Single Calendar Event to be displayed on the calendars. The form includes fields for the event's 'native' data fields (Name, Description, Start and End Dates/Times) plus a bunch of associated Metadata Fields (Contact details, Address, Bookings information, Dress requirements, etc.). All these are pretty straightforward to include in the form and are not causing me any trouble.



I'm also setting up a Related Asset Listing and embedding it on my Event pages (the calendar pages are configured so that the individual events are shown at their own URLs). The idea is that the nested Related Asset Listing will display details for other events that share the same Tag as the event being displayed on the page. I've set up a Thesaurus of terms for the Tags, and it seems to work pretty well.



However, I can't figure out how to create and display a field in the Asset Builder form that will let somebody select a Tag and associate it with the event they're creating. I don't know what the appropriate keyword would be, or indeed if any such keyword exists - can't find anything in the manuals.



It would of course be possible to just add Tags manually to each event via the asset map - but that 's not something I want our staff to be doing anyway, as it would entail them having to log into the administration interface unnecessarily.



So, can anybody enlighten me as to whether or not it's possible to set a Tag for a calendar event via an Asset Builder form? And if so, how (e.g. what keyword to use)?



(I might add that I've also tried setting a metadata field in my schema as a way of accessing Tags, but it doesn't seem to work either.)



Many thanks for any assistance.

Tags work off inheritance, which means any child asset you create automatically picks up the tags that it's parent asset has. We've used this to advantage in similar situations by creating a series of folders (tagged and named appropriately) and then using the create location options in the asset builder to allow the user to select which 'tag' they want to apply. Behind the scenes they are really actually picking one of the folders as a create location and the new event would get the tags of it's parent asset.


The limitation of this method is that you can't easily apply multiple tags, and you have to think about where you want the asset to eventually end up, but you can use triggers to move it after it is created.

[quote]
Tags work off inheritance, which means any child asset you create automatically picks up the tags that its parent asset has. We've used this to advantage in similar situations by creating a series of folders (tagged and named appropriately) and then using the create location options in the asset builder to allow the user to select which 'tag' they want to apply. Behind the scenes they are really actually picking one of the folders as a create location and the new event would get the tags of its parent asset.



The limitation of this method is that you can't easily apply multiple tags, and you have to think about where you want the asset to eventually end up, but you can use triggers to move it after it is created.

[/quote]



Thanks for this, Anthony. Sounds well worth investigating! This could be precisely the solution I need, so I'll have a go at it and see what I end up with.



Fortunately we're not planning to apply multiple tags to calendar events at present so that probably won't be an issue. Although we may well do so in the future - but, one problem at a time, I reckon…



Thanks again.

There is a way you could do this but it does end up being rather tricky.


Instead of using the tagging functionality within matrix use a metadata field and set it to the thesaurus you're currently using for tagging.

Instead of using a related asset listing you would use a pre-stored search which uses the metadata "tags" currently applied to the page the user is on.



Now here comes the tricky part.



Tag terms cant be asset listed so what you need to do is create a DB query that would let you grab the appropriate terms from the matrix tables. Something along the lines of SELECT * from sq_thes_term WHERE thesid LIKE 'INSERT THESAURUS ID HERE';



Use an asset listing to list the Data source records sets in a readable format and then nest this listing into your asset builder.



You'll need to replicate the functionality in the admin interface metadata screen which means inserting a few hidden fields into the builder and then populating them as the user enters terms, but you'd need to write some script to do this part. Maybe something like asset listing the terms as checkboxes and then when the form is submitted create the appropriate number of hidden metadata fields and populate them with the checked information.



So yeah this is achievable, will let you do multiple tagging and do some search related customising but it is a more complex. Youll also be forced to use a non-heirarchy thesaurus and youll lose the ability to weight your tags if you use metadata.