acDIVs 1.2 for CMSimple
© 2008-2011 Holger Irmler, http://CMSimple.HolgerIrmler.de.
The name of this plugin belongs to "
Animated
Collapsible
DIVs"
- and that's what this plugin is thought to do: it integrates contents
from a CMSimple-page in dynamic created and collapsed
DIV-blocks and lets users manually toggle its appearance via a
smooth "Web 2.0 style" animation.
Requirements
Installation
- Always make a backup of your installation
before adding a new plug-in.
- Unzip the archive and copy the files and folders into your
plugins-folder.
It should look like this:
- [Root]
- [(2lang)]
- [cmsimple]
- ...
- [plugins]
- ...
- [pluginloader]
- [acdivs]
- [config]
- [help]
- [languages]
- admin.php
- index.php
- index.php
- [...]
- index.php
The file /plugins/acdivs/config/config.php needs to be set
writable.
(To edit the
languages online do the same with the language files in
/plugins/acdivs/languages.)
- You're ready to use the plugin!
Usage
Basics
To activate the plugin, you have to insert the CMSimple-Scripting-Call
in the content:
#CMSimple
$output.=acdivs('Contentpage');#
where 'Contentpage' is the heading of the subpage which
holds the content of your collapsed divs.
Of course you can name this page different but it must be a subpage of
the page where you want to integrate the script.
To build categorys, you should create more contentpages and add them,
separated by "|", to the script:
#CMSimple
$output.=acdivs('Contentpage_1|Contentpage_2');#
(Take care that no
whitespaces are allowed between the brackets)
If the heading of your contentpage contains spaces, replace them by a
"_" underscore. The easiest way is to call the page in the browser and
copy the part of the subpages from the adressbar. This way you have the
correct encoding of special characters inside the headings too.
The structure of your CMSimple-Pages should look like below:
<h1>My acDIVs
Page</h1>
- <h2>Contentpage 1</h2>
- <h2>Contentpage 2</h2>
...
Of course "Contentpage 1" and "Contentpage 2" should be hidden from the
navigation by adding
#CMSimpl hide# at the top of the page-content
If you're running CMSimple_XH you
can use
acDIVs together with my pd_Scripting Plugin. Here you can easy use a
placeholder to put the script-output on every position at your content
page. Beside this you can use page_params to hide the content pages
from the navigation.
Now you have to prepare the contents of your contentpage(s):
by default the plugin uses the <h4> heading to split the
text in
<div> - blocks. You can configure another
<hx> - level in
the configuration:
<h2>Contentpage
1</h2>
#CMSimple hide#
<h4>First
heading</h4>
This is the collapsible content
below the first heading.......
<h4>Second
heading</h4>
This is the collapsible content
below the second heading......
....
<h2>Contentpage
2</h2>
#CMSimple hide#
<h4>First heading
of page 2</h4>
This is the collapsible content
below the first heading.......
<h4>Second heading
of page 2</h4>
This is the collapsible content
below the second heading......
....
Depending on some other configuration settings, the structure above
will result in an ouput like
on the page where you have activated the plugin.
With a click on a link its <div> below should toggle and
display the
contents between the clicked heading and the next heading (or the end
of the page - if it's the last one ;-)).
Anchors and IDs
For better usability, the plugin adds anchors to every heading:
to create a link to the first heading "Contentpage 1", use a
html-syntax like below
<a
href="#acH1">test</a>
where "ac" is the plugin-prefix, "H" is meant as "heading" and "1" is
the number of the heading.
So a link to the second heading "Contentpage 2" can be done with
<a
href="#acH1">test</a>
and so on. You can create links to the anchors "in page", to build a table of
contents, or add the anchors to the url, to jump to a section from another page.
Every created div can accesed by its own ID:
in the example above, the link "First heading" gets the ID "
acDIV1", "Second
heading" gets "
acDIV2",
...
and "Second heading of page 2" gets "
acDIV4".
You can use this IDs to expand a div by url:
<a
href="your_page?your_subpage&expanddiv=acDIV3">My
Link</a>
will load the page with the third div "First heading of page 2"
expanded.
Of course you can combine the &expanddiv-parameter with anchors
in your links:
<a
href="your_page?your_subpage&expanddiv=acDIV3#acH2">My
Link</a>
In-page configuration
By default, every configuration of the plugin is done in the
admin-backend.
But it's possible to overwrite on configuration-option with the
plugin-call:
#CMSimple
$output.=acdivs('Contentpage,0');#
will hide
#CMSimple
$output.=acdivs('Contentpage,1');#
will show the headings of the content pages - independent from the global setting in the configuration.
Configuration
There are just a few options in the Plugin Configuration:
- "close link":
setting to "1" will add a link to close the <div> below
the opened content.
Defalt value: 0
- "fade":
Set to 0 to disable fade effect. Set to 1 to enable. Default: 1
- "header":
the <hx> level used to split the content-pages. Default:
h4
- "height":
Set to an integer without
"px"
to explicitly define the height of the DIVs created by the script.
Typically you would leave out this attribute altogether (so it's
undefined) to let the DIV default to its natural height. Default: empty
- "hide":
Set to 0 to explicitly show the first DIV when the page first loads.
Set to 1 to hide.
Default: 1
- "persist":
Set to 0 to disable persistence of this DIV's state within browser
session. Set to 1 to enable.
Default: 0
- "show header":
Set to 1 to show the heading of the content page above the divs, set to
0 to hide the headings. Default: 1
- "speed":
Set to an integer in milliseconds to control the duration of the
sliding effect (ie: 1000=1 second). Default: 600
- "style":
You can add an inline style-definition to every div.
Default: margin: 10px 10px 10px 0;padding: 5px;
Acknowledgment
- This script is using the jQuery based Animated Collapsible
DIVv2.4 JavaScript, written by dynamicdrive.com.
License
Terms of use:
This plugin is free to use under Linkware License only on private websites.
The link "made with acDIVs .." to
http://cmsimple.holgerirmler.de must
stay visible and clear readable in the output.
On private websites, it is possible to remove the back-link if you purchase a Remove Link License.
Please visit
http://cmsimple.holgerirmler.de to find out how to get a license.
You must purchase a Commercial License if you want to use this work on
a commercial page or if you use this plugin in a paid project for a
customer - commercial or not.
A website with paid advertisements is a commercial page.
Of course you're allowed to remove the back-link with a payed license.
Please visit
http://cmsimple.holgerirmler.de to find out how to get a license.
Without my permission
- it is not allowed to redistribute this plugin
- it is not allowed to build and/or distribute modificated versions based on this plugin
Anyway, if you're allowed to use this plugin for free,
consider
donating a few bucks
to me via PayPal.
Need help?
... visit cmsimpleforum.com.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.