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.
[Solved] How to define custom content blocks in CMSMS 2.0?
[Solved] How to define custom content blocks in CMSMS 2.0?
Last edited by Stom on Tue Sep 29, 2015 7:17 am, edited 1 time in total.
Re: How to define custom content blocks in CMSMS 2.0?
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:
But using CGSimpleSmarty to get the property in the template doesn't work, and causes the error below:
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:
To this:
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'}
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
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);
Code: Select all
$tmp =
$module->GetContentBlockFieldValue($blockName,$blockInfo['params'],!$editing,$this);
Re: [Solved] How to define custom content blocks in CMSMS 2.
from SVN rev 10235
/lib/classes/contenttypes/Content.inc.php
see modifications
and check if it works
/lib/classes/contenttypes/Content.inc.php
see modifications
and check if it works
Jean-Claude Etiemble MyPageFr