Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
More things are output than just the items I enter for the template. For example, I'm modifying the teaser code, and even if I just print "hello", the title, "Submitted by", "Add new comment" link and "Read more" link are all output.
How can I output JUST what I put in the template?
Thank you!!
Comment | File | Size | Author |
---|---|---|---|
#2 | Picture 3.png | 17.83 KB | jrglasgow |
Picture 8.png | 21.97 KB | .kuma |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedI am no expert and am basing on v5 but :-
You are not theming the "title" you are theming what will appear in the body
"Submitted by", "Add new comment" link and "Read more" link
These are controled in the Theme configuration on a content type basis, again not contemplate
Comment #2
jrglasgow CreditAttribution: jrglasgow commentedif you go to (in your drupal install)/admin/build/themes/settings there is a section "Display post information on" with a list of node types. This determines which nodes display who posted it and when.
The only way to get rid of the other stuff, title, add comments link, read more link, etc... is to change the node type's template file. Put your template files in your theme's directory and clear you cache.
Comment #3
.kuma CreditAttribution: .kuma commentedThank you both for the reply. I was able to get the post information to go away following your advice.
I have an idea about how template files work, although don't understand the process 100%. If a template file of some name is found in the theme directory, then it will use that? Is there a list of possible template names? Is that the link you provided? - http://drupal.org/node/190815#node-suggestion
Thanks!!
Comment #4
lameei CreditAttribution: lameei commentedFor getting rid of the title i have created a node specific template file and then removed the title variable from there. Now the title is removed from the teaser view but in full node view it is still there.
How does it possible to get rid of that?
Comment #5
jrglasgow CreditAttribution: jrglasgow commentedThis will set the title to an empty string, in the HTML the
<h1></h1>
tags will still be there but it will be empty.Comment #6
lameei CreditAttribution: lameei commentedThat's it. thanks for reply.
Comment #7
Aren Cambre CreditAttribution: Aren Cambre commentedPlease let Content Templates handle all of a node's output, including overriding the default header and footer.
The previously proposed solutions can't work for me; I need to maintain this output for all content for which I am not specifying a content template. Also, they still allow empty
<h1>
tags and don't eliminate the taxonomy or Add a comment links below the body.If this is not possible without Drupal core API changes, let me know so that I can request them separately.