As I'm diving further into module development for CMSMS, I'm playing with the idea of a content module. I'm studying the code from CGContentUtils and came accross 'GetContentBlockFieldInput'.
I looked it up in the API doc and would like to explain it in a really simple way to see if I get the workings:
So the system is parsing a template and comes accross this content_module tag. Is says hey, let's look for a block parameter. When it finds it, this gets passed as the first argument to the 'GetContentBlockFieldInput' function.
Now how are the other parameters (like value and params) passed in from this smarty call?
What is the 'adding' parameter? I see it is a flag that basically tells if I'm adding new content or editing existing, but what's the difference?
How can I work with the content object? Is it automatically available?
Some questions about "GetContentBlockFieldInput"
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Some questions about "GetContentBlockFieldInput"
Answer is in the API docsGuido wrote:So the system is parsing a template and comes accross this content_module tag. Is says hey, let's look for a block parameter. When it finds it, this gets passed as the first argument to the 'GetContentBlockFieldInput' function.
Now how are the other parameters (like value and params) passed in from this smarty call?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Some questions about "GetContentBlockFieldInput"
You mean this?
I read that, but don't understand it quite yet. Does params mean I can go:
Or does it just mean ALL params in the smarty call?
Code: Select all
Get an input field for a module generated content block type.
This method is called from the content edit form when a {content_module} tag is encountered.
This method can be overridden if the module is providing content block types to the CMSMS content objects.
Arguments
string $blockName
Content block name
mixed $value
Content block value
array $params
Associative array containing content block parameters
bool $adding
A flag indicating wether the content editor is in create mode (adding) vs. edit mod.
\ContentBase $content_obj
The content object being edited.
Response
mixed
Either an array with two elements (prompt, and xhtml element) or a string containing only the xhtml input element.
Code: Select all
{content_module module="my_content_module" params="my_params"}