Forum Discussion
Hi ClaireKav,
I realized you asked this a long time ago, and other users may have had similar situations and found a solution to, I thought I would post mine since this topic post came up when I was looking for an answer to my question :)
I wanted to build a component that you've outlined the logic to here;
<#if user.Registration_time <LESS_THAN> TodaysDate(-14)>
<p>this text for newbies</p>
<#else>
<p>this other text for older members</p>
</#if>
The amazing AdamN and wonderful KaelaC Helped me craft the following;
By using rest to get the number of user logins here: http://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=User.logins.count#User.logins.count
And using the freemaker expression to write out less than or equal to ( lte) or alternativly, greather than or equal to (gte), I wrote the following component to show a link to all anon users, and logged in users, but only if they've logged in 5 times or less:
<#if user.anonymous> <a href="#">This is my newbie link</a> <#else> <#assign loginCount = rest("/users/id/${user.id}/logins/count").value /> <#if loginCount?number lte 5 > <a href="#">This is my newbie link</a> </#if> </#if>
I think is preferable than tying it to a rank, since I'm not a Community Manager, and I dont know how long or what the criteria is to move beyond a rank (plus that could change over time) and I think its better than using a set number of days from register, as I could have registered months ago, but only rememebred to login and check out the community a month from then, where I would be as unfamilar with the community as I was 14 days ago.
So WAY after the fact, but hopfully it can help someone else :catvery-happy:
Related Content
- 2 months ago
- 2 months ago
- 6 months ago
- 11 months ago