Additional Content Modules

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Akrabat

Additional Content Modules

Post by Akrabat »

Hi all,

I've added support for additional content blocks into the svn tree now.

Simplistic Instructions:
1. Edit your template. Additional content blocks are added using the construct: {content block="name of this block"}
2. Add new content (or Edit a current content page). When you select the template with the additional content block defined, you will see a new text area appear labelled "name of this block".
3. That's it!

Please test and report any bugs!

Thanks.
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: Additional Content Modules

Post by sjg »

I just want to say that I've been testing this, and it's great.

It even does the right thing if you, say, change templates on a page. If the new template has only one content area, the other one(s) vanish. But if you switch back to a template that has more than one content area, it's all still there.

This capability is especially useful in sites where there are multiple columns of content in the "main content" area of the page. This way, you can put the formatting in the template. Before, you needed to put divs or tables in the content itself, and users could easily screw up the page. With this change, you can protect users from themselves (and save yourself a lot of time fixing things).
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Re: Additional Content Modules

Post by Greg »

My original Template had this section related to the content:

Code: Select all

<div class="mcontent">{content}</div>
I added the modules for multiple content and changed the template to:

Code: Select all

<div class="mcontent">
<div class="boxhead">{content block="Title"}</div>
<div class="boxcontent">{content block="Main Content"}</div>
</div>
On the edit content page with the TinyMCE WYSIWYG editor active I get:
Content type dropdown
a WYSIWYG menu
Menu Text Page Alias and template dropdowns
a WYSIWYG menu
a textarea with the label content
a textarea with the label Title (WYSIWYG not active)
a textarea with the label Main Content (WYSIWYG not active)
Headtags teatarea etc....

With the HTMLArea WYSIWYG active I get:
Content type, Menu Text, Page Alias, and template dropdowns
a textarea with the label content (WYSIWYG active)
a textarea with the label Title (WYSIWYG active)
a textarea with the label Main Content (WYSIWYG active)
Headtags teatarea etc....
Greg
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: Additional Content Modules

Post by sjg »

Interesting. I left my original {content} tag alone, but added a {content block="other"}, and TinyMCE worked correctly for me.
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm
Location: Saskatchewan - Canada

Re: Additional Content Modules

Post by Greg »

The source code with TinyMCE active shows the initilization of TinyMCE as:

Code: Select all

tinyMCE.init({
				mode : "exact",
				elements : "content_en, Title, Main_Content",
and the textareas are properly identified as:

Code: Select all

<textarea id="Title" name="Title" cols="80" rows="15">
<textarea id="Main_Content" name="Main_Content" cols="80" rows="15">
but with either WYSIWYG editor active the textarea from the old template definition still appears:

Code: Select all

<textarea id="content_en" name="content_en" cols="80" rows="20">
Greg
amo

Re: Additional Content Modules

Post by amo »

I tried to add another column but it won't work?

This is what I input as my template:



{title}
{stylesheet}





{cms_module module='phplayers'}



{content}
{content block="Other"}








I don't get another text field for one thing and I also get this error:

Fatal error: Smarty error: [in preview:cms58A.tmp line 313]: syntax error: unrecognized tag 'content' (Smarty_Compiler.class.php, line 576) in c:\wamp\www\cms\lib\smarty\Smarty.class.php on line 1088
Akrabat

Re: Additional Content Modules

Post by Akrabat »

amo: Which version of cms made simple are you using?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Additional Content Modules

Post by Ted »

He posted this twice.  He was using an older version.
Lohengrin

Re: Additional Content Modules

Post by Lohengrin »

Will this functionality make it into 0.10 like it's said on the roadmap? I had a quick glance at the beta but didn't get it to work.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Additional Content Modules

Post by Ted »

It's in the beta and should be used like it's discussed above.
amo

Re: Additional Content Modules

Post by amo »

I've tried out the 0.10beta as well I really like the new look. The columns thing still gives me the same error so I guess it hasn't been implemented or maybe it's a bug perhaps? This is what I get:

Fatal error: Smarty error: [in preview:cms4F.tmp line 312]: syntax error: unrecognized tag 'content' (Smarty_Compiler.class.php, line 580) in c:\wamp\www\cms\lib\smarty\Smarty.class.php on line 1088
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Additional Content Modules

Post by Ted »

How did you insert the {content} tag into the template?
fadum

Re: Additional Content Modules

Post by fadum »

is it only possible to add 2 extra blocks? i try adding 3 and i get the 'content' tag error as explained previously by another user

thanks
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Additional Content Modules

Post by Ted »

You're getting it on preview or the actual page?
fadum

Re: Additional Content Modules

Post by fadum »

actual pages

0.10 beta3
Last edited by fadum on Mon Jun 13, 2005 12:00 pm, edited 1 time in total.
Post Reply

Return to “Developers Discussion”