Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Ndesign on
I would like to remove the trimmed version from node preview. I can set the length of trimmed posts to Unlimited and that will remove the trimmed version everywhere... but I would like to remove it only from Preview... Thank you
Comments
I need this as well. Any
I need this as well. Any ideas?
disable code in "node.pages.inc"
in modules/node/node.pages.inc, starting line 388:
Ugly solution I admit, but it works, and I've searched for too long for a solution for myself without sucess so far...
theme_node_preview()
I managed to do this with the following function in my template.php remember change 'theme' to your theme name. I commented out the sections that deal with the teaser. you could also do this on a per content type basis using the $node variables available here.
web Kreator
this one is working
Thanks ChrisNelson for the solution.
cheers!
Works perfectly, thank you!
Works perfectly, thank you!
+1
Thanks, works great :-p
thanks
I was getting crazzy!!
if it doesnt work, maybe it is because you need to empty the cache!!
@ChrisNelson thanks a lot! :)
//trying to answer one question for each one that i make.
//this way, drupal will be more friendly and strong
Is this for Drupal 7? Its not
Is this for Drupal 7? Its not working for me. Thanks
Works in Drupal 7. You need
Works in Drupal 7. You need to Clear all caches as stated above.
Still not working for me. Ive
Still not working for me. Ive updated all modules and core, flushed cache, changed the first line to function zen_node_preview($variables) { (im using the zen theme but without any sub themes). Have I missed anything? Thanks
Zenophile was playing up so I
Zenophile was playing up so I didnt bother to create a zen sub theme. After creating a sub theme the code works fine.
Stopped working again! It
Stopped working again! It seems this code doenst play nice with zen.
Will leaving the line $node =
Will leaving the line $node = $variables['node']; as it is work for all content types or do you need to specify the content type? Thanks
This code now working.
This code now working.
http://drupal.org/node/1782016
It works!
It works great!, thanks
If this is not working then check if you are using admin theme for content management. YOURTHEMENAME_preview()
1st Drupal 8 backend specialist acquia certified in Perú!
CTO / Software Architect / Senior Developer
Shortened version - unused code removed
Following is my shortened version to just output the full node as a preview which I've tested in template.php and works.
If your going to hack it why not reduce it as well?
If there are any reason why cutting out the unused code is a bad idea someone let me know please.
invent logic, Worked like a
invent logic, Worked like a charm!
Thomas Newman
UI Developer
https://cmstom.com
Thank you inventlogic
Worked perfectly. Thanks for posting, inventlogic.
Works great, thanks! Can we
Works great, thanks! Can we also change for the title to show the updated title?
For me, it's just showing "Preview".
Works
code from chrsnlsn
This worked for me. For folks who may not be familiar with the template.php file, here are some things you might need to know:
1. If you're using a sub-theme, go to the template.php file inside your sub-theme folder. This is found in /sites/all/themes/[your-theme]/
2. Add the code to the "page template" part of the template.php file, not the "html template" or "node template." For a Corolla sub-theme, it goes in the section labeled "Override or insert variables for the page templates."
3. Verify that you have changed the first line to use your theme name, such as: function YOUR_THEME_node_preview($variables) {
4. Make sure you clear the cache before you test.