When display 2 different blocks, each for a different role, block that is not showing for that role prevents links from working
I have set up my site so that I have different blocks that appear in the same area of the page depending on what role a user is (such as anonymous, authenticated or some custom role I defined), so for example 1 block appears when a user is anonymous then once they login and become authenticated that block no longer appears but another block appears in the same spot. The problem is that the new block that appears is somehow still being "blocked" by that other block, such that any links within the block will not be clickable, you can't highlight text, etc (but you can still see the contents of the block).
I have tried different z-indexes in the .css file, making them the same z-index or even the second block a higher z-index but the problem persists. I don't believe this is a theming issue but something else, I would appreciate any advice on what could be causing this and what I could do to fix it, has anyone else had this problem?

I think you need to
I think you need to describe/show how the problematic block is being generated and what is its content.
A link?
A link? (or post the generated HTML)
___________________
It’s in the detaιls…
demonstration portfolio
I added the custom blocks by
I added the custom blocks by adding them to the .css file, the template.php file and the page.tpl.php file, it doesn't seem to matter what the block contains, for example I have inserted into a block:
<a href="http://example.com"><img src="http://images/image_example"></a>and in a different case
Go to <a href="http://example.com">this link</a> to do thisI would put a link to the site but I took down the blocks and changed some stuff around since it wasn't working, I can go in and re-activate them.
In the .css file the blocks would be as such:
#example1 {
position: absolute;
height: 100px;
width: 100px;
z-index: 5;
top: 200px;
left: 56px;
}
#example2 {
position: absolute;
height: 100px;
width: 100px;
z-index: 5;
top: 200px;
left: 56px;
}
Then the block "example1" would be set to show only for the role: "anonymous" and block "example 2" would be set to show only for the role "authenticated user", so everything works fine except that the links in "example 2" are not clickable and the text is not able to be highlighted with the mouse cursor which to me is indicating that somehow the other block is interfering with it even though it is not supposed to be showing for that role.
(Full HTML is checked as the input type for the content)
You mention that you added
You mention that you added blocks to template.php and page.tpl.php? Normally you don't have to do that so I wondering how and where you are outputting these blocks in the first place? What did you put in those files?
The point being that only one block should ever show, so I am wondering what is going on here exactly.
You need to activate this and actually show us. You can always contact one of us directly and get a chat going IM and work through this in real time.
not showing?
You say but if you have set up the blocks as you say, for a role, then that block should be totally absent from the generated page (the html). Can you confirm that the block which shouldn’t show is not in the html?
One problem that you do have is that you are using position: absolute; This takes the block out of the ‘flow’ and it may well be behind another element, which will stop any clicks etc.
___________________
It’s in the detaιls…
demonstration portfolio
I've read Drupal guides (not
I've read Drupal guides (not on this site) online that say you are to print the block title in the page.tpl.php file and also in the template.php file, such as (in the page.tpl.php file):
<div id="customblock"><?php print $customblock?>
</div>
and (for the template.php file)
$regions['customblock'] = t('customblock');This has worked for me fine up until this issue, Is there a different way I should be inserting the block? Thanks, I appreciate the help on this issue.
Yeah, sure, you can do that
Yeah, sure, you can do that if you want or need to output your block/s in a custom region, otherwise you can use the standard regions - sidebar right and sidebar left, header, footer etc etc.
normally there would be an array of regions, where you can define new regions, ie.
<?phpfunction mytheme_regions() {
return array(
'left' => t('left sidebar'),
'right' => t('right sidebar'),
'header' => t('header'),
'footer' => t('footer'),
'closure_region' => t('closure'),
'mycustomregion' => t('my custom region')
);
}
?>
To solve your issue though we need to see the output, as two of us have now alluded to, two blocks should just not show, only one at a time (I do this all the time without issues).
A rose, by any other name, would smell as sweet.
It might be useful to remember that you print a region in a template, and Drupal puts your blocks into regions according to your configuration.
cf. $regions['customblock'] = t('customblock'); — misleading.
'mycustomregion' => t('my custom region') — correct.
___________________
It’s in the detaιls…
demonstration portfolio
My layout is heavily
My layout is heavily customized, the site its for is http://telecommutereview.com, I'll get a page on the site to show the problem tomorrow, I appreciate the help on this, I forgot to do it today and I should be getting to sleep as its late.
I just tried it with putting
I just tried it with putting 2 blocks in the same "div" and putting one above the other and now it works, I guess I overlooked this before as I was trying to use 2 different divs, one for anonymous role and the other for authenticated. Thanks for the assistance but it seems this will work, can't believe I overlooked this before