I'm designing an app to create a kind of SWF ads.
I want to make use of AMFPHP for the front end and CMSMS for the back end.
The ads will be displayed on the frontpage using a tag which requests an amf service.
The service will be handled by a custom cmsms module.
I've got one question about this:
How do I create a content type module?
The http://wiki.cmsmadesimple.org/index.php/User_Handbook/Developers_Guide/Module_Tutorial does mention this kind of module but there are no details...
Maybe someone out there can give me some info.
Thanks,
Rob
How to create of a module for a new content type
Re: How to create of a module for a new content type
Create a Module as described in the doc (or download skeleton module or modulemaker).
At first you need to "register" your contenttype to the CMSms core.
This is done in the [ModuleName].module.php.
There is a funtion called SetParameters:
Then create a file called contenttype.[NameOfYourContentType].php.
The File starts with a class declaration:
Take a look into the file lib/classes/contenttypes/Content.inc.php to figure out how to create a contenttype file.
If you don't need the module but just the contenttype you also can just copy and modify that file.
After that your contenttype can be selected when adding or editing a page.
Hope that helps.
At first you need to "register" your contenttype to the CMSms core.
This is done in the [ModuleName].module.php.
There is a funtion called SetParameters:
Code: Select all
function SetParameters()
{
$this->mCachable = true;
$this->RegisterContentType('NameOfYourContentType', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'contenttype.[NameOfYourConentType].php', $this->GetFriendlyName());
}
Then create a file called contenttype.[NameOfYourContentType].php.
The File starts with a class declaration:
Code: Select all
class NameOfYourContentType extends CMSModuleContentType
{
...
}
Take a look into the file lib/classes/contenttypes/Content.inc.php to figure out how to create a contenttype file.
If you don't need the module but just the contenttype you also can just copy and modify that file.
After that your contenttype can be selected when adding or editing a page.
Hope that helps.
Last edited by NaN on Tue Nov 04, 2008 3:54 am, edited 1 time in total.
-
- Forum Members
- Posts: 75
- Joined: Wed Aug 20, 2008 2:08 pm
- Location: Nijmegen, the Netherlands
Re: How to create of a module for a new content type
Hi NaN,
Thank you, I'll give it a try this week. Hope I get it working.
Cheers,
Rob
Thank you, I'll give it a try this week. Hope I get it working.
Cheers,
Rob