sijumonap Posted February 15, 2008 Share Posted February 15, 2008 I will explain the doubt with my block.tpl.php. <?php <div class="block block-<?php print $block->module; ?>" id="block-<?php print $block->module; ?>-<?php print $block->delta; ?>"> <h2 class="title"><?php print $block->subject; ?></h2> <div class="content"><?php print $block->content; ?></div> //the following area I have used with reference of the Drupal manual $module = 'some_module'; //how can we assign a constant value for this when there are five or six blocks/regions in the page $delta = 0; //how can we assign a constant value for this when there are five or six blocks/regions in the page if ( $block->module == $module && $block->delta == $delta ) { print l('(edit this block)', "/admin/build/block/configure/$block->module/$block->delta"); } ?> Note: I have commented my doubts with two lines of the above code. In my case, there are five blocks in the page and I want to insert the "Edit this Block" link only for a block. When I tried to use the code without an IF condition, it comes for all blocks. So, I have inserted that part of your code in it. For that, I want to check with the variable '$block->delta' like this: if ($block->delta == '----something----' ) But, I don't know it's value. So, please give me the guidelines to get the variable. Link to comment https://forums.phpfreaks.com/topic/91292-issue-with-drupal-block-variables/ Share on other sites More sharing options...
sijumonap Posted February 15, 2008 Author Share Posted February 15, 2008 I have got the answer. The values for $block->module and $block->delta is available in the "configure" link (Admin - Site Building - Blocks) of each blocks. Link to comment https://forums.phpfreaks.com/topic/91292-issue-with-drupal-block-variables/#findComment-467913 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.