By fishfilet on
I would like to remove the author info from my story posts but I don't want to remove the date with it. All of the info I see about this shows how to remove it but it also removes the date. Right now it looks like this (Posted "dateHere" by "authorHere"). I just want it to show the date nothing else.
Thanks.
Comments
...
i believe this module will do the trick:
http://drupal.org/project/submitted_by
This looks perfect however
This looks great but it is not working with my theme. I think the submitted by is hard coded in my themes node.tpl.php because this module does not work for me. Is there a different variable i put in my node.tpl.php instead of the $submitted variable that is there for this module to work? or can you suggest a few other variables to use? I have tried $date which is better than nothing but it is not formatted how I want the date to be.
Thanks
In this thread,
In this thread,
http://drupal.org/node/642386
cog.rusty proposes a solution. Haven't tried it but it may be worth a try.
"Or, go to your theme's disk directory, create customized copies of node.tpl.php for the content types you want, name them node-contenttype.tpl.php, edit them and remove the print $submitted; part."
...
i'm guessing you want the exact code to use in your tpl.php file - with the variable names to use. not sure i know how to do that, but someone else might.
how about you give us the line of code that this there (the part that is controlling this output) and we can go from there?
presumably it is not the normal thing like this:
<div class="submitted"><?php print $submitted?></div>instead, yours presumably prints each variable individually. show us that statement.
Actualy yes
the code in my node.tpl.php looks like this
<p><?php print $submitted; ?></p>but this outputs the "Posted January 1, 2001 by Tom Jones". I only want the date like January 1, 2009. I don't really even want the time. I tried<p><?php print $date; ?></p>which was close but had the time in 24hr format. I am wondering if there is something i can put in here that will use the formatted output of the above mentioned module because it is awesome or if there is some way to format the output of $date like I want it.I would actually like to know how to do it instead of just being told how so that I can learn but examples are always nice for a slow learner like me.
Thanks.
...
submitted_by module should work for you. not sure why it wouldn't.
you have followed the directions closely and entered new a string like this in content types > page (or whatever the content type is):
Posted on [comment-date] [comment-mon] [comment-yyyy]this is a modified version of what i use. you may need to tweak to get the exact date format, etc. that you want since this is format for comments.
in terms of modifying the php in tpl.php. i don't know how to do that.
If you're like me you don't
If you're like me you don't want to have to add yet another module to the list to perform simple tasks like this. Simply replace
<?php print $submitted; ?>With this:
<?php print (format_date($node->created, 'custom', 'M j, y')) ?>And then you can use the php formats found here http://php.net/manual/en/function.date.php to manipulate the 'M j, y' letters to create any format you like.
Thanks that worked great I
Thanks that worked great I ended up with
<?php print format_date($node->created, $type = 'custom', 'l - F jS, Y') ?></p>which gives me