Adding a block to markup I have created several content types and using views I have created blocks that take the uid as an argument and displays content that that author has created. So far so good.

What I want to do now is create a module that displays all these blocks in a given area,

I have the HTML ready and I can create a page that passes the markup back to drupal and display that, what I would like to do is populate those areas with the given block.

so for example. If I have a page called:

www.example.com/displayMyContent/58 (where 58 is the user ID)

the HTMl of the page would be online these lines:

&lt;?php
$uid = args(2);
$markup = "
&lt;div id="myVideoBlock"&gt; ". drupal_call_to_render_block("MyVideosBlock", $uid). "&lt;/div&gt;";

?&gt;


what would be the function to insert the given block into the given section and how would I pass the $uid to the block so that only the authors content would be displayed?

Also there are reasons why i am not using the blcok functions in admin mainly because there will be other blocks added on the page and I need control of where the blocks will be placed
I think you may be able to do this by using the global $user variable.


1 create the hooks block_info and block_view  
create hook_theme()
define a theme to be able to pass variables to template.
create the template


in your block_view do something along the lines of this:

switch($delta){
    case 'myvideoblock':
            global $user;
            $view = views_get_view('YOURVIEW');
            $view-&gt;set_display('YOURDISPLAY');
            $view-&gt;set_arguments($user-&gt;uid);
            $result = $view-&gt;execute;
            $your_variable = $result-&gt;result;
            $block['content'] = theme('videoblock', array('your_variable' =&gt; $your_variable));
}


You should poke around in the $result->result object to get to your content though.

Hope this helps