0

I'm building a custom theme for Drupal 7.xx, which is part of my internship. I've been developing this theme for quite a while now, but I still consider myself an absolute beginner when it comes to theming for Drupal.

During the process, I've ran into quite a few problems which (luckily) I've been able to solve with the help of google (including Drupal Answers) so first of all thanks for that!

One of the problems I seem to be unable to solve, is that I cannot see the page content anywhere. So far I've added all content of the pages in blocks, which I've assigned to be rendered out by a region called 'cont_page_block', and which I have declared in my .info document.

To clarify: When I add a new page, I fill in the page title and body, but it doesn't appear on the page. Also, when I add a news article, I can see the teaser on my 'news summary' but when I try to click on it (which works though) it redirects me to a new page (URL states ?q=node/xx) which is, ofcourse, empty.

Here's the code I use in my page.tpl.php file to render the region:

   <div class="cont_page_block">    <?php print render($page['cont_page_block']); ?>
                                    <?php print render($content); ?>               </div>

And here's the declaration of my regions in my .info file:

regions[cont_page_block] = content-page-block  
regions[content] = content

Am I missing a line of PHP code in my page.tpl.php file? Any help would be greatly appreciated!

0

Try using:

<?php print render($page['content']); ?>

Edit: To further the above, if you want to see the action links/titles/tabs you can print those by:

<?php if ($title): ?>
      <h1 class="title" id="page-title"> <?php print $title; ?> </h1>
      <?php endif; ?>
      <?php print render($title_suffix); ?>
      <?php if ($tabs): ?>
      <div class="tabs"> <?php print render($tabs); ?> </div>
      <?php endif; ?>
      <?php print render($page['help']); ?>
      <?php if ($action_links): ?>
      <ul class="action-links">
        <?php print render($action_links); ?>
      </ul>
      <?php endif; ?>
      <?php print render($page['content']); ?>
      <?php /*?><?php print $feed_icons; ?><?php */?>
|improve this answer|||||
  • Thanks for the quick response! I've copied your code and I am now able to print out the page title, yet the remaining content still isn't visible. note: I've used the <?php print render($page['content']); ?> – Kay Angevare Mar 28 '15 at 18:56
  • To illustrate my problem, here's a snapshot of the page: i.imgur.com/TQFfgvL.jpg The content should be visible in the orange box in the middle. – Kay Angevare Mar 28 '15 at 19:00
0

Somebody slap me please.

I was about to take a smoke break to empty my head about the issue, and I suddenly realized I forgot to add the 'Site-Content' to the deisgnated region in the 'Block Management' area.

Problem solved!

Now please excuse me while I quietly sit ashamed in a corner.

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.