Some questions about "GetContentBlockFieldInput"

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
Post Reply
Guido
Forum Members
Forum Members
Posts: 221
Joined: Sat Aug 29, 2009 3:00 pm

Some questions about "GetContentBlockFieldInput"

Post by Guido »

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?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Some questions about "GetContentBlockFieldInput"

Post by calguy1000 »

Guido 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?
Answer is in the API docs
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.
Guido
Forum Members
Forum Members
Posts: 221
Joined: Sat Aug 29, 2009 3:00 pm

Re: Some questions about "GetContentBlockFieldInput"

Post by Guido »

You mean this?

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.
I read that, but don't understand it quite yet. Does params mean I can go:

Code: Select all

{content_module module="my_content_module" params="my_params"}
Or does it just mean ALL params in the smarty call?
Post Reply

Return to “Developers Discussion”