By sinker on
I'm having a hard time figuring out where I am supposed to change things like "submitted by" and how the date on that line is displayed. Currently it displays like:
Submitted by admin on Sat, 06/24/2006 - 3:49pm.Category
I'm hoping to change it to read:
by admin | 06/24/2006 | in Category
Where do I change this?
Comments
One way to customize the
One way to customize the text is to use the "locale" module.
That module lets you translate your web site, but it can be used in another way.
Instead of using it to translate, you can use it to change the text you don't like.
For more details, you can look here : http://drupal.org/node/58610
For the date format, i don't know :/
And for the "global structure" try looking into the theme chapter.
the "submitted by" lline
You sould have done that in the settings page (it's the 'medium' date format which is used), but I don't see a posibility to remove the HH:MM field :-(
So you'll have to edit your theme. Open 'node.tpl.php' and change:
to:
almost there!
Man Amnon, that gets me ALMOST there, but there are some differences between what I'm seeing and what you're seeing.
The theme I'm using doesn't have node.tpl.php in its directory. I assume then that leads me back to the phpTemplate node.tpl.php. And in fact entering what you say does change the wording on my site, so I'm definitely in the right place.
However, you're having me look for this string:
<span class="submitted"><?php print $submitted?></span>But in my node.tpl.php file I don't have that. The closest thing I have is this:
<div class="info"><?php print $submitted ?><span class="terms"><?php print $terms ?></span></div>If I comment that line out and insert your code, it does in fact change the "submitted by" line and the date as I want, but it simply says "in" and is blank instead of printing "in Category" as I had hoped. I'm not fluent in PHP enough to know how to stick that $terms in so it works. any help?
Thanks in advance!
Try changing that to <?php
Try changing that to
if ($submitted) {}Trevor Twining
http://www.trevortwining.info
Trevor Twining
Freelance Drupal Dev
Theme/Modules/Sitebuilding
We got it
That's it! Man, thanks so much everyone.
this doesn't work for
this doesn't work for freetagging. I.e. it messes up the display for taxonomy terms (tags) that come after the user name and date...
any ideas?
thanks!
changing the $submitted for comments
If you're looking to change the username and date for comments add the following code to comment.tpl.php. Change the prefix and the date format to what suits you best. Hope this helps someone!
this code is great, thank
this code is great, thank you -- how can i make it so that the username is not a link but just shown?
print 'Posted by ' . theme('username', $node) . ' | ' . format_date($node->created, 'custom', 'm/d/Y');
I want it to say Posted by Allen but the Allen should not be a link.
Thanks,
Allen
anyone know? thanks
anyone know? thanks
AFAIK only logged users can
AFAIK only logged users can see author's name as a link, not logged users always see only simple text.
Change permissions for "Anonymous"
In 4.7 if you allow Anonymous users to "access user profiles" they will be able to click the link (along with bots/spiders/bears/tigers/oh my!)
-simplymenotu
Tags display
Hi nd_cer,
Can you please tell me how to display tags in this format:
in: tag1 | tag2 | tag3
Thanks in advance
Thanks!
Worked Perfect. Thank you.
adapting code from phptemplate.engine
You might also want to look at phptemplate_comment() and phptemplate_node() in phptemplate.engine to see how to do it while keeping translations and settings:
For nodes (node.tpl.php):
For comments (comment.tpl.php):
Same basic thing as above, but this has a few more pieces. I had to go hunt this down with these requirements, so I thought I'd share.
--------------------
Sean B. Fuller
www.seanbfuller.com
www.tractiv.com
--------------------
Sean B. Fuller
www.seanbfuller.com
great stuff, thanks!
great stuff, thanks!
My Drupal sites:
try: function
try:
within template.php to get what you want with overriding default node_submitted theme in node.module
Add taxonomy
Could you add the taxonomy part to the code above?
Try the "Submitted By" module
http://drupal.org/project/submitted_by
Making my life much simpler
_
Awesome ! :)
Great Link!
Thanks for the link to a great module. Works exactly as I needed it to!