If I add the page title using Add content -> Page elements -> Page title I can place the page title where ever I want. But I don't know how to remove the standard page title above the content and only display it through a page element.
If I set the Title type to No title then the page title is removed from the top AND from the page element.
If I set the Title type to Manually set then I get the page title BOTH at the top of the content and in my page element.
I'm probably missing something here, how do I remove the page title above the content but still display it in a page element?
Comments
Comment #1
AdrianB commentedI can use CSS to hide the first page title when both are displayed, but that's a bad workaorund since I still have two
<h1>headers in the HTML source.Comment #2
merlinofchaos commentedNormally the page title is displayed in your page.tpl.php -- in order to not display it, you'll need to modify your page.tpl.php to compensate.
One way to help with this would be to use Panels Everywhere.
Comment #3
AdrianB commentedAha... so the only way to use the "Page title" page element without duplicate page titles is to modify page.tpl.php. Well, then I know it wasn't me not understanding the options.
But I sort of thought the point with Panels was to do less hacking of templates and instead use Panels to compose layouts, choose what content is shown where etc. And so far I've manage to do just this, until I hit this page title thing.
I don't think I need Panels Everywhere just for this smal adjustment, but otherwise it's an interesting module. Anyway, thanks for the answer and thanks for a great module!
Comment #4
mlconnor commentedI'm Using Panels 3.3 and this is still an issue from what I can tell. It would be nice to have page-panel-page.tpl.php
Using CSS isn't an option because you don't want to hide the titles on every page, and thus have to use Panels for the entire site.
The issue is that I need to be able to make changes to the page.tpl.php in the event that a Panels Node page is being displayed. Is there an API call or variable present that would indicate to the themer whether or not the current page is a Panels Node?
The Panels system is flexible enough that the designer of the panel can finally put the breadcrumbs and page titles in a place within the panel that makes sense for that page. Turning off the title and breadcrumbs in the page.tpl.php is then necessary.
I looked at
but the node is the proper type already, not a Panels type. In my case, it is a Press Release. There are some hacks that are scanning the page content looking for CSS but I don't think that's acceptable. The other way to do it would be to implement theme_panels_pane and set a page variable but I'm concerned that it would cause unwanted behavior when minipanels were shown.
Any thoughts?
Comment #5
zach harkey commentedThe easiest solution is to simply unset the $title variable
YOURTHEME_preprocess_page()using whatever logic makes the most sense. To unset $title for just the 'press_release' content type include this line:Or, to unset $title for several node types (e.g., press_release, blog, story, gallery):
You aren't limited to just $title either. Here you can unset the .tpl output for any of the page elements that panels allows you to position as a pane. just append them as an argument to
unset(). For example, if you are using a pane for the page tabs and don't want that to display twice either, just include $tabs in the argument too:The above conditions work great if you only want to unset page.tpl elements for panel node type overrides, but you can apply these conditions based on anything. For example, you may want to override $title and $tabs for one section of your site regardless of node type.
Let's say you made a panel page at path: /press that has a view of press_release teasers, you could use pathauto to set the path alias of all your press_release nodes to something like: /press/node-title and you want to use the Title pane and the Tabs pane for the panel located at /press and all the nodes located at /press/*), you can add something like the following to YOURTHEME_preprocess_page() :
Comment #6
sittard commentedThanks - helped a lot.
Comment #7
sdboyer commentedThere is not and can never be a page-panel-page.tpl.php. Not one that's guaranteed to work, anyway. Panels being a FULLY pluggable system means that no theme function, no tpl, will _always_ be called.
Unfortunately, there's little we can do to make this easier than the solutions already described in this thread; Panels simply can't reach up into the theme layer to make the sorts of modifications being described here. Sorry.
Moving back to fixed.
Comment #9
AdrianB commentedJust wanted to come back to this issue and say thanks to Zach Harkey for the examples in #5, great help!
Comment #10
baff commentedsubscribe
Comment #11
baff commentedComment #12
baff commentedComment #13
elBradford commentedI'm reopening this as a feature request. When using the "Page: title" element, it will only display if "Title type" is set to something, which makes sense. Since, in most page.tpl.php, title is displayed conditionally with
then it should be possible to make the "Page: title" element display what would have been displayed had the title been set to "From pane", even though it would be set to "No title".
I'm also setting this to 7.x. Thanks for your work on this module.
Comment #14
jwilson3I was having trouble getting the sample code in #5 to work correctly for all themes, so instead of using
unset()I'm setting the title to an empty string.Comment #15
jwilson3The major pain point for using the [No Title] option in Panels 3 is that it also takes out the default Window Title, thereby killing SEO. We have this problem on every single project at Bluespark, so acrollet decided to tackle it with a patch for Panels 3 that adds a separate Window Title field. See #2262173: Allow users to manually control window title., your feedback and testing is welcome. It is designed to work with Panelizer full page override as well.
Comment #16
jacquelynfisher commentedNot sure if this will help anyone, but in Panels 3, when creating/editing a Variant for Node Template, you can set the Title Type to "Manual" and then use the substitution %node:title in Title.
This will automatically display the correct node title for "the node being viewed" and allow you to adjust the display of all of the other fields for that node.
Comment #17
rooby commentedThe title type field definitely needs some helper text. It is one of the most confusing options I've seen in Drupal.
I still don't know exactly what it does and it seems I will have to read the code to find out.