The page.tpl.php of my website shouldn't contain <?php print render($page['content']); ?> because it is only set of blocks. The problem is I'm not able to insert comment form into node pages of a website which its page.tpl.php hasn't <?php print render($page['content']); ?> . what shall I do?


You have asked simple question & there is very simple answer for that --

Yes, you can create page.tpl.php without <?php print render($page['content']); ?>. You just have to remove this snippet from the TPL file & it will work.

But then you have explained your issue about comment.

So if you go through the structure of tpl files at theme, you will understand that <?php print render($page['content']); ?> is responsible to print node.tpl.php & that one contains <?php print render($content['comments']); ?>.

So without fetching the things of node.tpl.php you won't get comments. Anyway, how a comment can be associated to a page when there is no node.

  • thanks for your useful reply. so what is your idea, what if I only want to have a set of blocks in the front page of website? this is my idea: prevent all the contents from being promoted to the front page. any other idea? – user21616 Jan 24 '14 at 7:04
  • 3
    Many people do that for front page. You just make a tpl named page--front.tpl.php & remove the snippet for content. Use other regions, which ever is required. Clear the cache & you are ready to go.. – RajeevK Jan 24 '14 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy