[SOLVED] Changes to the content types of CMSms 1.6
[SOLVED] Changes to the content types of CMSms 1.6
Hi everybody.
Since something has changed to the content types of the CMSms 1.6 it seems to be that some modules content types (like album module) does not work anymore.
The pages disapear in frontend as well as in backend and the content type is missed in the content type dropdown.
I tried to modify the album content type (adapting to the new content types of CMSms 1.6) but without any effect.
Is the module API still up to date?
Did i miss something?
Since something has changed to the content types of the CMSms 1.6 it seems to be that some modules content types (like album module) does not work anymore.
The pages disapear in frontend as well as in backend and the content type is missed in the content type dropdown.
I tried to modify the album content type (adapting to the new content types of CMSms 1.6) but without any effect.
Is the module API still up to date?
Did i miss something?
Last edited by NaN on Tue Jul 14, 2009 5:47 pm, edited 1 time in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Changes to the content types of CMSms 1.6
This was well announced in the release notes and the release announcement.Since something has changed to the content types of the CMSms 1.6 it seems to be that some modules content types (like album module) does not work anymore.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Changes to the content types of CMSms 1.6
Indeed it has been announced.
But not documented yet.
I just wanted to help adapting the album module to CMSms 1.6 since cyberman told me that there are maintainers needed.
But I don't know where to start - or to continue since just adapting the code of the album content type to the code of the new content type of the core seems not to be all.
And always to dig in alien code to find it out by myself... this is weird.
But not documented yet.
I just wanted to help adapting the album module to CMSms 1.6 since cyberman told me that there are maintainers needed.
But I don't know where to start - or to continue since just adapting the code of the album content type to the code of the new content type of the core seems not to be all.
And always to dig in alien code to find it out by myself... this is weird.
Re: Changes to the content types of CMSms 1.6
Oh, please.
Come on.
Just a hint.
A keyword.
Let's say i would be a developer of a module that uses an own content type.
And i now want to adapt my module to the new CMSms version.
What do i have to do?
The only comments i found were that there has been changed this and that to the handling of content types what results in that some modules wont work properly.
But if I adapt exactly theses changes (to the modules content type only) nothing happens.
So this is why i'm asking for any suggestion what also to do.
Come on.
Just a hint.
A keyword.
Let's say i would be a developer of a module that uses an own content type.
And i now want to adapt my module to the new CMSms version.
What do i have to do?
The only comments i found were that there has been changed this and that to the handling of content types what results in that some modules wont work properly.
But if I adapt exactly theses changes (to the modules content type only) nothing happens.
So this is why i'm asking for any suggestion what also to do.
Re: Changes to the content types of CMSms 1.6
Okay,
a forum member told me that the content type in CMSms 1.6 must be registered not in the SetParameters function but in the constructor of the module class.
That's all.
a forum member told me that the content type in CMSms 1.6 must be registered not in the SetParameters function but in the constructor of the module class.
That's all.
Re: [SOLVED] Changes to the content types of CMSms 1.6
OK I see this is marked SOLVED but how did you solve it?
How do I get my Album content back as a content type?
How do I get my Album content back as a content type?
Re: [SOLVED] Changes to the content types of CMSms 1.6
An example will be nice.
As for the album module the forge version will not work as a Content Type anymore, since the developer no longer maintains it.
As for the album module the forge version will not work as a Content Type anymore, since the developer no longer maintains it.
Re: [SOLVED] Changes to the content types of CMSms 1.6
ok - this is the site http://photographicmemory.co.nz/
front end is fine after upgrade - in the back end there is no album content type so I can't get back into the pages or edit the current ones.
album is ver 0.9.3. Is there a current album or a different module I should be using?
Are you saying all albums now need to be added as smarty tags to a standard page? How would I delete the current pages if I can't access them from the back end?
front end is fine after upgrade - in the back end there is no album content type so I can't get back into the pages or edit the current ones.
album is ver 0.9.3. Is there a current album or a different module I should be using?
Are you saying all albums now need to be added as smarty tags to a standard page? How would I delete the current pages if I can't access them from the back end?
Re: [SOLVED] Changes to the content types of CMSms 1.6
Modules before CMSms 1.6 needed to register its content type in the function SetParameters (in the file MODULENAME.module.php):
This won't work anymore with CMSms 1.6+.
So we need to adapt this call:
This example is for the module Guestbook. You need to adapt module name and path if you adapt any other module.
Here you see it with the pageblocks module:
So we make sure that the module will still work with CMSms before 1.6.
For newer versions the RegisterContentType() call must be done in the (PHP4-) constructor of the module class.
A constructor in PHP4 is a function that has the same name like the class.
If this function does not exist create it.
Example (Guestbook module):
And again for PageBlocks:
This should be all.
(Thanks to Andiministrator)
In Guestbook Module i additionally adapted the content type file to the content type of the core.
Code: Select all
$this->RegisterContentType('GuestbookContent',cms_join_path(dirname(__FILE__),'class.GuestbookContent.php'),$this->GetFriendlyName());
So we need to adapt this call:
Code: Select all
if ($GLOBALS['CMS_VERSION'] < 1.6) {
if (method_exists($this, 'registercontenttype')) {
$this->RegisterContentType('GuestbookContent',cms_join_path(dirname(__FILE__),'class.GuestbookContent.php'),$this->GetFriendlyName());
}
}
Here you see it with the pageblocks module:
Code: Select all
if ($GLOBALS['CMS_VERSION'] < 1.6) {
if (method_exists($this, 'registercontenttype')) {
$this->RegisterContentType('PageBlocksContent', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'class.PageBlocksContent.php', $this->GetFriendlyName());
}
}
For newer versions the RegisterContentType() call must be done in the (PHP4-) constructor of the module class.
A constructor in PHP4 is a function that has the same name like the class.
If this function does not exist create it.
Example (Guestbook module):
Code: Select all
function Guestbook() {
$this->CMSModule();
$this->InstalledModules = array();
if ($GLOBALS['CMS_VERSION'] >= 1.6) {
parent::CMSModule();
$this->RegisterContentType('GuestbookContent',cms_join_path(dirname(__FILE__),'class.GuestbookContent.php'),$this->GetFriendlyName());
}
}
Code: Select all
function PageBlocks() {
$this->CMSModule();
$this->InstalledModules = array();
if ($GLOBALS['CMS_VERSION'] >= 1.6) {
parent::CMSModule();
$this->RegisterContentType('PageBlocksContent', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'class.PageBlocksContent.php', $this->GetFriendlyName());
}
}
(Thanks to Andiministrator)
In Guestbook Module i additionally adapted the content type file to the content type of the core.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: [SOLVED] Changes to the content types of CMSms 1.6
Just register the content types from the constructor.... no problems.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.