By jim0203 on
I want to theme the text that appears on every node and says something like "Submitted by Jim on Tue, 06/17/2008 - 23:00". This seems to be produced by the following code in node.tpl.php:
if ($submitted):
print $submitted;
endif;
So, how do I go about theming this output? What I would like to do first is remove the part that says who submitted the node, and just show the date it was submitted - not the time.
Any suggestions?
Comments
...
For D5, one way is to replace that code in node.tpl.php with something like this:
Using D6, the more elegant method would be to override theme_node_submitted.
I use this code for Drupal 6
I use this code for Drupal 6 to print
Submitted by admin on Saturday, 30 August, 2008 - 13:30<span class="submitted">Submitted by <?php print $name ?> on <?php print format_date($node->created, 'custom', 'l, j F, Y - H:i'); ?></span>This comes in handy.
This comes in handy.
Thanks to both of you; those
Thanks to both of you; those solutions work great.
Is there any list somewhere
Is there any list somewhere that lists the variables you suggested here ? This solution is really valuable for theming.
Like what if i wanted to theme the title of a node and its content ? Not $content because that prints everything. I want to control every aspect.
Yes there is a way to print
Yes there is a way to print out all the values in an easy way without PHP knowledge.
Download and use the Content Templates module.
-----
http://kahthong.com - A blog, personal and showcase site
My blog is proudly powered by Drupal CMS
Exactly what i was looking
Exactly what i was looking for thanks !
But i find it weird that this isnt a part of Drupal by default. No wonder why most Drupal sites look alike when you cant control the output 100% by default.
Err, once you got those
Err, once you got those values right, you dont need Content templates anymore.
Basically those values are from Drupal itself.
You can even use
print_r($node);for node values andprint_r($block);for block values, I THINK?-----
http://kahthong.com - A blog, personal and showcase site
My blog is proudly powered by Drupal CMS
I want to pull the entire
I want to pull the entire content of the user profile out on the end of story nodes based on the user.
So really just want a complete array list of what comes out of $submitted.
How do I find out what that array contains with Devel?
Web Developer
Music Photographer
Theme devleoper?
Have you got the theme developer part of devel activated? It's only in D6, but it should do what you're looking for.