The core content types provided by drupal are fantastic, however, I want to change a content type name. e.g. I want to change 'story' content type to 'article'. Is there a straightforward and easy way to do it? if yes, an example would be highly appreciated

regards

Comments

vm’s picture

The safest way would be enable the locale.module set up a new site language to replace the story string. Doing so this way insures updates don't reverse this change. more information on how this is accomplished is http://drupal.org/handbook/modules/locale

essentially you will create a new language file, replacing story, with article.

there may be an "article" module in the downloads area as well that may suit your needs.

riz’s picture

veryMisundestood: thanks for the suggestions. I'll try it.

Howver, I tried another solution which apprently works fine for now but not sure if it is going to work in future as well. I replaced all accurances of t('story') with t('article') in the story.module file. is it any sensable? (I believe though that it may cause problems when updating drupal)

vm’s picture

correct when you update those changes will be wiped out. if you use the local module you can change the t('story) = t('article') and this change will be maintained through out upgrading, unless the text of the string is changed in core.

I hear capitalization is going to be in 5.0 thus t('story') will become t('Story') which may require you to change the locale string again. This would be rare.

satori1984’s picture

The easiest way would be waiting for Drupal 5.0 which natively supports editing the node type/title etc.

Another way would be copying story.module, renaming it as article.module, and renaming all "story_*"-functions in it to "article_*". Then you'd have to run a simple SQL UPDATE query to change the node type of existing nodes to "article".

Hope this helps.

riz’s picture

thanks satori. not sure when v5 will be coming out :)

mind looking at my reply to VeryMisunderstood and suggest if it is any close to your suggestion?

satori1984’s picture

VeryMisunderstood's solution is also very useful but I'd advise against using locale.module if only for making such a tiny change. In this case, creating a custom node-type would normally be your best bet.

However, since 5.0 is slowly but surely making it's way to the (virtual) shelves, temporarily using the locale.module as VeryMisunderstood suggested would indeed be the best solution, as upon 5.0's release (hopefully by December), you'd simply have to uninstall locale.module and change the story.module title to "article".

Choosing between flexinode and CCK should be a no-brainer, since flexinode is deprecated in favor of CCK, but as with locale.module, using CCK for making such a tiny change wouldn't be quite the best idea. Also, since a considerable part of CCK will be implemented in core, CCK will become redundant, probably minimising it's chance for support and updates in the not-so-near future.

aozuas’s picture

satori, sorry for bother you in this old topic, but... you said that Drupal 5.0 would natively supports editing the node type/title.
Do you know where can I do that now in admin?

Aleph Ozuas
http://www.ciberarte.com.br
http://www.dzo.com.br

vm’s picture

goto administer -> content types and edit the content type of choice.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

aozuas’s picture

Thanks VeryMisunderstood. Already tried that, but there I cant edit the types "blog" nor "book". Any idea?
And maybe this is not related, but how can I change the word "content" as in "http://localhost/drupal/content/fist-page" to other word?
I know that I can use the "locale" to do that, but want other solution.
Thanks again.

Aleph Ozuas
http://www.ciberarte.com.br
http://www.dzo.com.br

vm’s picture

the alter the word content, you create a url alias using the path.module (part of core) along with the pathauto.module (contrib) to add automation.

with regards to the content types you , if you can't edit the title in administer -> content types, as you can with other content types, then you have to use CCk and create your own content types and chose any title you want.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

aozuas’s picture

Thanks again VeryMisunderstood, now I am in the way!

Aleph Ozuas
http://www.ciberarte.com.br
http://www.dzo.com.br

Jeff Burnz’s picture

riz’s picture

seems like good idea but then I am not sure how good you should be with php to use CCK?
and what is preferable, CCK or flexinode???

vm’s picture

CCK as its becoming part of core on some levels.

Jeff Burnz’s picture

CCK, that's my pick, you don't need to know a lot of php, if any - if you can point and click and understand what you are doing you can use CCK. I found the biggest challenge styling CCK types, but used with the Contemplate module this becomes a lot easier.

Flexinode is nice to, but support will wane as CCK basically supercedes it. There a good comparison on this site, I think it's in the handbooks.

Theres also a tonne of info on the forums as most of the 'how to with CCK' type questions are well answered:)

Bevan’s picture