I am the only author on my site, and I would like to remove the 'Submitted by name'-info on Story nodes, but not the date-info, is this possible?
I'm using an xtemplate based theme running Drupal 4.6.5

Thanks,
Mikkel

Comments

Lostmonkey’s picture

Anyone?

dublin drupaller’s picture

HI Mikkel..

(since nobody else answered)

It's possible and I think it's fairly simple to do using a phptemplate based theme..but not so sure how to do it in an xtemplate based one.

As a total shot-in-the-dark and seeing nobody else answered, is it possible to switch display:none in your stylesheet for the "Submitted by" tag? As I said, it's a totally wild guess...if you don't know, have a look at your page source when looking at a story page.

As an aside: I know it's not much help with your current query, but, it's worth considering converting your theme to a phptemplate based one at some stage. more people are using phptemplate and it's the default theme engine on Drupal 4.7, so you will find it not only easier to do stuff, but, more answers and support because so many Drupallers are using it.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

dublin drupaller’s picture

Hi again,

I was working on something in Drupal 4.6.5 and had a quick look at the xtemplate.engine file in the THEMES/ENGINES/ folder. One way is to hack your xtemplate.engine file to only display the date:

change line number 43 from this:


theme_get_setting("toggle_node_info_$node->type") ?
                         t("Submitted by %a on %b.",
                           array("%a" => format_name($node),
                            "%b" => format_date($node->created))) : '',

to this:

theme_get_setting("toggle_node_info_$node->type") ?
                         t("Submitted on %b.",
                           array("%b" =>format_date($node->created))) : '',

That will remove the Submitted by [user name] on [date] and instead display just Submitted on [date]. You can obviously change the "submitted on" text to what ever you want.

note: from what I can gather (I only looked at this very quickly) that only affects nodes. Comments will still display the submitted by stuff..

hope that helps. there are probably other ways of achieving the same result, but, I know how frustrating it is to ask a question and get no responses, so I thought I would mention the above.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Lostmonkey’s picture

Thank you for replying. I think I will see if I can convert my theme to the phptemplate engine, if this is going to be the standard from now.
My theme is based on the 'bluemarine'-template, so if it is possible without too much work, I'll convert.

Mikkel

dublin drupaller’s picture

Hi Mikell,

Bluemarine has already been converted to phptemplate.

if you're using Drupal 4.6.5 or earlier, you need 2 things. the PHPTEMPLATE ENGINE and the PHPTEMPLATE version of BLUE MARINE.

It shoulld be a very straight-forward conversion. Suggest making a new /blue2/ folder to upload the phptemplate theme instead of overwriting your current xtemplate version.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Lostmonkey’s picture

Hi Dub,

I'm trying to do the conversion, however there are a few small things I can't work out with the Bluemarine-phptemplate.

1. I don't use a logo in my header, so I've unchecked 'Use the default logo' in the theme configuration. However now instead of a logo there is a link 'Home', that I don't know how to get rid off?

2. Although I have disabled 'add comment' there is still a '»' sign at the end of each post, and this creates unwanted space between my postings.

Do you (or anyone else reading this) know how to correct this?

Thanks,
Mikkel

dublin drupaller’s picture

Here's a quick solution:

To stop the logo problem:

Open the PAGE.TPL.PHP file in a text editor and replace this line:

<a href="./" title="Home"><img src="/<?php print $logo ?>" alt="Home" border="0" /></a>

with this:

<?php if ($logo) { ?><a href="./" title="Home"><img src="/<?php print $logo ?>" alt="Home" border="0" /></a><?php } ?>

To remove the >> thing at the bottom of your nodes..open up the NODE.TPL.PHP file and replace this line:

    <div class="links">&raquo; <?php print $links?></div>

with this:

    <?php if ($links) { ?><div class="links">&raquo; <?php print $links?></div><?php } ?>

By the way...while you've got the node.tpl.php file open. Save the change mentioned to remove that extra >> at the bottom of your nodes and upload it to your thme folder.

Then rename it to node-story.tpl.php and change the line that says print $submitted or something like that to this:

<?php print format_date($node->created) ?>

by renaming it to node-story.tpl.php you are making a copy of the default node layout and by calling it node-story.tpl.php it means Drupal will automatically use that layout file to display STORIES.

You can do the same for blogs..i.e. create a node-blog.tpl.php file and put it in your theme folder..and so on.There's a pretty extensive phptemplate section in the Drupal handbook if you're looking for more..

I hope that makes sense. And is of use.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Lostmonkey’s picture

I thank you again, it works like a charm.

:-) Mikkel

euchrid9’s picture

The above tip is a great help. I combined the part about changing the $submitted line to:

<?php print format_date($node->created) ?> 

with the advice athttp://drupal.org/node/9989 about configuring the date and time format, and produced this:

<?php $date_type = 'custom';
$custom_type = 'l jS F Y';
print format_date($node->created,$date_type,$custom_type);
 ?>

This gives me the output: "Tuesday 10th January 2005" (for example). I used the information at http://uk.php.net/date to configure it to my liking.

Using this method, you don't have to change the time settings in Admin if you want to keep them for other nodes, etc.

I have found I get much more control and easier configuration by changing and creating new node.tpl.php files. I would further suggest that copying the 'story' node and module and re-naming them, you can then try out various tricks without messing up the original 'story' node,just in case you want to go back to it...

[euchrid]
www.euchrid.co.uk

venkat-rk’s picture

Thanks for the two great tips about the logo issue and removing the arrows at the bottom when there are no links.

venkat-rk’s picture

Hi Dub,

Is there a way to fine tune this code (for removing the >> at the bottom of the links) a little?

I had changed the default bluemarine way of displaying taxonomy terms (it spans the 'submitted by' info) to something neater like this, where the terms appear on their own line at the bottom.

When I use your code, the extra >> do disappear, but the taxonomy terms are back to their original position again.

In this context, I would be grateful if you could show us a way to split the links in a standard phptemplate theme such as bluemarine. The default display is:

» add new comment | read more | 16 reads

How can it be made something like:

» read more
add new comment | 16 reads

A similar request was posted at:
http://drupal.org/node/44435

----
Acknowledging a reply to your question motivates the replier to answer more.

tenjindaira’s picture

Just for those (like me) finding this post when trying to remove the display of either author, date, or both from any content type that is not "page".

I eventually found the relevant settings in Administer > Site building > Themes > Configure > Global Settings.

crbassett’s picture

That actually removes everything. The original post wants to remove only the author...something I'm trying to figure out. It used to be easier, but it changed...