Publish variables which can be used for conditional display
In general, visibility control in Wild Apricot is limited to the page level. Thanks to the helpful Wild Apricot support staff, I can now use the javascript variable "bonaPage_IsUserAnonymous" to control conditional display of page elements depending on whether the use is logged in.
Now I would like to have more granular control of displayed elements (e.g. <li> or <tr> elements) depending on group membership. I assume that this would be possible with a bit more knowledge about the data/variables available to scripts in Wild Apricot. Presumably these are already documented for the use of WA-internal developers. Why not publish (at least some of) it for us?
-
Roger Brooks commented
@Jay, sorry for the delayed response. I used CSS in a Custom HTML block. Here is an example:
<!-- Display instruction for discount if user is not logged in and current date is Jul.- Dec. -->
<p class=use_discount><strong>At the bottom of the *second* page of this application, please enter the code "2HY" (without the quotes) in the box labelled "Enter discount code" when joining in the second half-year (Jul.-Dec.) to profit from a 50% discount.</strong></p> The box labelled "Code" on the *first* page of the membership application is for entry of the CAPTCHA code displayed below it.
<script>
$('.use_discount').css("display",((bonaPage_IsUserAnonymous && getMonth() >5) ? "block":"none"));
</script> -
Chris Detro commented
In particular, I'd like to be able to embed additional members-only content on any given page, rather than having completely separate pages. For example, on an page about an event, only registered members see the embedded video recording.
-
Jay commented
Roger - can you please post a sample of how you use the javascript variable "bonaPage_IsUserAnonymous" to control conditional display of page elements depending on whether the use is logged in?