Hello,

I´m knew to Drupal and have two questions.

The first one: I try to use a block with PHP-code. This works pretty well (yes, it´s nonsense):

phpinfo();

So why I don´t get anything when I write

print $site_name;

And the second: How can I can display the tabs only at the block section of the backend but not at the frontend. I use two diferent themes for backend and frontend but the block section naturally always uses the theme for the frontend.

Thank you for any help.

Mazso

Comments

Scott’s picture

You can try adding this code to your frontend's page.tpl.php file:

<body<?php if ((arg(0) == 'admin') AND (arg(2) == 'block')) print ' class="block-admin"'; ?>>

This would add the block-admin class only on pages that have "admin" in the first segment of the URL and "block" in the third segment, such as "example.com/admin/build/block". Then you could control the display of tabs using a "body.block-admin" CSS selector in your frontend's style.css file.

Mazso’s picture

Thank you, Scott, this works. But even when the code is hidden it is still present. Browsing this website I found that it is possible to use something like node-nodetype.tpl.php. So I will try to work with this one.

Update

No, It´s as easy as using your code in a somewhat differtent way.

if ((arg(0) == 'admin') AND (arg(2) == 'block')) {

print $tabs

}