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.
Hello ive always wantedto use the body field as the title but obviously due to length that isnt the way togo. Is there anyway that i could just show the first x amount of charcters per title?
Thanks
Comments
Comment #1
fadgadget CreditAttribution: fadgadget commentedif no one minds ill post a link to a possible answer.Im too wrapped up n other things to look at it for now
http://mydrupalblog.lhmdesign.com/truncate-drupal-view-node-title
ps im looking at truncating the page.tpl title output on D7
Comment #2
fadgadget CreditAttribution: fadgadget commentedFollowed the instructions on this page to no avail
https://drupal.org/node/283830
Ive turned php filter on and the php is just returning a blank. I also followed the examples at the end of this post but again its just not happening for me. stadard body text and standard title.
https://drupal.org/node/369694
Comment #3
fadgadget CreditAttribution: fadgadget commentedI dont know if this is related but it seems relevant. what i REALLY would like to do is to just remove the Title field and replace it with my own title field (field_mytitle) This is so as i can hide the title field if needed, with conditional fields module.
Then truncate it from the body field if the title field is left blank.
I will have a play about :hope
Comment #4
markgifford CreditAttribution: markgifford commentedfadgadget: Check out the Title module (https://drupal.org/project/title).
Comment #5
fadgadget CreditAttribution: fadgadget commentedthanks Mark i dunno how i missed this. Ive looked at the module you suggest before and it didnt seem to want to do the job. Ive a feeling that it could be easier just editing my node tpl i think but thats as much as i know. Going to play about with
?>
and
print render($title_prefix);
if (!$page):
print $title_attributes; > print $node_url; " rel="bookmark">
print $title;
I think if they where joined it would do the job for me. I'll advise folks how i get on but it is gonna be a bit random on my par :(
Comment #6
fadgadget CreditAttribution: fadgadget commentederrr thats not posted too well. Gonna be nothing on the mess i make of my site in a sec
Comment #7
fadgadget CreditAttribution: fadgadget commentedps for the record ive got rid of the original body field and havee created a new field_text. Auto Entitity Label is rewritting the title field with the token
[node:field_text]
There might be even something i could add to the token to restrict the title field length.
Comment #8
fadgadget CreditAttribution: fadgadget commentedduplicate of
https://drupal.org/node/2120055