From where does render() function call the html element or where to render() in drupal 7 ?

Comments

Jaypan’s picture

Render takes render arrays and turns them into HTML. Each render element of the render array will have a theme applied to it, and this theme is used generate the HTML.

As for your second question, it's too broad to give any kind of proper response.

Why don't you give us more information, and we can give a better response.

hariharan614’s picture

Thank you very much for your reply Jaypan. I'm using "BIZREVIEW" theme, and i want some portion of the page to be customized, but i don't know how. I found "page.tpl.php" page and saw the sections defined in that page, and i came across this "render()" function. If i get to know from where the contents are been rendered by render function, then i can customize those portions. I'm new to drupal. Please help me.

ravibarnwal’s picture

In BIZREVIEW THEME, Almost content coming from Views block and you can change these block in context modules config page.

hariharan614’s picture

I checked with the context module, but its not what i ment. Please look at this below link, in which there are 2 images of 2 blocks. I need the second block to look same as the first block. URL: http://hari614.5gbfree.com/

And i got the point that the render function will render the contents from the render array. But where can find the content for that array. Below is a code in which render function is rendering with the index name as 'content_top_second'.

But from where its rendering the content from?

The code is something like this in 'page.tpl.php':

<?php if ($page['content_top_second']):?>
    <div id="content-top-second-wrapper" class="clearfix">
    	<div class="container">
        	<div class="row">
                <!-- EOF:#content-top-second-wrapper -->
                <section id="content-top-second" class="col-md-12 content-top-second clearfix">
                    <?php print render($page['content_top_second']); ?>
                </section>
                <!-- EOF:#content-top-second-wrapper -->
    		</div>
    	</div>
    </div>
<?php endif; ?>

These questions may be silly, but i'm new here.

Thanks for you help.

Jaypan’s picture

If I may suggest, there is a better way to go about dealing with your issue. You're trying to solve a problem, and you've found something in the Drupal internals where the code is happening, and you've asked a question so that you can figure out how to solve it from that spot. But Drupal works on an API, where it can be quite difficult to backtrace something. On top of this, you almost change things at their source in Drupal, you override them further down the line.

So for my suggestion, you should start a thread and explain exactly what it is you want to do, then ask how to do it, rather than asking how to do something in the way that you are thinking to solve it. You'll get better answers, often with an explanation of why you do it that way, so you can learn in the process.