Page 7 of 18

Re: improve the content type "content" - Content (Extended)

Posted: Fri Apr 09, 2010 4:07 am
by NaN
Initial Release - BETA - is out now: http://dev.cmsmadesimple.org/projects/content2 (Module XContent)

I changed lot of code. So i won't give a complete changelog here (maybe later in the docu).
Most important thing is that this is a beta release and should not be used in a running productive site.

Please read the docu since i changed some param names. (i don't know what they are named before and i am a lazy sod to look back. so it is up to you. sorry.)

Summary:

- added filepicker (stil needs some fine tunning; this is a light "extraction" of the tiny mce file picker; not all features of tiny are supported yet)
- added datepicker (stores timestamp only)
- removed the ImageManager (filepicker is used instead but still uses the on the fly thumbnail creation of the ImageManager)
- file upload is not ready at this time but will be integrated in later releases
- added param "values" to dropdown and multiple select lists (to use different values than the item labels)
...

if you have any trouble just ask.
I need some sleep now ;)

Re: improve the content type "content" - Content (Extended)

Posted: Fri Apr 09, 2010 3:26 pm
by JeremyBASS
hmm.. if tiny mce  is to be droped from the core is it wise to use it's filepicker ? 

Re: improve the content type "content" - Content (Extended)

Posted: Fri Apr 09, 2010 4:07 pm
by applejack
Is TinyMCE being dropped from the core ? If so why ?

Re: improve the content type "content" - Content (Extended)

Posted: Fri Apr 09, 2010 4:17 pm
by JeremyBASS
IIRC tiny mirco is it's replacement... you can still install the MCE version... it was this reason I took the time to put in ImageManager with it's weak image sizing over a solution of SuperSizer and some file upload php in the scripts which would be vastly greater... heck if Supersizer was in the core and jQuery was too, I telll you what, this would be way to easy to have the inline uploads and image handeling.. anyways back to reality, I know if you do a quick search on tiny micro you'll find what your looking for.. Cheers -jeremy

Re: improve the content type "content" - Content (Extended)

Posted: Fri Apr 09, 2010 6:49 pm
by NaN
JeremyBASS wrote:
hmm.. if tiny mce  is to be droped from the core is it wise to use it's filepicker ?  
Yes, you're right, but that is why i extracted the code of the filepicker and integrated a copy into XContent.
I'm actually not referring to any code that depends on TinyMCE.
It is part of the module.

Re: improve the content type "content" - Content (Extended)

Posted: Fri Apr 09, 2010 7:57 pm
by JeremyBASS
NaN wrote:
JeremyBASS wrote:
hmm.. if tiny mce  is to be droped from the core is it wise to use it's filepicker ?  
Yes, you're right, but that is why i extracted the code of the filepicker and integrated a copy into XContent.
I'm actually not referring to any code that depends on TinyMCE.
It is part of the module.
OIC  I was reading it as you where just using not that you excised it out. :D

Re: improve the content type "content" - Content (Extended)

Posted: Mon Apr 12, 2010 11:47 am
by NaN
BETA 2 is out now.
And with BETA 2 the sinlge files Content2.inc.php and function.content2.php are removed and completely replaced by the module XContent.
So to me it is easier to maintain and to the users it is easier to install.

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Sun Apr 18, 2010 9:27 am
by nockenfell
The File "contenttype.Content2.php" has 2 Errors:

Line 275 (Missing ; )
Line 1441 (Bad Sign)

Thanks for your work!

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Fri Apr 23, 2010 1:40 pm
by NaN
Don't understand how this could happen  ???
But it is fixed in Beta 3 now.

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Fri Apr 23, 2010 1:48 pm
by applejack
Hi Nan

How long do you reckon before this is production worthy ?

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Fri Apr 23, 2010 2:05 pm
by nockenfell
NaN wrote:
Don't understand how this could happen  ???
But it is fixed in Beta 3 now.
in Beta 3 it's ok. Thanks.

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Fri Apr 23, 2010 3:55 pm
by NaN
applejack wrote:
Hi Nan

How long do you reckon before this is production worthy ?
This depends on your feedback ;)

At the moment it seems to be quite stable.
It just needs some fine tuning.

Next features will be

- creating page related block types on the fly without modifying the template. You just need to put a block of type area in the the template and assign the blocks to that areas.

- sort content blocks

(but this may take a while and won't be added before a stable release)

I'm afraid the more features i add the more i'll break compatibility with the default content type  :-\

By the way i've just seen that there already exists a CMS called XContent.
I'm also afraid of that i need to change the module name.
Don't want to confuse people or get in trouble because of using a registered trademark as module name.
Internal project name is still content2. Maybe i just take this as module name. But this will break backward compatibility since the module name will also be the class name of the module. But until now content2 is already the class name of the content type. And if i change this... no bakward compatibility anymore... ::)

