Page 1 of 1

Default Content Type [solved]

Posted: Wed Sep 05, 2007 7:48 pm
by aozuas
I am using the CMSMS1.1.1 version.

Just finish a project for a client and now he will enter his portfolio into the site.
I installed the module Catalog to publish the portfolio.

My doubt: is there a way do define a Default Content Type like we define a default template? Then I can define Cataloger Item as the default Content Type to optimize the work of my client. I even tryed something like the following example, without success:

http://www.mysite.com/admin/addcontent. ... atalogitem

Any idea? May be hard coded?

Aleph Ozuas
www.ciberarte.com.br
www.dzo.com.br

Re: Default Content Type

Posted: Wed Sep 05, 2007 8:09 pm
by RonnyK
You might want to try editing "addcontent.php", somewhere down there is:
#Get current userid and make sure they have permission to add something
$access = (check_permission($userid, 'Add Pages') || check_permission($userid, 'Modify Page Structure'));

#Get a list of content types and pick a default if necessary
global $gCms;
$contentops =& $gCms->GetContentOperations();
$existingtypes = $contentops->ListContentTypes();
$content_type = "";
if (isset($_POST["content_type"]))
{
$content_type = $_POST["content_type"];
}
else
{
if (isset($existingtypes) && count($existingtypes) > 0)
{
$content_type = 'content';
}
else
{
$error = "No content types loaded!";
}
}

Where the red-part is the default (my guess!!) I couldn't see quickly where the "(isset($_POST["content_type"]))" gets its value!

Ronny

Re: Default Content Type

Posted: Wed Sep 05, 2007 8:48 pm
by aozuas
RonnyK, you are the man! Worked wonderfully, thank you!

I just change that line:

Code: Select all

$content_type = 'content';
for that one:

Code: Select all

$content_type = 'catalogitem';
Aleph Ozuas
www.ciberarte.com.br
www.dzo.com.br

Re: Default Content Type

Posted: Thu Sep 06, 2007 6:58 am
by RonnyK
Aleph,

if this topic is solved, will you mark the subject of the first post to [solved], by modifying the first post.

Be aware that upgrades, will overwrite your changed code. So in case of an upgrade, you have to redo the editing of the code.

Ronny