0

I've got one content type, in the teaser I've limited the chars lenght for title and body through a script in the file .tpl.php

<?php $limited_title = (substr($title,0,60)); 
    print $limited_title."..."; ?></h2>

For the same content type I've got two views, both in "content" mode with a different filter criteria. What I wanna do is to have one view showing 60 chars of the title and the other view showing 100 chars of the title. Is it possible to create two different node.tpl.php like we do with the view giving the name of the page? like node--mycontentType--page-1.tpl.php.

if it's not, what the best way to get the result I want?

No javascript please.

Thanks in advance.

1 Answer 1

1

I think the best way is to change this by clicking the title field in the views page and using the "Trim this field to a maximum length" option under "Rewrite results". You can set it to 60 for the first view and 100 for the other.

1
  • I'm not using a view with fields. I could change it from the content type page -> display fields, but it's going to affect both. Jun 11, 2012 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.