How to manage Tags field in user profile?

Posted by Community Admin on 04-Aug-2018 09:03

How to manage Tags field in user profile?

All Replies

Posted by Community Admin on 04-Mar-2016 00:00

Hello all,

For a project i'm working on, I have added the classification "Tags" to the Sitefinity userprofile. So now i'm able to add and remove tags per user in the back-end of Sitefinity.  I would like to do this on the front-end. 

The following page gives instructions for "normal" content items, docs.sitefinity.com/add-and-remove-taxonomies-remove-a-taxon-from-the-associated-content-item. But not for users. 

Does anyone know how to be able to add and remove Tags from users?

Thanks!

Regards,

Menderes Demir

Posted by Community Admin on 08-Mar-2016 00:00

Hi Menderes,

Please refer to the below KB article for more details about customizing the User Profile widget template and allow users to edit their profiles and update the desired custom fields from the frontend:

http://www.sitefinity.com/developer-network/knowledge-base/details/how-to-customize-the-userprofile-widget-edit-mode-templates-using-out-of-the-box-fieldcontrols

In the above KB you will find a link to the blog post where this is described in details: http://www.sitefinity.com/blogs/boyan-barnevs-blog-/2014/11/26/how-to-customize-the-userprofile-widget-templates

I used the below markup for the HierarchicalTaxonField as it is shown in the blog post without changing any of the properties. This allows me to edit categories:

<sf:HierarchicalTaxonField ID="Category" DataFieldName="Category" DisplayMode="Write" runat="server" TaxonomyMetafieldName="Category" TaxonomyId="e5cd6d69-1543-427b-ad62-688a99f5e7d4" WebServiceUrl="~/Sitefinity/Services/Taxonomies/HierarchicalTaxon.svc" AllowMultipleSelection="true" Expanded="false" ExpandText="Click to add categories" BindOnServer="true" />

Here is the sample markup I used for the FlatTaxonField which allow me to edit tags:

<sf:FlatTaxonField ID="Tags" DataFieldName="Tags" LayoutTemplatePath="~/SFRes/Telerik.Sitefinity.Resources.Templates.Fields.FlatTaxonField.ascx" DisplayMode="Write" runat="server" TaxonomyMetafieldName="Tags" TaxonomyId="cb0f3a19-a211-48a7-88ec-77495c0f5374" WebServiceUrl="~/Sitefinity/Services/Taxonomies/FlatTaxon.svc" AllowMultipleSelection="true" Expanded="false" ExpandText="Click to add tags" BindOnServer="true" />

I am also sending attached a short video for your convenience demonstrating the results after implementing the sample from the blog post.

Regards,
Sabrie Nedzhip
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 08-Mar-2016 00:00

Hi Sabrie,

Thank you for your reply! I forgot to mention, the project is based on pure MVC. How can I implement this in the MVC user detail template?

Regards,

Menderes Demir

Posted by Community Admin on 11-Mar-2016 00:00

Hello Menderes,

In the MVC view of the profile widget you can access classification fields using the below sample which will return a TrackedList of Guids - the ids of the taxa. Here is an example for Tags:

@Model.SelectedUserProfiles[0].Fields.Tags as Telerik.OpenAccess.TrackedList<Guid>

Then you will be able to display the tags in the view by their ids.

Here is how you can get the Tags count:

@
         var tags = Model.SelectedUserProfiles[0].Fields.Tags as Telerik.OpenAccess.TrackedList<Guid>;
         var tagsCount = tags.Count();
           
     


Regards,
Sabrie Nedzhip
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 11-Mar-2016 00:00

Hi Sabrie,

Thank you for your reply. Getting tags from the (current) user was not the issue. Like my first post, I would like to be able to manage tags of a user.

So being able to add and delete tags from a user on the front-end, without the need of being logged in the back-end of Sitefinity.

With kind regards,

Menderes Demir

Posted by Community Admin on 16-Mar-2016 00:00

Hello Menderes,

Please review the below documentation article related to the Profile widget configurations and check step 3 from the Advanced configuration section where you can find more details on how to make the custom fields editable:

http://docs.sitefinity.com/feather-profile-widget

Regards,
Sabrie Nedzhip
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 25-Mar-2016 00:00

Hi Sabrie,

Thank you for your reply. I have followed the instructions on the given page. It looks like it's based on regular fields. 

I need to add an editable Tags field. Could you explain me how to add that kind of field?

Thank you.

With kind regards,
Menderes Demir

Posted by Community Admin on 22-Jun-2017 00:00

Don't suppose anyone can shed light on how to perform this?

I want to avoid writing a custom profile edit widget.

 

This thread is closed