MODX: How to retrieve name of user who created resource? - modx

I am using getResources to display blog entries. For each entry I want to display the name of the user who created the resource.
I can retrieve their ID using placeholder [[+createdby]] but I don't know how to get their name.
Does anyone know how to do this?

There is a MODX Revolution output filter called userinfo that you can user on your placeholder like this:
[[+createdby:userinfo=`fullname`]]
Find out more about and other output filters here in the docs: MODX Input and Output Filters

Related

Using Graph API to query SharePoint list items and expand user field

I'm trying to query for some SP list items, all is working fine except I can't seem to expand a custom column of type Person.
I can see the createdBy and lastModifiedBy expanded and even includes the AAD user id, which is great and also leads me to think what I want is possible!
But mine is a custom column.
I'm running this and can only seem to get the SP user list id and the user's display name...neither of which are much use.
/items?expand=fields(select=UserLookupId,User)
Ideally I'd like to get the AAD user id as per createdBy and modifiedBy field, but the email would suffice.
Otherwise the only way I can see is to query the User Information List (using the UserLookupId) to get the email?
Thanks
This appears to be correct assumption:
Otherwise the only way I can see is to query the User Information List
(using the UserLookupId) to get the email?
for non-system user fields, it is indeed a way to go, but there are some distinctions whether user field is multi-valued or single-valued.
If Approvers is a multi-valued user field, then the following query:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approvers)
returns email and id properties along with displayName property for user field value.
While for single-valued user field only id (available via {userfield}LookupId property) and displayName properties could be requested via items endpoint, for example:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approver,ApproverLookupId)
So, indeed User Information List needs to be utilized to request additional user properties, for example:
https://graph.microsoft.com/v1.0/sites/root/lists('User Information List')/items/{item-id}/?$expand=fields($select=Email)
where item-id corresponds to user field lookup id
This was my experience modifying the
Build Angular single-page apps with Microsoft Graph. In the examples below, I changed my id's out with the default text.
Here is
The Finished Project on thier github
In Graph Explorer, this worked. You can verify it at the Microsoft Graph Explorer.
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields($select=id,Title)
In the app/graph.service.ts in the app, this did not work. Even though you would expect it to based on the graph explorer.
.api('/sites/{site-id}/lists/{list-id}/items?fields($select=id,Title)')
Changing the app/graph.service.ts api call worked.
.api('/sites/{site-id}/lists/{list-id}/items?')
.expand('fields($select=id,Title)')
The result looked like this:
fields: {
#odata.etag: ""d6f5b6ea-9f90-452d-98ba-e838f58d3359,1"",
Title: "IT SPECIALIST (MID)",
id: "20"
}
Here's an example site id:
some.sharepoint.com,9dk062b-2e54-4e4f-b71a-cdb74f42cc44,c6cf6b0a-cc7c-41fd-a76a-ef8f97e8a22f
Here's an example list id.
8eg8c29a-5555-4cfc-bfa4-0e907488f781
The end url won't have any {} in it.

How to get current user's custom information and show it on any screen?

I had made a custom field 'warehouse' on User screen(SM201010), and saved some text in this field to the user 'user1'.
The question is when I login as the user1. How can I display the 'warehouse' field on any screen else?
I had try AccessInfo, but dont know how it works. Please help! Thx!
AccessInfo contains basic information on the current user, but adding a custom field to the User screen will not add it as a member of AccessInfo.
If you added a custom field in a DAC Extension, you will need to fetch the User record, get its extension and then you can access this custom value.
Here are some links about extensions :
https://docref.acumatica.com/(W(1))/Wiki/ShowWiki.aspx?pageid=3a427466-1925-4799-8fee-fe34a77021d0
https://docref.acumatica.com/Main.aspx?ScreenId=ShowWiki&pageid=114ae5af-8667-4933-b53d-c4c8667c85ac
I highly suggest you complete the T300 certification class which teaches how to do customizations in Acumatica. It is available in our Open University

SharePoint online people search display template showing skills managed property

I'm currently working on creating a custom display template for people search result page. I copied out of the box Item_Person.html search display template and modified it to display some more fields.
In the out of the box template also there is a managed property called skills but when I using it, its not returning any values associated with the user profile skills property (SPS-Skills).
As you can see its already mapped but Skill value always comes as empty. I want to retrieve and display inside the custom template.
Please help me if you have done something similar.
Check the following steps
Add meta data to ManagedPropertyMapping
2.Then inside the fuction get the value of metadata
<!--#_ var datacreated = $getItemValue(ctx, "Created");_#-->
3.Then palce the variable where you want <h2> _#= datacreated =#_ </h2>
Thats it publish the html hope its work

How to access nested Part properties in Email Workflow?

I have a Registration ContentType, which contains a ContentPicker field for a Building Item, which contains a Geolocation Part with some properties like Latitude and Longitude.
When a new Registration is Published, it triggers a custom Workflow that sends out an email. In the body of the email I can get to the fields of the Building using tokens like this: {Content.Fields.Registration.Building.Content.Fields.Building.Address}
How can I get to the property values of the Geolocation Part contained within the Building? Can I do something like this? {Content.Fields.Registration.Building.Content.Parts.Geolocation.Latitude}
I'm new to Orchard and I can't figure out how it's structured. Can this be done out of the box or will I have to write a custom token?
If you know which content item to take from the content picker field (for example if it always is only one), then the following might work:
{Content.Fields.Registration.Building.Content.Fields.Building.ContentItems[0].Geolocation.Latitude}
This is assuming your Building field is configured to pick content types with a Geolocation part

Is it possible to add new fields to the Summary Link Control

I am using the PublishingWebControls:SummaryLinkFieldControl and would like to add another field for the Group Description (In addition to the Group Name).
The default field available is the Group Name and Group Items. I really need an option to to hold the Group Description as well.
Is this possible without customisation?
You'll definitely need to customise to a certain extent!
I know you can create create new item screen by modifying CmsSlwpAddEditLink.aspx (search for it)
Though it seems like what you're after is modifying the creation of the Group.
Rough guess: Figure out which content type the list of fields is based on. Add your field in. Find the .aspx which fires when creating a new group (google it) , drop the field syntax into that and see if that works.
Let us know if you find a solution.

Resources