By acostanza on
I'm using 4.6 and friendselectric theme running on the PHPtemplate engine. I was wondering if there was an easy way to choose whether a post would have the authors name and date/time stamp below it or not when it is published.
I can take out the print call in "node.tpl.php" to make it so none of the nodes have the author and date, but I was hoping there would be a way to choose this option during authoring the node.
Ideally, I could set it so some users, anonymous lets say, have to have their names and time show up, but others, like admins, could take it away.
Any ideas?
Thanks in advance,
-Adam
Comments
it's simple
Make a copy of node.tpl.php and rename it node-page.tpl.php or something else and the remove the print call from the file. that's it.
You give permissions of story module to users so that their post consists of author and time stamp.
You use page module for the posting so u won't be having the author and time stamp.
Note:This trickc applies to every node, i mean node-story, node-forum, node-weblink, node-image, noe-blog etc.
Cheers,
Sunny
www.gleez.com
WOW!
Now that is amazing! I've got a lot more to learn about PHP :)
Thanks for the tip!
-Adam
www.ratetheworld.com
Thanks
Thank You
Sunny
www.gleez.com
is there a way to take it
is there a way to take it off of the Interlace theme?? I really hope so...
i think not possible
I think it's not possible like i explained above.
if want to remove it for every node it can be possible and simple.
If u can delete the line starting form 134 - 153 ( span class="nodedate - output = span) from interlaced.theme file that's it.
U won't get the submitted and date on every node.
If you can convert the theme to php tempalte based theme is another way. I don't about the other possiblities.
Sunny
www.gleez.com
thanks for the help, thats
thanks for the help, thats what i thought also ;)
Welcome
Sunny
www.gleez.com
Another way to remove this info without coding is
to go to admin/themes/settings
You can choose to display or hide the "submitted by Username on date" text for every node type.
This works with every theme, whether phptemplate based or xtemplate based.
This is a blanket solution, however -- it does not give individual users the option to display this info.
Cheers,
bonobo
-------
http://www.funnymonkey.com
Tools for Teachers
-------
http://www.funnymonkey.com
i tried this but no result
It's not working perfectly with every theme.
few custom themes it didn't work at all.
contributed themes i have checked it long back not worked with every theme.
Sunny
www.gleez.com
Thank you bonobo
Thank you bonobo! It worked perfectly :-)
There's this:Customize
There's this: Customize display of submission information based on node type.
MARVIN template, how to get rid of AUTHOR and TIME STAMP ?
Hello,
I'm using MARVIN template but I can't find the files for this THEME on the THEMES folder (but I see bluemarine, chameleon, etc...) so I don't know how to get rid of the time and author stamp ?
I know how to do it when I can find the NODE.TPL.PHP but as I find no files for marvin... ?!
Thanks.
Where is the Marvin theme?
The marvin theme can be found within the chameleon theme (i.e. inside that directory in the default installation)
The code that drives marvin is found in the chameleon.module file (open it with a text editor to see it)
BUT, to control the author settings in this theme see the post above from bonobo.
administer - themes - configure (by the theme you use) - Look for 'global settings' near the tabs at the top of this page, and the author settings for each node are there.
Hope this helps
is it possible to remove
is it possible to remove only the time part of the date ?
remove only time
hi,
is possible to modify node.tpl.php as follow
Here's what this displays: Fri, 23/11/2007 submitted by xyzxyz
For all code in order to format as you want date please see at
http://us3.php.net/manual/en/function.date.php
how about formating the
how about formating the Forum date stamp, that one appears separate from the main one
Thanks for the code!!
Thanks for the code!!
---~~~***~~~---
aac
Very Good Template Tip!
Sunny, Thanks for that page template trick. Very helpful for simple page display modifications.
Is that hint documented anywhere?
--Toby
Use CSS Injector
In case anyone stumbles across this old thread. We recently had a request from a Drupal 6 customer to provide a means to disable Author & Post date for specific nodes.
Now the non-technical admin can just add and remove paths to disable the display of the submitted data.
Definitely good to know that
Definitely good to know that CSS Injector exists but this doesn't remove the "author" and "time" specifically as requested - it removes the entire submitted field.
Assuming your subtheming,
Assuming your subtheming, copy the node.tpl.php file from your main theme. In omega this in in omega/themes/templates/node
Paste this file into your theme's template folder so it looks like this
yourtheme/templates/node.tpl.php
Find the code in node.tpl.php that looks like this [as seen in omega, assume it's similar in other themes]:
<p class="submitted"><?php print $submitted; ?></p>Replace it with
This will then show:
Posted on Friday 25th of April 2014
Replace the "Posted on " or the double-quoted section in date(" ") with whatever you like from the php manual examples here
Thanks to Danny Englander for providing the fundamentals
Without coding, using Display Suite and Date module
Without any coding, if you’re using display suite. With Date module installed.
Set up a new Date Format
Go to Configuration > Date and Time
Select the Formats tab in top left
Add a for such as
\P\o\s\t\e\d\ \o\n l jS \of F Y
The first part will produce “Posted on”
The second part (l jS \of F Y) will produce "Friday 25th of April 2014”
i.e. Posted on Friday 25th of April 2014”
Click Add Format
Go back to the Date and Time > Type tab
Click Add Date Type, give your date type a name, e.g. “Friendly Date". In the Date Format dropdown, your new format should be at the bottom of the list, e.g. Friday 25th of April 2014
Add the Post Date to your Content Type
For the content type your working with e.g. Article, go to the Edit tab and deselect "Display author and date information”. Press Save
Then go to the Manage Display tab.
Go to Custom Display Settings and tick the view modes you want to see e.g. Full Content and Teaser. Press Save
Go to Full Content, or whatever view mode you created
If Display Suite is enabled, it should say Layout for article in Default. Choose a One Column layout to keep things simple. Press Save
You should now have a lot more fields available to add to your content type. Drag Post Date up to the Content section.
In the format box for Post date you should see your date format (e.g. “Friendly Date”) that you created above with your custom text. Press Save
Your content for that content type should now display your "Posted on …” date field at whatever position you dragged it to.
I find this method easier for customisation. I can produce multiple date format to say what I want and reuse them, but I’d like to know how to get to the post date field without using a Display Suite layout.
The most easy way
navigate to: structure/content types/->(edit)/Display Settings and un-check "Display author and date information."
in Drupal 7
You saved my life
Thanks for this amazing info!