Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Drew 165 posts 340 karma points
    Jul 29, 2011 @ 12:36
    Drew
    0

    Tags FieldAdaptor?

    I've got a data source (CSV). 
    Everything imports fine apart form the tags, which are represented in a comma seperated value field wrapped in quotes, like so:    "tag1, tag2, tag3"

    These need to map to a Tags property on my doctype, which uses the Tags data type (the out-of-the-box one, from Umbraco 4.7).

    I realise that I can use a custom FieldAdaptor to handle this and the GetOrCreatePrevalue method to simply call: umbraco.editorControls.tags.library.addTagsToNode() which will manage the creation of a new tag if necessary. 

    The question is, GetOrCreatePrevalue expects an Int to be returned. What should I return? 

    The reason being that, I assume the Int from GetOrCreatePrevalue is then used by the library. In the sample FieldAdapter it's a single int, which would represent the propertyId value of a colour such as 'red' (e.g. 66).

    But in this case, it's a collection of propertyId's - one for each Tag....?

    Alternatively, is there already a Tag FieldAdaptor anyone's done that I could have a look at please? :)

     

    Cheers

    -Drew

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Aug 01, 2011 @ 05:27
    Richard Soeteman
    0

    Hi Drew,

    What is it exactly that isn't working? The tags datatype is supported by default just ran a test myself and tags got imported.It could be that the issue is related to csv, since that uses the , as the field delimiter by default.

    Hope this already makes sense, otherwise I would love to help you with this issue since it should work out of the box.

    Cheers,

    Richard

     

  • Drew 165 posts 340 karma points
    Aug 01, 2011 @ 13:26
    Drew
    0

    Hi Richard,

    My bad! It's actually using the OpenCalaisAutoTag custom data type.
    Simple solution is to switch it back to the standard Tags data type, do the import with the amazing CMS Import, then switch it back :)

    D'oh!

     

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Aug 01, 2011 @ 20:39
    Richard Soeteman
    1

    Hi Drew,

    Hmm don't know if that will work since Tags are stored in a seperate table don;t know if the OpenCalaisAutoTag uses the same table?

    If so it should work as described and if yoiu give me the GUID of the datatype I can make it work out of the box for you (and others in the next release).

    Thanks,

    Richard

  • Drew 165 posts 340 karma points
    Aug 02, 2011 @ 10:09
    Drew
    0

    Hi Richard,

     

    Yes it uses the same tables as the standard tagging in Umbraco. The only addition it makes is that it renders the tag editor differently and you an plug-in a tag-suggestion service.
    But the data is stored in the same way.
    (which is why I can switch the property datatype to 'Tags', use CMS import and then change it back to OpenAutoCalais and it all works fine :) ) 

    The GUID is:
    d15e1281-e456-4b24-aa86-1dda3e4299d5

    Cheers! 

  • Laurentiu 7 posts 27 karma points
    Oct 12, 2012 @ 20:58
    Laurentiu
    0

    The Tags data type is used with a specific "group". I just created another data type called Product.Colors using the same Tag back-end data as Tags and getting this error:

    Error while importing data for property 'color' :Object reference not set to an instance of an object. 

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Oct 13, 2012 @ 06:20
    Richard Soeteman
    0

    Just checked,

    It checks the prevalues of the datatype. Are you using the default tag datatype? Can you post a screenshot of the configuration and which version of Umbraco are you using?

    Cheers,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft