I have a view that appears as the following table:

Title            Content type          Published 
title1           content type 1          yes
title2           content type 2          no
title3           content type 3          yes

I want to be able to use a custom string instead of the content type name. My view should be like the following:

Title            Content type          Published 
title1           my content1             yes
title2           contents for all        no
title3           other content           yes

I don't know is it's possible to do this with Views. I don't want to change the name of content types, I only want change them in the view.

Is it possible?

1 Answer 1


Override the template file of you 'Content type' field for your particular view, and code in it.

switch($output) {
  case 'content type 1':
    print 'my content1';

  case 'content type 2':
    print 'contents for all';

  // ...
  • Thanks for your answer. I forgot to say you that this code was useful for me in the template "templateview.tpl.php" of the view, no in the template "contentype.tpl.php" of the content type. Thanks again.
    – cabita
    Sep 4, 2011 at 3:02

Your Answer

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

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