Good morning everyone!

What options do we have in order to hide certain content/content types, like for example a book, or any book page, in 4.6.x

Thanx on forehand for any reply:-)

Comments

saerdna’s picture

what you mean by hide? you can prevent stuff from getitng displayed on /node by deselect "promote to front page" check admin -> content types or something

DVV’s picture

Well, by not "promoting to front page" those items still appear in tracker, so one have to deselect tracker module, too...

fletcherson’s picture

By hiding I meant:

- How can I prevent certain roles/users from accessing this book page or forum post?

cog.rusty’s picture

As far as I know you can't directly hide all the nodes of a content type. You can only restict "create" and "edit own" for some user roles.

What you can do is:
(a) hide individual nodes by using a module such as 'simple access' or 'node_privacy_byrole'.
(b) hide all the nodes tagged with some taxonomy terms by using the 'taxonomy_access' module.

You can use only one of these modules because they interfere with each other (they all update the same database table). With the third one (taxonomy_access) you can set up a combination of roles and categories which will come close to what you want to do.

There is also a new access control module, path_access, which I have not tried. The maintainer says that it can coexist with the other ones.

uday_chill’s picture

I want to hide the primary link "Login" after a user logs into the site. Can someone help me with this? I am using the fancy theme... I think we have to tweak the page.tpl file...but i dont know which part of it.

heine’s picture

First of all, better to post in a new thread.
Modify in page.tpl.php

      <ul><?php foreach ($primary_links as $link): ?>
	  <?php
          static $primary_link_id;
          $primary_link_id += 1;    
        ?>
        <?php $class = ""; ?>
        <?php if ( stristr($link, 'active') ) : ?>
        <?php $class = 'class="current"'; ?>
        <?php endif; ?>
        <li <?php print $class?> id="primary-link-<?php print $primary_link_id; ?>" > <?php print $link?> </li>
          <?php endforeach; ?>

to read:

      <ul><?php foreach ($primary_links as $key => $link): ?>
	  <?php
          static $primary_link_id;
          $primary_link_id += 1;    
        ?>
        <?php $class = ""; ?>
        <?php if ( stristr($link, 'active') ) : ?>
        <?php $class = 'class="current"'; ?>
        <?php endif; ?>
       <?php if ($key != 'your/url'): ?>
        <li <?php print $class?> id="primary-link-<?php print $primary_link_id; ?>" > <?php print $link?> </li>
        <?php endif; ?>
          <?php endforeach; ?>

PS Not tested and posted in a hurry.

--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

fletcherson’s picture

Thanx, Ill give it a try.

Ok this piece of code one can only implement into php-templates powered by the PHP-template-engine (otherwise you've got do technical changes in the code).

heine’s picture

My post was not an answer to your question, but to the question of uday_chill
And a bad answer at that. The second code piece should be:

  <?php global $user; ?>
      <ul> <?php foreach ($primary_links as $key => $link): ?> 
<?php
          static $primary_link_id;
          $primary_link_id += 1;
        ?> 
         <?php $class = ""; ?> 
         <?php if ( stristr($link, 'active') ) : ?> 
         <?php $class = 'class="current"'; ?> 
         <?php endif; ?> 
        <?php if (!($key == 'your/url/tohide' && $user->uid)): ?> 
        <li <?php print $class?> id="primary-link- <?php print $primary_link_id; ?> " > <?php print $link?> </li>
         <?php endif; ?> 
           <?php endforeach; ?>

--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.