I am a total newb to web development and have been working to customize our AbleCommerce store. One feature that is very important for us to incorporate is content that will only be viewable by our magazine subscribers.
I have the subscriptions set to add the subscriber to a custom group, but have been unable to successfully restrict the content (I am hoping to create it as a top-level page on the horizontal nav bar). I found a few posts touching on this topic, but all lacked sufficient info for my low-level ability.
Can anyone help?
Thank you in advance for your time.
Restricting Content to User Group (Newb)
Re: Restricting Content to User Group (Newb)
You can wrap the link to the content for subscriber's only with a conditional statement in the scriptlet.
For example:
in Admin/Website/Content and Layout there is the scriptlet for the Standard Header
It has a horizontal menu with links something like this:
.......
See how there is a conditional statement for foreign currencies?
You could do something similar for your special category. Make the category "hidden" and use a statement like this:
#If ($customer.IsInGroup(x))
<a href="your_Link.aspx">Subscriber Only Category</a>
#end
You would put the number assigned to the group where I have an x.
One way to find the Group number is:
Admin/People/UserGroups
Hover on an icon to the right of the group then look at the URL at the bottom of the screen. You will see GroupId=x at the end. That is the id assigned to the group.
Hope this helps.
For example:
in Admin/Website/Content and Layout there is the scriptlet for the Standard Header
It has a horizontal menu with links something like this:
Code: Select all
<td class="navigation" colspan="3">
<div class="content" style="float:left;">
<a href="~/Default.aspx" class="tab">Home</a>
if ($store.Currencies.Count > 1 )
<a href="~/Currencies.aspx" class="tab">Currencies</a>
#end <a href="~/FAQ.aspx" class="tab">FAQ's</a>
<a href="~/Service.aspx" class="tab">Contact Us</a>
</div>
</td>
See how there is a conditional statement for foreign currencies?
You could do something similar for your special category. Make the category "hidden" and use a statement like this:
#If ($customer.IsInGroup(x))
<a href="your_Link.aspx">Subscriber Only Category</a>
#end
You would put the number assigned to the group where I have an x.
One way to find the Group number is:
Admin/People/UserGroups
Hover on an icon to the right of the group then look at the URL at the bottom of the screen. You will see GroupId=x at the end. That is the id assigned to the group.
Hope this helps.
Re: Restricting Content to User Group (Newb)
Success! Worked perfectly.
Thank you! Thank you! Thank you!
Hopefully this will be a help to others with the same question.
For reference, I also used this thread on how to add a top-level page:
viewtopic.php?f=42&t=9473
Thank you! Thank you! Thank you!
Hopefully this will be a help to others with the same question.
For reference, I also used this thread on how to add a top-level page:
viewtopic.php?f=42&t=9473