AdvancedContent

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked

What do you think: Use the image uploads dir or just the uploads dir for {content_image}?

image uploads dir
23
68%
uploads dir
8
24%
don't care
3
9%
 
Total votes: 34

NaN

AdvancedContent

Post by NaN »

Hi,

i'm trying to improve the functionality of the content type "content".
I added some more params and changed some functions in the source.
All content items will be handled like content blocks.
(there is no default content anymore)

Additionally you can define what type the content block will be.
E.g. a checkbox, dropdown, mutliple select list, image...

You can also define in what tab the content block will be displayed.
So you can add some specific options.
You can also add an own tab where you can put in all the additional content blocks.
And last not least you can create tabs inside the tabs to group the content blocks in so called "block tabs".

I tested it with cmsms 1.5.2 and 1.5.4.
Works fine.

When working on that content type i realized, that the function GetPropertyValue() returns true if the property does not exist in the database.
That means when changing the content type of an existing page from content to my content type i get the value 1 of each additional content block.

Is this a bug?
Last edited by NaN on Wed Aug 11, 2010 6:05 pm, edited 1 time in total.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: improve the content type "content"

Post by jmcgin51 »

Not to throw a wet blanket on your mods (which sound very interesting, BTW), but I'm guessing the response from the dev team will be "since you've modified the source, and we have no idea what you did, we can't tell you if this is a bug or not".

Hopefully I'm wrong... :)
alby

Re: improve the content type "content"

Post by alby »

jmcgin51 wrote: Hopefully I'm wrong... :)
wrong  :)
I have not yet seen (for lack of time) and so I don't know if same level but calguy1000 has implemented a something like this in 1.6

Alby
NaN

Re: improve the content type "content"

Post by NaN »

I didn't modify anything in the core.
I just created an own content type which is an adaption of the original one.

The content with my content type will be called like this:

Code: Select all

{content block="test" type="checkbox" label="klicke me" page_tab="options" ... }
So in the tab "options" an additional checkbox will be show.
By default this checkbox is not checked.
This works if the page is added.
But when you edit a page i need to use the function  GetPropertyValue() to set this checkbox checked or not.
If that page has been stored with the original content type (without that checkbox) and is now changed to my adapted content type this checkbox suddenly is checked.
Even if there is no property stored in the database.

That means  

Code: Select all

$this->GetPropertyValue('test');
will return true for that checkbox even if it has never been saved before.
I can avoid this using vars of type string "true"/"false" instead of boolean vars.
But it seems strange to me.

If someone is interested you can try the attached file.
(remove the .mpg after download and unzip it.
copy the file content2.inc.php into lib/classes/contenttypes.
copy the file function.content2.php into your plugin directory (by default "plugins") )

There is no english documentation available in the plugin help for now but i will translate it if there is interest.

Edit (07.08.2009):
I did it again for CMSms 1.6.3.
I also added a feature to select if the page is public or for frontendusers only.
In opitons tab there is a List where you can select groups of the frontendusers module that may access this content.
If a visitor is not logged in or not in the selected group the login form will be shown.
(only works if feusers is installed and the content2 plugin is used)

