XF 2.3 Create a partially private bbcode

PhineasD

Well-known member
Licensed customer
I need to create a BBcode where a section is only accessible to registered users.

I've tried adding a conditional statement to the BBcode's HTML, but it's not working. And if I try to hide it using CSS, the text I want for registered users is still indexed and readed by Google.

Is there an easy way to do this?
 
Which BBCode HTML are you adding a condition to that it's not working? If you wanted to do something simple like make the SPOILER tag not show the content unless the user is logged in, you could simply edit the bb_code_tag_spoiler template and change this:

Code:
{$content}

to this:

Code:
<xf:if is="$xf.visitor.user_id"">{$content}</xf:else />{{ phrase('login_required') }}</xf:if>

Could of course just make a new BBCode tag with the same general idea.
 
Which BBCode HTML are you adding a condition to that it's not working? If you wanted to do something simple like make the SPOILER tag not show the content unless the user is logged in, you could simply edit the bb_code_tag_spoiler template and change this:

Code:
{$content}

to this:

Code:
<xf:if is="$xf.visitor.user_id"">{$content}</xf:else />{{ phrase('login_required') }}</xf:if>

Could of course just make a new BBCode tag with the same general idea.

I created a new simple replacement bbcode with the following conditional, but it doesn't work for me:

Code:
<blockquote class="custom_bbcode">
<xf:if is="$xf.visitor.user_id">
{text}
<xf:else />
{{ phrase('login_required') }}
</xf:if>
</blockquote>
 
Back
Top Bottom