I'm trying to duplicate a static site in Drupal. I've started adding static pages and linking to them using the menu module. One thing I'd like to change is to remove the "Submitted by..." and the timestamp info from the top of each page. Can this be done?

Thanks,

Ryan

Comments

killes@www.drop.org’s picture

Please search the site before asking.

ryan408’s picture

You're right. A simple search found the answer for me.

Sorry,

Ryan

eva’s picture

how exactly does one remove the "submitted by" line from static pages?

i went into my xtemplate.xtmpl file and there was no

node {static} section, just a regular node section with the "submitted by" lines.

i tried copying and pasting the code offered at
http://drupal.org/node/view/6372

but nothing happened - what is missing???

thank you,
eva

ti’s picture

Eva, you can delete the lines showing author and timestamp from the theme.

GMHilltop’s picture

I am slowly learning the ropes here and "a simple search" hasn't shown me where it is I can go to remove the "time stamp and author" from being printed. I am still learning how to use PHP as well, but I am slowly getting it.

Ideally what I'd like to be able to do is decide for myself if I want all 3 of these to appear on the site: Author, Time Stamp, AND the page title (or content type's page title - if I happen to create a separate content type).

Can some one point me 'specifically' to where this information can be found (rather than tell me to do a 'simple search'). Any help would be greatly appreciated. Thanks

knu’s picture

Admin -> Site Building -> Themes

And then click the configure tab at the top of the page.

The 'Display post information' for each content type is on the right of the page.

Not sure about page title settings, but I think there's a module that does it.

GMHilltop’s picture

I had to click on the Admin -> Site Building -> Themes -> Configure (or if you did like I did) Admin -> Site Building -> Themes and clicked on the 'configure' link beside the theme you were using, you'll have to then click on the "Global Settings" link near the top to get this to show you the area where you could select it for each content type you create. [I know, if there is a hard way to do something - I seem to find it pretty quick ;-) ]

.... but that's the easy way.

For those who are curious about the hard way to do it (I got frustrated and did it this way - but I learned a little more about how drupal works)

I edited the node.tpl.php file and commented out these lines:

<?php if ($page == 0) { ?><h2 class="title"><a href="<?php print $node_url ?>"><?php print $title ?></a></h2><?php }; ?>
<?php if ($submitted) { ?><div class="submitted"><?php print $submitted ?></div><?php }; ?>

That got rid of it off the page.

But to get rid of the title from showing up on all the other pages I also had to go to this file:

page.tpl.php
and comment out this line:
<h1 class="title"><?php print $title ?></h1>

For those who don't know, I commented out these lines by entering in:

<?php /*

before those lines, and:

*/ ?>

after those lines of code.

Thanks for getting back to me on this though knu! I know it will help someone else like me in the future.

EDIT:

FYI: If you DO do it the hard way, It will remove the Title of your Node from appearing on the page, which is what I was also aiming to do.

Knu -- If you know of an easier way to prevent this from happening, could you post it for us? Thanks.

knu’s picture

I think going through the theme is the best way of getting rid of those titles.

The module(s) I was trying to remember did not do the job because they apply to forms, not node displays - as you wanted. One was Automatic Nodetitles (http://drupal.org/project/auto_nodetitle) and the other Node and Comments Form Settings (http://drupal.org/project/nodeformsettings). I can't find a module that removes the title from the display of a node.

It is possible to remove the title using views though. Create a page display with an unformatted style. Give the display a path. Select which fields you want to show. And allow it to accept a Node ID as an argument.

Doing it this way you are very much at the mercy of Drupal's way of rendering fields. If you want full control over how things are displayed then I reckon it's best to do as you did, and control things through the theme layer (and perhaps a bit of css editing too.)

You are probably aware of this (but just in case you're not) - you can use the theme template files to act only on a single content type. If you copy node.tpl.php to node-blog.tpl.php then every time drupal hits a blog node the content will be rendered through the node-blog.tpl.php template - all other nodes will default to the node.tpl.php file. (I think this is how it works - never done it myself!) This way you could selectively hide the title for certain content types. And I think you can do a similar thing with page.tpl.php. I'm sure there's plenty of documentation around...

As for hiding the posting info, I'll stick to the easy way ;-)

(Unless, of course, I only want to hide it for blogs.)