Here is a list of the params:

  * (optional) block
          adds an additional content block (same like default)

            Example:
            {content2 block=\"Second Content Block\"}

    * (optional) wysiwyg (true/false)
          toggle wysiwyg editor on/of (same like default)

    * (optional) oneline (true/false)
          shows only a text input in one line (same like default)

    * (optional) value
          a predefined content

    * (optional) type (text,image,checkbox,dropdown,select_multiple)
          here you can define what type of input the added content block will be

    * (optional) page_tab
          here you can define in what tab the content block will be shown (you could add a checkbox to the options tab)

    * (optional) block_tab
          here you can create tabs inside of tabs to summarize some content blocks

    * (optional) label
          the label of the content block

    * (optional) assign
          assigns the content to a variable instead of printing it out

            Example:
            {content assign=pagecontent} {table_of_contents thepagecontent="$pagecontent"}


Params of Blocktype "checkbox":

    * (optional) checked (true/false)
          checks/unchecks the checkbox by default when editing a page

Params of Blocktype "dropdown"/"select_multiple":

    * (optional) items
          Value(s) of the field (separated by a comma)

    * (optional) selected
          preselected value(s) (separated by a comma)

Params of Blocktype "image": see content_image tag help
Attachments

[The extension mpg has been deactivated and can no longer be displayed.]

[The extension mpg has been deactivated and can no longer be displayed.]

Last edited by NaN on Fri Aug 07, 2009 2:56 pm, edited 1 time in total.
NaN

Re: improve the content type "content"

Post by NaN »

alby wrote: I have not yet seen (for lack of time) and so I don't know if same level but calguy1000 has implemented a something like this in 1.6
Damn!
I'm too late again ;)
alby

Re: improve the content type "content"

Post by alby »

NaN wrote: I'm too late again ;)
Nan, change is a low level (all ContentType not Content only) but as I said I'm not sure why I have not looked yet.
It's better that I leave info to calguy1000 or to RonnyK because did some testing or you can enter in irc

Alby
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: improve the content type "content"

Post by jmcgin51 »

alby wrote:
jmcgin51 wrote: Hopefully I'm wrong... :)
wrong  :)
I have not yet seen (for lack of time) and so I don't know if same level but calguy1000 has implemented a something like this in 1.6

Alby
Good!!  Thanks!! :-)

@NaN - I thought you modified the core because of this line in your post:
I added some more params and changed some functions in the source.
Will be interesting to see 1.6...
NaN

Re: improve the content type "content"

Post by NaN »

I updated my changes to work with CMSms 1.6+ and added some features (see post #3)
maxfagotto
New Member
New Member
Posts: 4
Joined: Fri Dec 21, 2007 10:32 am

Re: improve the content type "content"

Post by maxfagotto »

Very interesting!!
Did you released this improvement?
Thanks
axxe16

Re: improve the content type "content"

Post by axxe16 »

Is a real pity that the content does not have these default options. Whereas I do not understand why they are useful
JeremyBASS

Re: improve the content type "content"

Post by JeremyBASS »

Gosh... super super super... I wish I found this sooner... this is just about perfect... I need  to controll ove the way the inputs show up... but other wise.. damn this is great... Let me know if you wish for me to put up the changes I needed in the input display controlls....


Cheers
Jeremy
JeremyBASS

Re: improve the content type "content"

Post by JeremyBASS »

Here are the changes I needed and the files to go with it... I add to params to this...
'style'
'filter' (this is for Blocktype "image")

* (optional) style
          set an inline style to the inputs of all the block types

* (optional) filter (action:Prefix)
          exclude or include files with the set perfix


Usage is as such:

style='width:350px;font: 700 14px Arial, Helvetica, sans-serif;color: #333;'

filter="exclude:thumb_"
filter="include:thumb_"


So just some small changes but the exclude and include... well that has been long needed in the content_image tag

Cheers
Jeremy


NOTE:tested on CMSMS 1.6.6

Also I think a validtaion param would be good to add to... but I didn't need it so someone else can add it in... :D
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by JeremyBASS on Sat Oct 31, 2009 3:44 am, edited 1 time in total.
JeremyBASS

Re: improve the content type "content"

Post by JeremyBASS »

It should be noted that if you have any param on the {content} tag it's self there will be an error..  ;D
NaN

Re: improve the content type "content"

Post by NaN »

What kind of error?
The default {content} plugin only clears params that belongs to the default plugin.
It passes all additional params to modules that are displayed inline.
Since if these modules are also clearing their params properly you may get a message like "warning unknown param..." for each param that does not belong to the module.
So using the default {content} plugin with the modified contenttype may be no good idea.
If you add params to the modified contenttype you also need to clear these params in the modified plugin if a module will be displayed inline.
Last edited by NaN on Tue Nov 03, 2009 11:52 pm, edited 1 time in total.
JeremyBASS

Re: improve the content type "content"

Post by JeremyBASS »

block_tab add to the main  {content} ends in  fatal error... I'm not going to be able to replrace it to post at this time... but you can test by adding the  block_tab param... sorry I was a little vage there,,,
Locked

Return to “Modules/Add-Ons”