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?
ContentData function in new module
Re: ContentData function in new module
Hi Patricia,
thank you for the warm welcome.
Yes, I know the Markdown module. I installed it. I also have read probably all the discussion on the CMSMS forum about the Markdown module and also about the Markdown language and the Textile language (from the Textpattern CMS project).
The Markdown module also works on my site in the same way. The results are visible in the Preview, but are not visible when I display my page directly in the browser.
The module I want to create would be similar to the Markdown module, but instead of one text filter it would apply a sequence of text filters to the input text. In the ideal, general case, the sequence of filters migt have its unique name and the name would be the type of the content piece. Each piece of content would be filtered before presentation, according to its type. In this way different authors of articles for my websites might provide texts prepared with the markup languages bes suited to the content of the articles. One author might deliver article in pure XHTML, another one in Textile (plus "~" markup for nonbreakable spaces) and another one in Markdown or in Wikitext. I would put the text in the content area and would select appropriate "markup type" of the text from the list.
I don't know if I will be able to write such a general module by myself and if it is possible to do within the CMSMS model. But as the minimum I will write several modules, similar to each other, each with a one, thoroughly selected sequence of text filters, prepared for a particular website.

Marek
thank you for the warm welcome.

Yes, I know the Markdown module. I installed it. I also have read probably all the discussion on the CMSMS forum about the Markdown module and also about the Markdown language and the Textile language (from the Textpattern CMS project).
The Markdown module also works on my site in the same way. The results are visible in the Preview, but are not visible when I display my page directly in the browser.
The module I want to create would be similar to the Markdown module, but instead of one text filter it would apply a sequence of text filters to the input text. In the ideal, general case, the sequence of filters migt have its unique name and the name would be the type of the content piece. Each piece of content would be filtered before presentation, according to its type. In this way different authors of articles for my websites might provide texts prepared with the markup languages bes suited to the content of the articles. One author might deliver article in pure XHTML, another one in Textile (plus "~" markup for nonbreakable spaces) and another one in Markdown or in Wikitext. I would put the text in the content area and would select appropriate "markup type" of the text from the list.
I don't know if I will be able to write such a general module by myself and if it is possible to do within the CMSMS model. But as the minimum I will write several modules, similar to each other, each with a one, thoroughly selected sequence of text filters, prepared for a particular website.

Marek
Re: ContentData function in new module
The problem i stated here is now solved. The reason of my problems, or in general of problems with all modules making use of the ContentData fuction in 0.11.2, was probably a bug in one of the functions in the file lib/content.functions.php.
The solution is a change of a single line in the lib/content.functions.php file. (In the line 491 change "$content" to "$tpl_source".)
The details are described in the bug report:
http://forum.cmsmadesimple.org/index.ph ... 733.0.html
After applying the change, the modules making use of the ContentData fuction, including the Markdown module, work fine.
The solution is a change of a single line in the lib/content.functions.php file. (In the line 491 change "$content" to "$tpl_source".)
The details are described in the bug report:
http://forum.cmsmadesimple.org/index.ph ... 733.0.html
After applying the change, the modules making use of the ContentData fuction, including the Markdown module, work fine.