Default Content Type [solved]

Talk about new features for CMSMS and modules.
Post Reply
aozuas

Default Content Type [solved]

Post 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
Last edited by aozuas on Thu Sep 06, 2007 9:24 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Default Content Type

Post 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
Last edited by RonnyK on Wed Sep 05, 2007 8:12 pm, edited 1 time in total.
aozuas

Re: Default Content Type

Post 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
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Default Content Type

Post 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
Post Reply

Return to “Feature ideas”