Please let me clarify.
- You can NOT -hide- a menu item using CBSubs.
- You CAN -protect- a menu item using CBSubs.
In order to HIDE a menu item you need an ADDITIONAL module position within your JOOMLA -template-. You then need this module position to ONLY show to public users (see chuckbone's post as to how to do that).
It's also not possible to show a Tab to someone not logged in then remove it when someone is logged in, you CAN achieve something similar by using a Delimiter field to show/hide the content you intended to include in the tab; then set nothing else to show on the tab and configure CB to not show empty tabs (CB Configuration -> User Profile), your tab will vanish to logged in users.
To use the delimiter field method you'd need to use advanced substitutions such as IF statements (covered in tutorials within my signature) such as the following example.
[code:1]
[cb:if user="#displayedOrMe" user_id="0"]Content I would like only Guests to see.[/cb:if]
[/code:1]
Things do not work in such a fashion, because Joomla or CB do not work in a reverse permissions architecture. They're designed to give additional features; not strip them away. Thus you need code based changes to achieve something as such.
Another option is to build your menu using document subscriber available module CB Content, which completely supports substitutions. So you could do the substitution above to show a menu link to ONLY guests. This would give you exactly what you're wanting without changing template code and without additional modules. Example of this as follows.
[code:1]
<ol>
<li><a href="index.php?option=com_comprofiler&task=userProfile">View Profile</a></li>
[cb:if user="#displayedOrMe" user_id="0"]<li><a href="index.php?option=com_comprofiler&task=registers">Register</a></li>[/cb:if]
</ol>
[/code:1]
The above example would always show the View Profile link, but only show the Register link to those not logged in.
can this not be achieved inside of CSsubs?
No it can not be done within CBSubs.
Now that you've read the above and understand substitutions and their usage in the CB Content module you can use CBSubs Fields to change a fields (preferably Read Only field) value based on subscription. Say I subscribe and this changes cb_subscriptions to 1. I can then use this in a substitution inside CB Content to show a new menu link such as the example below.
[code:1]
<ol>
<li><a href="index.php?option=com_comprofiler&task=userProfile">View Profile</a></li>
[cb:if cb_subscriptions="1"]<li><a href="index.php?option=com_content&task=view&id=32">Thank You for Subscribing</a></li>[/cb:if]
</ol>
[/code:1]
The above would always show the "View Profile" link, but only show the "Thank You for Subscribing" link to those whose field cb_subscriptions equals 1.
Post edited by: krileon, at: 2010/03/22 15:13