XF 2 Code block restricted viewing to registered members only

sdchan

Member
Hello - I am looking for a way to implement a code block viewing restriction across all of the pages of my site. An example of what I am trying to do is below. This was built as a custom page / node - but I'm looking to implement the code block to apply to all threads / pages of the site.

Specifically, I want to restrict viewing of code blocks to certain groups only (i.e. they must register at the site to view the codes).

This was the code used to implement the below code block.

Code:
<div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code">
                                    <div class="bbCodeBlock-title"> Code: </div>
                                    <div class="bbCodeBlock-content" dir="ltr"> <div class="content-lock">
    <div class="icon-wrapper"><i class="fas fa-lock"></i></div>
    <span class="text">This content is only accessible to VIP members.</span>
    <a class="button--cta button" href="/account/upgrades">
        <div class="after-button-text">Upgrade your account <i class="fas fa-star"></i>

1652995974992.png
 
Top