Hello,
I'd like to add Register / Login buttons on the main home page but display them only when developers are not logged in, exactly how it works with the Register / Login link on the toolbar.
Thanks in advance,
Anton.
Solved! Go to Solution.
@Anton+Bar , I believe your content is a HTML code.
Take a look at this article here which explains how to create custom blocks using module & enable them using context. If you have used custom_home blocks module attached in above article, It's taken care in the template. See custom_home_block2.tpl.php file that renders block 2 based on logged in user or not inside module template folder. See code below of same file.
<div> <div> <h1>APIs. APPs. Innovation</h1> <div> We are committed to work together to build <strong>Innovation</strong>, <strong>Apps</strong> and Developer communities. Driven by passion to innovate, We bring our services to you using <strong>APIs</strong>. </div> <?php global $user; if ($user->uid== 0) { ?> <div> <span> <span> <a href="https://community.apigee.com/user/register">Join Now</a> </span> </span> <span> <span> <a href="https://community.apigee.com/user/login">Sign In</a> </span> </span> </div> <?php } else { ?> <div> <span> <span> <a href="https://community.apigee.com/user/me/apps">My Apps</a> </span> </span> <span> <span> <a href="https://community.apigee.com/user">Profile</a> </span> </span> </div> <?php } ?> </div> </div>
Also, If you don't want to put the code in a custom module & worry about drupal modules stuff. Easier way is to leverage the add block capability in out of the box CMS. See how to do same quickly below.
Hope it helps.
Hi Anton,
Out of the box, drupal supports 2 basic roles: registered users and anonymous (basically logged in and logged off).
You can find some more details on how to leverage them here:
Another option would be to use drupal modules to expand on the portal capabilities and configure full blown RBAC access into the portal. More details on this options is available here: http://docs.apigee.com/developer-services/content/managing-role-based-access-content-your-developer-...
I hope this helps,
Ricardo
@Anton+Bar , I believe your content is a HTML code.
Take a look at this article here which explains how to create custom blocks using module & enable them using context. If you have used custom_home blocks module attached in above article, It's taken care in the template. See custom_home_block2.tpl.php file that renders block 2 based on logged in user or not inside module template folder. See code below of same file.
<div> <div> <h1>APIs. APPs. Innovation</h1> <div> We are committed to work together to build <strong>Innovation</strong>, <strong>Apps</strong> and Developer communities. Driven by passion to innovate, We bring our services to you using <strong>APIs</strong>. </div> <?php global $user; if ($user->uid== 0) { ?> <div> <span> <span> <a href="https://community.apigee.com/user/register">Join Now</a> </span> </span> <span> <span> <a href="https://community.apigee.com/user/login">Sign In</a> </span> </span> </div> <?php } else { ?> <div> <span> <span> <a href="https://community.apigee.com/user/me/apps">My Apps</a> </span> </span> <span> <span> <a href="https://community.apigee.com/user">Profile</a> </span> </span> </div> <?php } ?> </div> </div>
Also, If you don't want to put the code in a custom module & worry about drupal modules stuff. Easier way is to leverage the add block capability in out of the box CMS. See how to do same quickly below.
Hope it helps.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |