Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Expert

Customizing front page welcome text whith a Freemarker

How can I show the front page welcome text which I set up in the "Admin" -> "Content" -> "Announcements" -> "Front page welcome text" to unregistered users only?


Tried to use this code but it seems like Freemarker expressions are not working here for the front page welcome text:

<#if user.anonymous>
  <!-- Some HTML code here -->
</#if>

Thank you!

3 Replies 3
Executive

Hey @Myko_P,

Try something like this if you'd like to have a welcome message for registered users and a different message for unregistered users:

<#if user.registered == true>
(insert html)
</#if>
<#if user.registered == false>
(insert html)
</#if>

Hope this helps.

__________________________

@Myko_P

You can show it by using below code in your custom component and add this to your page quilt.

<#if user.anonymous>  
<@component id="community.widget.featured-content"/>
</#if>

This custom component will show all the content added to "front page welcome text" area.

.......
Expecting your Kudos and Accepted Solution to my replies.

@StephenB , @Parshant , thank you guys!

Both solutions worked for me 😊

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.