What I want to do is remove the title of a specific content type from where it normally shows throughout the site and print it somewhere else in the template.
I have a custom node.tpl.php for the content type, lets call it node--custom-content-type.tpl.php and it sits within a little submodule I made for this content type and section on the website. Let's call that mycustom_subtheme. I have also created a custom page.tpl.php, page--custom-content-type.php.
I was able to successfully re-print the title later on in the template, thanks to Aram's explanation here, by putting <?php print $title; ?>
after <?php print render($content); ?>
. I'm looking to find a way to remove it from it's original section just for this content type; See screenshot below.
Things I've tried:
I tried the Exclude Node Title module, but as I feared, it actually renders the title null, which isn't suitable for my purpose of retaining the title but just moving it. For this reason, this post isn't what I need.
I tried
hide($content['title']);
andhide($title);
just to see if that would work in node--custom-content-type.tpl.php.I tried moving the
$title
data to something like$title2
and then replacing$title
with "Custom Text" but am not sophisticated enough to pull that off.I tried adding custom CSS to no avail (the title is H2 in my node template):
body.node-type-custom-content-type h2.title, {display: none;}
And finally, I even tried all the suggestions here. At the very least, copying the page.tpl.php and removing the title should have worked.
Here is a pastebin of my codes: custom node template and custom page template
Does the original node.tpl.php
inherit the title anyway if node--custom-content-type.tpl.php
simply doesn't mention it?
node--mycontenttype.tpl.php
, does it still show up?What about node.tpl.php filling in the title anyway
If node--mycontenttype.tpl.php exists for that content type, then node.tpl.php never gets loaded, so this can't be it.