Comments fields

For comments the keywords that produce fields in the custom layout are:


Field "name" %details-F_name%

Field "comment" %details-F_comment%

Field "rating" %details-F_rating%

Field "author" %details-F_author%



Using the last gives "Unknown asset (Id: #)"



In the asset listing format author appears to be the system user who created the item … either the logged in username or "public user"



I want to collect the email address of people posting comments but can't locate how to get a field for it.



What can I do? I am using matrix v3.16.10



Thanks

The author field is basically just showing you the user that created the asset, so use the created keywords instead for that. To capture an email address, just use a metadata schema applied to your asset builder, and specify one of the fields to be for an email address. And, if you upgrade to 3.18 you can make those metadata field required.

Thanks, but oh dear … that's WAY above my knowledge level and the Schemas manual hasn't helped much.


It is actually quite easy. Start by creating a new metadata schema, and add a section that includes one or two text fields. After you have created this, go to the details screen of your asset builder. There should be a section that asks to apply a metadata schema. Apply the one that you just created. Then, in your custom create form, add a new keyword to print your metadata field. The keyword is in the form of %metadata-F_999% so if the ID of the metadata field that you want to print is 1000 the keyword would be %metadata-F_1000% .

Let me know if you have any questions about this.

Good Luck.

Here is where you can find the info you are after in the manuals:

[list=1]

  • Create a Metadata Schema that has a section (Schemas manual - page 11) and a text field (Schemas manual - page 13) called Email.
    [*]On the Details screen of the Asset Builder page, select in the Metadata Schema in the Metadata Schemas to Apply field (Schemas manual - page 39)
    [*]Change the layout for the create form for the Asset Builder Page (Schemas manual - page 57)


    I hope this helps.
  • OK, I have a metadata schema called commentdata -> it has a section called emailandname -> with text fields name and email -> the schema is applied in the details screen of the asset builder (also tried in right-click of the asset builder) -> the layout of the Comment Create Form Layout is:


    Join the conversation



    all fields must be completed



    Screen Name (published with comment)

    %details-F_name%



    Your Name (will not be published)

    %metadata-F_name%



    Email address (will not be published)

    %metadata-F_email%



    Your comment

    %details-F_comment%



    %commit_button%



    -> result still doesn't have those fields (see www.scia.org.au/test_page_for_comments)



    Have I missed something? Oh, and by the way, how will the name and email data be stored and available with the comment?



    Thanks again.

    You need to use the metadata keyword that I described above, %metadata-F_999%. So that keyword would be used if your metadata text field id was 999. The keywords you used are to print the metadata, not print the metadata input field.


    Also, when the assets are created, the stored metadata can be viewed on the metadata screen of the created asset.

    Thanks nnhubbard. Worked a treat!!!


    No problem, glad to help!

    another question …


    in the trigger for the asset creation I am getting the assetID, the assetURL, and the commet using in the body of the email:



    %asset_assetid%

    %asset_url%

    %asset_attribute_comment%



    I have added:



    %metadata-F_name%

    %metadata-_email%



    to get the name and email entries but only the keywords are showing.



    Is it possible to get that metadata in the trigger email?

    Try %asset_metadata_name% and %asset_metadata_email%

    No, I tried those and also swapping the text to asset number with no result.


    Also tried asset numbers in the %metadata-F_ likewise.

    I honestly have not had good luck with printing metadata in a trigger email. I recently wanted to do that, and it never worked, so I just decided not to use it. Greg, is there suppose to be functionality that supports metadata keywords in trigger emails?

    I don't see any reason why it wouldn't work. It call's the same function to do the keyword replacements as all other parts of the code.


    Ok. In my situation I was sending a trigger email on an Asset Created event, and then emailing the details of that asset that was just created. An asset builder was used to create the asset and add the metadata, could Matrix possibly be trying to add the metadata AFTER the created event is triggered, therefore the trigger does not see any metadata on the newly created asset?

    And, if this is the case, is there any way around this?

    [quote]Ok. In my situation I was sending a trigger email on an Asset Created event, and then emailing the details of that asset that was just created. An asset builder was used to create the asset and add the metadata, could Matrix possibly be trying to add the metadata AFTER the created event is triggered, therefore the trigger does not see any metadata on the newly created asset?


    And, if this is the case, is there any way around this?[/quote]



    You are spot-on there. When an asset builder creates an asset, it fires before the attributes and metadata have been set. There is currently no way around this, although there is a feature requests in the tracker for it. I think we'd have to add another trigger event specifically for asset builders to get around this as we can't reorganise the way the core creates things.


    Well, I successfully get asset attributes to come through in the email, it is just the metadata that does not. What bug # is that? It would be a great new feature...

    http://bugs.matrix.squiz.net/view_bug.php?bug_id=3079

    Thanks for the above … now another thing …


    I have set the metadata fields as required but the comment is being created without them being filled in.



    The explanation of required below the dropdown is:



    If this field is Required, then either the value or any one of the value components must be set for an asset to be approved



    Should that be resulting in an error from the asset builder?

    [quote]Thanks for the above … now another thing …


    I have set the metadata fields as required but the comment is being created without them being filled in.



    The explanation of required below the dropdown is:



    If this field is Required, then either the value or any one of the value components must be set for an asset to be approved



    Should that be resulting in an error from the asset builder?[/quote]



    if you set those metadata fields to be required, you should not able to build the asset until they are filled in. Are you sure that there are no default values for those fields?