[development] Blocks and page context

nan wich nan_wich at bellsouth.net
Fri Apr 23 16:19:58 UTC 2010


Also, arg(0), arg(1), arg(2), ... are available to the block. These are the real path components, not the URL alias stuff.
 
Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.




________________________________
From: Daniel F. Kudwien <news at unleashedmind.com>
To: development at drupal.org
Sent: Fri, April 23, 2010 12:03:17 PM
Subject: Re: [development] Blocks and page context

$_GET['q'] holds the current, internal system path.

menu_get_item() provides you the currently active menu router item.

menu_get_object() provides you a dynamic argument context from the menu
router item, if any.
http://api.drupal.org/api/function/menu_get_object/6

sun

________________________________

    From: development-bounces at drupal.org
[mailto:development-bounces at drupal.org] On Behalf Of E.J. Zufelt
    Sent: Friday, April 23, 2010 4:49 PM
    To: development at drupal.org
    Subject: [development] Blocks and page context
    
    
    Good morning, 

    I am building a module and invoking hook_block.  I am wondering if
there is a way for my block to gain some context about the page on which it
will be rendered.  Primarily I would like to know if my block can be aware
of the URL of the page being displayed (not the http-requested URL in case
they differ), and the access permissions of the page being displayed (not
those of the block itself, or of the user accessing the block.

    Thanks,
    


                Everett Zufelt
    
    http://zufelt.ca

    Follow me on Twitter
    http://twitter.com/ezufelt
    
    View my LinkedIn Profile
    http://www.linkedin.com/in/ezufelt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100423/455d9c4b/attachment.html 


More information about the development mailing list