ExpandContract behavior.

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: ExpandContract behavior.

Post by Tata » Sat Oct 22, 2016 7:38 pm

Holger wrote:if I'm right it would be a solution if ExpandContract ignores hidden sub-pages, set "unpublished" via pagedata.
As I wrote before. The "non-published: feature is fine and can be used in various situations. So It is better to think about set a unique variable for it. So it can be used standardly as any other CMSimple_XH feature. I assume, its better so than to leave this feature off or cover it in plugins under any other feature (i the case of here discussed plugin under #CMSimple hide#).
I'll give a try to your mod immediately.
Thanks a lot.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: ExpandContract behavior.

Post by Tata » Sat Oct 22, 2016 7:43 pm

Tested. It works - ignoring "removed" pages, excluding them from "Expand list".
I, however, thought about leaving them listed and replace their real content by some general message. So the visitor will be aware, that such page exist, but actually is under construction, or by any other reason inaccessible (evtl. with a date when the page will be again fully accessible).
Anyway - your mod is a half way at least.

I miss (I think it should be somewhere) in block

Code: Select all

<!-- E X P A N D - C O N T R A C T    S T A R T -->\
...
<!-- E X P A N D - C O N T R A C T    E N D -->\ 
the

Code: Select all

#CMSimple remove#   
and it should be also evaluated with different output.
e.g. with

Code: Select all

$plugin_tx['expandcontract']['if_removed'] = "Announce for removed page";
or

Code: Select all

$plugin_tx['expandcontract']['if_removed'] = "Announce for removed page from % to %" ; 
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: ExpandContract behavior.

Post by cmb » Mon Oct 24, 2016 3:54 pm

Tata wrote:I, however, thought about leaving them listed and replace their real content by some general message. So the visitor will be aware, that such page exist, but actually is under construction, or by any other reason inaccessible (evtl. with a date when the page will be again fully accessible).
It seems to me that this is not specificly related to Expandcontract, but rather a general possible improvement for CMSimple_XH (actually, page_params).
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: ExpandContract behavior.

Post by Tata » Mon Oct 24, 2016 4:37 pm

cmb wrote:It seems to me that this is not specificly related to Expandcontract, but rather a general possible improvement for CMSimple_XH (actually, page_params).
To me the same. That\s why I have mentioned evtl. usage with another functions/plugins. If the feature exists then it's better to use it than to igonre its exitence or use it inproperly.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: ExpandContract behavior.

Post by Tata » Thu Nov 24, 2016 4:43 pm

Now, that I use the plugin on a website, I see, that the plugin really shows all "invisible" (non published and hidden from navigation pages). That's bad. There are some pages that should be really hiddne both from visible content and the navigation but still shall be kept on the website. Short solution (until the feature "removed" is renewed in the core, it could be solved on plugin's level. The plugin reads pagedata anyway. So it shall know which page is for use with the plugin (hidden from navigation) and which shall be ignored (non published).
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: ExpandContract behavior.

Post by Tata » Fri Dec 09, 2016 10:48 am

New problem found.
I tried to make a structure like this:

Code: Select all

<h1>DOCUMENTS</h1>
     {{{expand}}}
     <h2>Optional</h2> //hidden
          {{{PLUGIN:wdir('downloads', '*.pdf');}}}
     <h2>Mandatory</h2> //hidden
          {{{expand}}}
          <h3>Document 1</h3> //hidden
               {{{pdfviewer("document-1.pdf");}}}
          <h3>Document 2</h3> //hidden
               {{{pdfviewer("document-2.pdf");}}}
          <h3>Document 3</h3> //hidden
               {{{pdfviewer("document-3.pdf");}}}
Doing this I get
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69632 bytes) in /Users/msereday/Sites/Zusnobela/cmsimple/functions.php on line 1471
Any hint how to avoid this?

Another problem:
I have changed the structure to:

Code: Select all

New problem found.
I tried to make a structure like this:[code=php]<h1>DOCUMENTS</h1>
     {{{submenu();}}}
     <h2>Optional</h2> //hidden
          {{{PLUGIN:wdir('downloads', '*.pdf');}}}
     <h2>Mandatory</h2> //hidden
          {{{expand}}}
          <h3>Document 1</h3> //hidden
               {{{pdfviewer("document-1.pdf");}}}
          <h3>Document 2</h3> //hidden
               {{{pdfviewer("document-2.pdf");}}}
          <h3>Document 3</h3> //hidden
               {{{pdfviewer("document-3.pdf");}}} 
Doing this each subsequent expanded page opens the viewer smaller. Only the first is opened in its full size. The second is then only about 75%, the third and the rest only 50% wide. One of the files is not found.
Also I think the plugin has problem with file names if they use CEE characters (accented or with special markers: ľščťžýáíéúäňô and their capitals), regardles of $tx['urichar']['new'] or $tx['urichar']['old'] definition.
Have a look at http://nobela.cmsimple.sk/?Documents/
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: ExpandContract behavior.

Post by cmb » Fri Dec 09, 2016 11:57 am

Tata wrote:Also I think the plugin has problem with file names if they use CEE characters (accented or with special markers: ľščťžýáíéúäňô and their capitals), regardles of $tx['urichar']['new'] or $tx['urichar']['old'] definition.
Most likely the plugin does not convert the given filenames. As these are entered into the content, they are UTF-8 encoded. However, your filesystem apparently is not encoded in UTF-8, so these characters cause issues. Solving this for each plugin individually doesn't appear to be a good idea; instead I would prefer a general solution in the core of CMSimple_XH.

I'll try to have a look at the other issues later. BTW: http://nobela.cmsimple.sk/?Dokumenty/ => 404 Not found.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: ExpandContract behavior.

Post by Tata » Fri Dec 09, 2016 12:27 pm

cmb wrote:BTW: http://nobela.cmsimple.sk/?Dokumenty/ => 404 Not found.
Ah, yes. It shall be /?Documents
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: ExpandContract behavior.

Post by cmb » Fri Dec 09, 2016 12:57 pm

Tata wrote:Doing this each subsequent expanded page opens the viewer smaller. Only the first is opened in its full size. The second is then only about 75%, the third and the rest only 50% wide.
This doesn't appear to be related to Expandcontract, but rather to be a general issue of PDF viewer. You can also see that on http://simplesolutions.dk/?PDF_Viewer, where the second viewer is smaller than the first. That's caused by the plugin stylesheet; just remove the #pdf_container_1 rule, or probably better add additional rules for #pdf_container_2 etc.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: ExpandContract behavior.

Post by cmb » Fri Dec 09, 2016 3:07 pm

Tata wrote:New problem found.
I tried to make a structure like this:

Code: Select all

<h1>DOCUMENTS</h1>
     {{{expand}}}
     <h2>Optional</h2> //hidden
          {{{PLUGIN:wdir('downloads', '*.pdf');}}}
     <h2>Mandatory</h2> //hidden
          {{{expand}}}
          <h3>Document 1</h3> //hidden
               {{{pdfviewer("document-1.pdf");}}}
          <h3>Document 2</h3> //hidden
               {{{pdfviewer("document-2.pdf");}}}
          <h3>Document 3</h3> //hidden
               {{{pdfviewer("document-3.pdf");}}}
Doing this I get
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69632 bytes) in /Users/msereday/Sites/Zusnobela/cmsimple/functions.php on line 1471
Any hint how to avoid this?
Apparently, {{{expand}}} must not be nested. It is already on the <h1> page, and adding it to the <h2> causes infinite recursion (which is caught by PHP's memory_limit).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply