Try our conversational search powered by Generative AI!

Custom Tag Property/Dijit

Vote:
 

Episerver version - 11.11.2

Find - 13.0.5

I have created a custom content respository, this is working as expected.

What I want to do next is create a property in the CMS, similar to the categories property where I can tag different items in the content respository that looks something similar to this:

https://vuejsexamples.com/a-flexible-vue-js-2-input-tag-component/

I want to either be able to drag/drop items from the content respository into the control, and hopefully be able to support the ability to start typing and via Find it returns avaliable suggestions.

I cannot find any useful tips on the internet, can anyone help with this or at least outlining what needs to be done to accomplish this.

Thanks

#202656
Mar 28, 2019 15:00
Vote:
 

Hi Jacob,

What you want to do can definitely be done.

But, having said that, is there any reason to not just use a vanilla ContentArea? You could in theory just use an AllowedTypes attribute to restrict to your content type and then you get to take advantage of functionality like visitor group personalization without additional work. You'll probably also benefit from easier Episerver upgrades going forward, where you won't have to verify your custom property still works.

Admittedly, the search functionality wouldn't be exactly like you specified, but searching of the content for your custom content provider can be wired up in the CMS UI if you build a SearchProvider.

#202681
Mar 28, 2019 20:56
Vote:
 

Hi Jake,

Vanilla content area is probably the back up. The required solution is what we're trying to achieve really.

If it can definintly be done can you provide any information what steps need to be taken?

#202701
Mar 29, 2019 9:56
Vote:
 

I'll try and outline they stepsbut I there is a reasonable amount of work to do! 😃

  1. Create an autocomplete API
    You'll need some kind of autocomplete API, this will take a query string and return the custom content matching this as well as its ContentLink. If you're using Find you should utilize that (see, for example, the PrefixCaseInsensitive method here).
  2. Create the Dojo widget
    You may be able to utilize an existing widget as an example, but you'll probably need a fair amount of customization as you'll want to persist the ContentReferences (i.e. IList<ContentReference>) and not the string array. You'll need to hook this into your autocomplete API. You'll probably want to look into the epi-cms/contentediting/editors/ContentReferenceListEditor (also epi-cms/contentediting/ContentReferenceList and the model epi-cms/contentediting/editors/model/ContentReferenceListEditorModel). You may need to use the PermanentLinkHelper when the widget initializes to get the names of your content.
  3. Create an EditorDescriptor
    You need a UIHint so that you can indicate that an IList<ContentReference> should use your custom Dojo widget.

I'd take a look at the Geta Tags code, especially the controller, descriptor and widget (they use the tag-it jQuery UI plugin) although what they are achieving is much simpler than what you want to do. Between that and digging into the Episerver ContentReferenceListEditor you should be able to figure out an approach.

#202739
Mar 29, 2019 16:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.