0

Using a custom theme, pretty basic (so far):

<section id="content">
    <?php if ($title): ?>
        <h1 class="title" id="page-title">
            <?php print $title; ?>
        </h1>
    <?php endif; ?>

    <?php if ($tabs): ?>
        <div class="tabs">
            <?php print render($tabs); ?>
        </div>
    <?php endif; ?>

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

That standalone <h1 class="title" id="page-title"> is the problem, though. I want it to appear inside the first panel of content (I'm using Panopoly), but since all the panels are generated by render($page['content']), it's not clear to me how I should do this.

My first solution was to use CSS, positioning the title relatively and adding some padding to the first panel to give it room. However, this only works as long as the title is one line of text. So a pure CSS solution appears to be out.

4
  • are you attempting this through a tpl file? if so, you can print $title on its own where you want and then remove it from $page['content'] before it is rendered
    – Geoff
    Commented May 21, 2015 at 3:34
  • That's the reverse of what I want, actually -- it's already on its own, but I want it inside one of the panels generated by $page['content'] Commented May 21, 2015 at 13:12
  • I see, that isn't clear in the question - Ive never worked with Panopoly - does it allow you to modify the default panels it incorporates? to include the title as a field in a given panel?
    – Geoff
    Commented May 21, 2015 at 14:24
  • Well, what do you know -- that's exactly what I needed to do. Problem's solved now. Thanks for putting me on the right path! Commented May 21, 2015 at 15:00

1 Answer 1

0

Given the theme's use of Panels, I would suggest looking into the default panels it uses and whether or not the title field can be manipulated in that way, so that the title could be placed in any given section you want.

EDIT from OP

"Just so. For future readers: I accessed Panopoly > Pages under the admin menu to alter the default page templates. Then for the generic Content Page, set "Title type" to "No title" and edit the settings for the content panel to "Override title" as "%node:title", "h1"."

1
  • Just so. For future readers: I accessed Panopoly > Pages under the admin menu to alter the default page templates. Then for the generic Content Page, set "Title type" to "No title" and edit the settings for the content panel to "Override title" as "%node:title", "h1". Commented May 21, 2015 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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