ContentData function in new module
Posted: Tue Jan 10, 2006 1:37 am
After checking about 20 CMS systems, installing some of them, testing, reading docs etc, I finally decided to try to use probably the best one, at least for my purposes - CMSMS. Congratulations and thanks for excelent work!
But before I make the final decisions of using CMSMS for several websites, I must be able to write my own modules.
I try to write a module that will apply a sequence of text filters to the content of my pages. The filters will include at least:
1. transformation from text to XHTML using one of well-known lightweight markup languages (probably Textpattern or Markdown or one of the variations of Markdown) and
2. some extra simple markup transformations that would be very useful for me, like transforming "~" to the nonbreakable space tag " " (like in the typesetting language TeX).
I understand that the function ContentData is responsible for including the content of a page to the appropriate place of a template and further presenting the file to the browser.
I wrote a simple module (using the new Skeleton.module.php, ver. 1.2) containing all the functions needed for administration purposes (like GetName or GetVersion) and a definition of a function ContentData.
The problem is that the definition of the function ContentData seem to work perfectly when I make a preview of my page, but does not work at all when i make "View site".
The example definition of the function, just exchanging the $content with another one-word content, might be:
function ContentData(&$content) {
$content="empty";
}
And I understand that in this case the content of each page should be just one word "empty". And it works like this in the preview, within the admin panel, but does not work when the page is displayed directly in the browser.
I checked all the calls to the function ContentData in the code of CMSMS but I still cannot find the reason why my module does not work. Probably i still do not understand something.
I am using (trying to use) CMSMS 0.11.2.
Can you help me, please?
But before I make the final decisions of using CMSMS for several websites, I must be able to write my own modules.
I try to write a module that will apply a sequence of text filters to the content of my pages. The filters will include at least:
1. transformation from text to XHTML using one of well-known lightweight markup languages (probably Textpattern or Markdown or one of the variations of Markdown) and
2. some extra simple markup transformations that would be very useful for me, like transforming "~" to the nonbreakable space tag " " (like in the typesetting language TeX).
I understand that the function ContentData is responsible for including the content of a page to the appropriate place of a template and further presenting the file to the browser.
I wrote a simple module (using the new Skeleton.module.php, ver. 1.2) containing all the functions needed for administration purposes (like GetName or GetVersion) and a definition of a function ContentData.
The problem is that the definition of the function ContentData seem to work perfectly when I make a preview of my page, but does not work at all when i make "View site".
The example definition of the function, just exchanging the $content with another one-word content, might be:
function ContentData(&$content) {
$content="empty";
}
And I understand that in this case the content of each page should be just one word "empty". And it works like this in the preview, within the admin panel, but does not work when the page is displayed directly in the browser.
I checked all the calls to the function ContentData in the code of CMSMS but I still cannot find the reason why my module does not work. Probably i still do not understand something.
I am using (trying to use) CMSMS 0.11.2.
Can you help me, please?