[Solved] How to define custom content blocks in CMSMS 2.0?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Stom
Forum Members
Forum Members
Posts: 82
Joined: Tue Jul 31, 2007 1:41 am

[Solved] How to define custom content blocks in CMSMS 2.0?

Post by Stom »

I have previously used modules such as AdvancedContent to create custom content attributes in previous version of CMSMS. This was incredibly useful as it include options for checkboxes, color-pickers, images (with ajax upload field), dropdowns, select-multiples, etc.

Is there a way to do this with the stock CMSMS 2.0? Or is there a module that works with this version? I have tested AdvancedContent and it doesn't work sadly.
Last edited by Stom on Tue Sep 29, 2015 7:17 am, edited 1 time in total.
Stom
Forum Members
Forum Members
Posts: 82
Joined: Tue Jul 31, 2007 1:41 am

Re: How to define custom content blocks in CMSMS 2.0?

Post by Stom »

I found that CGContentUtils can do some of these features, although I can't seem to read it's attributes with CGSimpleSmarty.

I've created a true/false drop-down content block called "vertically-align" and it works if I have it directly in a template:

Code: Select all

{content_module module='CGContentUtils' tab="Style" block='center-vertically'}
But using CGSimpleSmarty to get the property in the template doesn't work, and causes the error below:

Code: Select all

{$valign="{cgsimple::get_page_content($node->alias,'center-vertically')}"}

Code: Select all

PHP Catchable fatal error:  Argument 4 passed to CGContentUtils::GetContentBlockFieldValue() must be an instance of ContentBase, boolean given, called in ./lib/classes/contenttypes/Content.inc.php on line 158 and defined in ./modules/CGContentUtils/CGContentUtils.module.php on line 657, referer: ./admin/moduleinterface.php?mact=CMSContentManager,m1_,admin_editcontent,0&_sk_=9955b28a0bde1f28&m1_content_id=36
Is there a way to get the CGContentUtils property? I'm using a similar set-up to this in order to show sub-pages as panels.

Edit: Issue seems to be a known bug, reported here:
http://dev.cmsmadesimple.org/bug/view/10633

Edit2: Found a fix after tinkering with it. One too many parameters were in the function call. Edit line 158 of ./lib/classes/contenttypes/Content.inc.php:

Code: Select all

$tmp =
$module->GetContentBlockFieldValue($blockName,$blockInfo['params'],$params,!$editing,$this);
To this:

Code: Select all

$tmp =
$module->GetContentBlockFieldValue($blockName,$blockInfo['params'],!$editing,$this);
jce76350
Beta Tester
Beta Tester
Posts: 2095
Joined: Mon May 29, 2006 1:20 pm

Re: [Solved] How to define custom content blocks in CMSMS 2.

Post by jce76350 »

from SVN rev 10235
/lib/classes/contenttypes/Content.inc.php
see modifications
and check if it works
Jean-Claude Etiemble MyPageFr
Locked

Return to “CMSMS Core”