You would be best off using nodes in the content section for this information, as it is intended for use on the frontend of the site. That way you have full control of the information.
You could have a content picker on your blog post document type to select the Author node, or if you want to get fancy you could wire up an event handler for the ContentService_Created event and check the UmbracoContext.Current.Security.CurrentUser property to look up the appropriate content node.
He accesses the current Umbraco user in the aforementioned event to populate an Author field on the blog post nodes. That value is then used to lookup Author metadata for the front end.
Also FYI There is a User Picker datatype - if you have a User Picker property on your Author node, you could look up the correct node where its value equals the UmbracoContext.Current.Security.CurrentUser.Id in your ContentService_Created event.
Adding Extra Authorship/Creator Properties
Hi,
I want to add detailed author (creator) information to blog post templates.
Right now I can do things like
But I'd like to do things like:
My content creators are backoffice users, not members.
What's the recommended way to achieve accessing extra properties for my content creators?
Thanks in advance, Gary
You would be best off using nodes in the content section for this information, as it is intended for use on the frontend of the site. That way you have full control of the information.
You could have a content picker on your blog post document type to select the Author node, or if you want to get fancy you could wire up an event handler for the
ContentService_Created
event and check theUmbracoContext.Current.Security.CurrentUser
property to look up the appropriate content node.You should check out Shannon's Articulate blog package for inspiration:
https://github.com/Shazwazza/Articulate/
He accesses the current Umbraco user in the aforementioned event to populate an Author field on the blog post nodes. That value is then used to lookup Author metadata for the front end.
https://github.com/Shazwazza/Articulate/blob/7ee1e41e3cea38432cdc624ca8259a60a43501b2/src/Articulate/UmbracoEventHandler.cs
Also FYI There is a User Picker datatype - if you have a User Picker property on your Author node, you could look up the correct node where its value equals the
UmbracoContext.Current.Security.CurrentUser.Id
in yourContentService_Created
event.is working on a reply...