tag:help-archives.hannonhill.com,2010-02-09:/discussions/web-services/1437-changing-content-type-sitewideCascade CMS: Discussion 2015-04-28T12:45:49Ztag:help-archives.hannonhill.com,2010-02-09:Comment/354290462014-12-02T17:19:27Z2014-12-02T17:19:27ZChanging content type sitewide<div><p>Hi Dave,</p>
<p>I hesitated to reply to this post because you told us that you
are not a programmer. Working with web services does requires some
intermediate (if not advanced) skills in programming. But if you
can talk to a programmer, maybe I can give you more information to
help him.</p>
<p>Changing the content type associated with a page is easy. The
hard part is to retain information related to blocks and formats
attached to regions at the page level. My library (specifically,
the Page class) does take care of this for the default
configuration ONLY. To change the content type sitewide, I would
use <code>AssetTree::traverse</code> to traverse a site (the Base
Folder), and modify every page inside. Here are some pointers:</p>
<ol>
<li><a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/classes/asset-classes/page.php">
Page</a>, look at <code>Page::setContentType</code><br></li>
<li><a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/classes/asset-tree/index.php">
AssetTree</a><br></li>
<li><a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/recipes/asset-tree-recipes.php">
AssetTree Recipes</a></li>
</ol>
<p>To answer your other questions:<br>
1. Modifying page won't change ownership/permissions, unless you
intend to do so by writing more code.<br>
2. You can call <code>Page::setContentType</code> through a single
page object, or you can traverse a folder to modify every page
inside. This can be applied to the Base Folder. After all, a site,
represented by the Base Folder, is just a folder.</p>
<p>Wing</p></div>Wing Ming Chan