Converting from one class to another

Author Message

Ciaran McGrath

Friday 12 January 2007 7:42:52 am

Hi,

I have a small problem with some content in Ez publish.

We have two content classes that are very similar and there are a number of objects using both classes. Ideally we need only one class to do the job so that we don't have to rewrite all our templates.

Is there a way to convert a bunch of objects of one content class into another class and map the attributes from the old one to the new?

I hope this makes sense. Any help you can offer is greatly appreciated.

Mark Marsiglio

Friday 12 January 2007 7:56:59 am

There is a community contribution that helps with this by converting one datatype to another, but in general it is not that easy. http://ez.no/community/contribs/datatypes/datatypes

It may be a better alternative to adjust the classes so that they have the same attribute names, and then use the same override template for both classes. Then, if you take one of the two classes out of the content group, it cannot be used to add any more content in the future, but it will not affect the existing content.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Kristof Coomans

Friday 12 January 2007 10:34:49 pm

There's a similar thread: http://ez.no/community/forum/developer/change_object_content_class

Let's go on with the discussion there ;-)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.