dkytasaari
8 years agoAce
Need custom component to display user's location in Profile Hero
I want to display a user's location in the Profile Hero. I don't see where there is a stock component to display this information, which means I need to create a custom component. I cannot find an example of anything here, or in the KB that would be a good example to work from. I suspect I need something like this:
<#assign userLOC=rest( "2.0", "/search?q=" + "SELECT location from users where id = (ID NUM of PROFILE I AM VIEWING) />
<div>
$userLOC
</div>
What do I need to finish that WHERE clause? Can anyone point me to a repository of examples?
Regards,
Dennis
Hi dkytasaari You are missing ending quote(") in your query.
Here is updated one
<#assign userLOC= rest("2.0","/search?q=" + "SELECT login from users where id='${page.context.user.id}'"?url).data.items[0] /> <div> ${userLOC.login} </div>
Also, I do not think so there is any location field in API.