Forum Discussion

SuneR's avatar
SuneR
Guide
15 years ago

Description of default Components and FreeMarker information

I am currently trying to figure out the possibilities of our Lithium install, and am therefore interested in finding out more about the default components that are available.   I have searched thou...
  • KaelaC's avatar
    15 years ago

    At this time, there is not a complete list of the default components and description of what they do although I do believe that is coming soon to studio (descriptions at least). There is not a lot of customization that can be done to default components but you can use those components in custom components.  For example, if I wanted to show search only to logged in users

    <#if user.registered >  <#-- if the user is not anonymous -->
    <@component id="common.widget.search-form" showAdvancedSearchLink="false" />
    
    </#if>

    You can use a user avatar with freemarker, you just also need to use our REST API like this:

    <#assign avatar = rest("/users/id/[user id]/profiles/avatar").image />
    <#if avatar.url?length gt 0>
    <img src="${avatar.url}">
    </#if>

    You will need to replace [user id] with the id of the user whose avatar you want. If you are looking to display the current user's avatar you can use

    ${user.id}

    . Hope that helps.

     

    Edited - I had a longer example but my html is code is being interpreted instead of displayed. I will update when I fix that :)