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

fadgadget’s picture

if 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

fadgadget’s picture

Followed 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

fadgadget’s picture

I 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

markgifford’s picture

fadgadget: Check out the Title module (https://drupal.org/project/title).

fadgadget’s picture

thanks 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

<?php
$output = truncate_utf8($output,25,FALSE,TRUE);
print $output;

?>

and

<?php if (!empty($title_prefix) || !empty($title_suffix) || !$page): 


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 :(

fadgadget’s picture

errr thats not posted too well. Gonna be nothing on the mess i make of my site in a sec

fadgadget’s picture

ps 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.

fadgadget’s picture

Status: Active » Closed (duplicate)