If anyone has a good idea for a module name please let me know ;)

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Tue Apr 27, 2010 3:56 am
by JeremyBASS
hmm tested it out..

{content block="Redirect Page" block_tab='Access' type="text" oneline=true  assign='redirect_page'}
{XContent block="Redirect Page" block_tab='Access' type="text" oneline=true  assign='redirect_page'}

both pull

"
Redirect Page:
Notice: Cannot use basic content property 'Redirect Page' as value of block param.
This block is disabled. Check your page template.
"

tested on all your versions... just a heads up.. that is a simple textinput but didn't get a change to look into to.. Cheers -Jeremy

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Tue Apr 27, 2010 9:47 am
by NaN
Thanks for testing this.

In brief:

This is a normal behaviour.
You simply cannot use "Redirect Page" as block name since this is a reserved basic property of the content type.


I'll try to explain the details:

Each block will become a property of the content.
Therefore each block needs an 'id'.
This id must be unique.
The id will be the name of the block but without whitespaces and lower case.
That means ' block="Redirect page" ' wil have the id 'redirect_page'.
This id will be the index of the $params array (what just contains the $_POST data when submitting the edit content form) and the name of the property stored in the database.
And that is why you cannot use "Redirect page" as block name since in the code there already is a property called 'redirect_page'.
(It is for FrontendUsers page access. You won't see it if you haven't installed FrontendUsers.)


By the way (is this bug report worthy?):

Just try to use a block called title and edit a page of content type content (the default one).
The page title will be shown as value of that content block since the default content type does not check if the name of the block (wich will become the name of a content property) already exists or is a basic property. So when getting the value of the content block the content type will get the property named "title". Wich is actually the page title but not the additional content block.
And now just imagine what happens if you save the changes.
Right.
If you change the content of that block you will change the page title.
Even if you never wanted to do that.
(Imagine what happens if you have a block called "alias", "menutext" etc. ...  :o )
So actually no additional content block will be added in this case but just the page title will be overwritten.

That means in the default content type you can overwrite the basic content properties by the content blocks. What in my opinion is bug and should be fixed.
Also if you use block names several times you override the previous one.
The default content type does only show one content block (the last one) while the user might wonder where the f*ck the other content blocks are.
(I was almost getting crazy about that until i realised that there was a fault in my template  ::) )

That is why i check if the content blocks name is reserved by any basic content property.

The same thing happens if you use a block name twice.
In the extensible contenttype at this place where the content block would be shown it will print out a notice that this block name is ambigous, block names must be unique and that this block will be ignored (so you cannot overwrite basic properties or previous content blocks).
In opposite to the default content type i only process the first found content block and all following ones with the same name will be ignored but replaced by at least a tiny notice.
(Just to prevent other users to run into the same crazyness i did ;) )


Back to topic... So if you have this message just check your page template for this param that has the value "Redirect page" and change this value e.g. to "My Redirect Page".
If you don't like to have "My Redirect Page" as the prompt of this block just use the param label to assign a custom prompt to this block instead of the block name:

{content block="my redirect page" label="Redirect Page" block_tab='Access' type="text" oneline=true  assign='redirect_page'}

or

{XContent block="my redirect page" label="Redirect Page" block_tab='Access' type="text" oneline=true  assign='redirect_page'}


Notice:

In the next version of this content type module the module/plugin name will change to "AdvancedContent" since "XContent" is a registered trademark and anyway the module has nothing to do with the CMS XContent.

Re: improve the content type "content" - Content(extended) -> XContent Module

Posted: Thu Apr 29, 2010 8:56 pm
by Foaly*
As the admin area still can't be used in IE7 / IE8 if this content type is used I figured out this hack:

/lib/classes/contenttypes/Content.inc.php#249:

Code: Select all

function _add_show_handlers(navbar){
	var tabs = navbar.getElementsByTagName('div');
    for (var i = 0; i < tabs.length; i += 1) {
	tabs[i].onmousedown = function() {
	    for (var j = 0; j < tabs.length; j += 1) {
		tabs[j].className = '';
		if(document.getElementById(tabs[j].id + "_c")) // added
			document.getElementById(tabs[j].id + "_c").style.display = 'none';
	    }
	    this.className = 'active';
		if(document.getElementById(this.id + "_c")) // added
	    		document.getElementById(this.id + "_c").style.display = 'block';
	    return true;
	};
    }
    var activefound=0;
    for (var i = 0; i < tabs.length; i += 1) {
    	if (tabs[i].className=='active') activefound=i;
    }
    tabs[activefound].onmousedown();
}