Tagged: private tags, taxonomy, user
- This topic has 6 replies, 2 voices, and was last updated 7 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
November 25, 2014 at 8:25 pm #2853
byronyasgurMemberI have done a fair bit of searching and I haven’t found any simple way with any existing technology to have a separate set of terms for each user ( ie where the user owned their own terms … so that they could return their own queries based on their own personal categorization of the blog’s content) … I do have an idea of how this could be done and I’m going to start that experiment soon but I thought first I’d ask to see if I’m missing something and maybe Piklist can do it, or help.
Example of operation
- There are 3 posts in the blog and 2 users.
- The first user tags Post 1 and 2 as “foo” and Post 3 as “bar”
- The second user tags Post 2 and 3 as “baz” and post 1 as “qux”
… so that User 1’s tags are completely autonomous from User 2.
Example of use
My email program (Thunderbird) lets me tag emails according to my own workflow. I’m not going to use this in a regular blog but I can imagine a scenario where a a large blog with data heavy content might let it’s users categorise it’s content based on their own prefs … a sort of bookmarking system.If you have any thoughts I’d be grateful to hear them.
NB I don’t think User Taxonomies would help as they seem to be just a way of categorising users, unless I’m missing something.
-
November 26, 2014 at 11:10 am #2858
SteveKeymasterWelcome to our community!
This is a pretty awesome idea, and of course you can do this with Piklist! The code shown below will create a different taxonomy for each logged in user. User #1 will use the taxonomy ‘personal_tags_1’, and User #2 will use the taxonomy ‘personal_tags_2’
add_filter('piklist_taxonomies', 'my_custom_taxonomies'); function my_custom_taxonomies($taxonomies) { global $current_user; get_currentuserinfo(); // Get logged in user info $taxonomies[] = array( 'post_type' => array('post') ,'name' => 'personal_tags_' . $current_user->ID // Append User ID to taxonomy name ,'configuration' => array( 'hierarchical' => false ,'labels' => piklist('taxonomy_labels', $current_user->display_name . "'s Tag") // Append user name to Taxonomy labels ,'show_ui' => true ,'query_var' => true ,'rewrite' => array( 'slug' => 'personal_tags_' . $current_user->ID // Append user ID to taxonomy slug ) ,'show_admin_column' => true ,'comments' => true ) ); return $taxonomies; }Let us know if this works for you
-
November 26, 2014 at 11:28 am #2859
byronyasgurMemberWow … that looks like it might do the trick. I’m swamped in client work right now but I can’t wait to try this. I’ll report my results here in case it’s of use to anyone in the future. Thanks
-
November 26, 2014 at 11:34 am #2860
SteveKeymasterThis was such an awesome idea I created a tutorial with screenshots >
Let us know if you need any more help.
-
November 26, 2014 at 11:36 am #2861
byronyasgurMemberWow … thanks … am flattered … had a quick look … maybe try it out at weekend
-
November 28, 2014 at 9:13 am #2867
byronyasgurMemberHad a go … it worked perfectly, thanks. I used get_terms() to get the values out. What would you say about scalability. Every user will have a personal_tags_* entry in the term_taxonomy table I’m no database expert but I suppose there’s no issue with this?
-
November 28, 2014 at 10:06 am #2869
SteveKeymasterGlad it worked. Scalability shouldn’t be an issue.
-
-
AuthorPosts
- You must be logged in to reply to this topic.