User Tools

Site Tools


cms:impresspages

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cms:impresspages [2013/03/24 16:03] – [Plugin] skipidarcms:impresspages [2023/11/01 07:13] (current) – ↷ Page moved from business_process_management:camunda:cms:impresspages to cms:impresspages skipidar
Line 1: Line 1:
 +===== Imresspages CMS =====
  
 +A nice looking drag and drop CMS: https://www.impresspages.org/
 +
 +
 +===== Fallpits =====
 +
 +^Issue^ Answer^
 +|Howto choose the first zone?| The top zone, listed in the **Backend> Developer > Zones** is considered used for the frontpage |
 +
 +^Error^ Solution^
 +| Class 'Modules\zvg\zvgtable_zone\Zone' not found in Z:\home\zvgcms.nu\www\ip_cms\frontend\site.php(387) : eval()'d code on line 1| The Namespace may be wrong: namespace Modules\zvg\zvgtable_zone |
 +
 +
 +
 +===== Concepts =====
 +
 +==== Zone ====
 +Zones are [[http://www.impresspages.org/docs2/core2/url-structure2/|reflected in the URL]] \\ 
 +<code>http://www.example.com/language/zone/page/sub-page/</code> \\ Many zones may occur on one page: e.g. Searchzone, Menuezone \\ 
 +A zone is filled by a module (plugin) \\ 
 +| {{http://i520.photobucket.com/albums/w327/schajtan/2013-02-24_23-46-08_zps8f18e122.png?400}} |
 +
 +
 +Zones are listed in menu and can be filled by pages: \\
 +| {{http://i520.photobucket.com/albums/w327/schajtan/2013-02-24_23-53-08_zpsc06a11a2.png?400}} |{{ http://cdn.impresspages.org/image/impresspages_cms_zones_and_pages_2_1.png }} |
 +
 +==== Plugins = Modules ====
 +Plugins alias Modules contribute functionality. [[http://www.impresspages.org/docs2/working-with-plugins2/custom-zone-example2/|To zones]], to backend.. 
 +
 +==== Global Variables ====
 +
 +The full list can be found in file "ROOT\www\ip_config.php"
 +
 +^VAR ^RESULT^
 +|BASE_URL | http://zvgcms.nu/|
 +|BASE_URL.THEME_DIR | http://zvgcms.nu/ip_themes/|
 +|BASE_URL.THEME_DIR.THEME | http://zvgcms.nu/ip_themes/zvg |
 +|BASE_URL.LIBRARY_DIR|http://zvgcms.nu/ip_libs/|
 +|BASE_DIR|Z:/home/zvgcms.nu/www/|
 +|BASE_DIR.LIBRARY_DIR|Z:/home/zvgcms.nu/www/ip_libs/|
 +|BASE_DIR.MODULE_DIR|Z:/home/zvgcms.nu/www/ip_cms/modules/|
 +|BASE_URL.PLUGIN_DIR|http://zvgcms.nu/ip_plugins/|
 +
 +
 +
 +
 +===== Plugin =====
 +
 +
 +^Step ^Howto ^ Link^
 +|0. Create a Template | Create a template with for the new zone, add a custom block where the plugin content will be presented, by doing <code><?php echo $this->generateBlock('side'); ?></code>. Look in //\ip_themes\// for example templates.|http://www.impresspages.org/docs/getting-started/understanding-themes/|
 +|1. Write Plugin with an own **zone** |  |http://www.impresspages.org/docs/working-with-plugins/custom-zone-example/|
 +|2. Install the new Module.| Click on "Install" in Backend> Developer> Modules. ||
 +|3. Create a Zone in BE.| Create a Zone in the Backend> Developer> Zones. Associate the zone with your template and plugin(**alias module**)|http://www.impresspages.org/docs/working-with-plugins/custom-zone-example/|
 +|4. Populate the block from point 0. with content |Create a **System** File in your plugin folder to populate your Block you generated in 0. with content. You can add some JavaScript / CSS to the page too by doing <code>
 +$site->addCSS(BASE_URL.PLUGIN_DIR.'examples/random_sentence/public/randomSentence.css');
 +$site->addJavascript(BASE_URL.PLUGIN_DIR.'examples/random_sentence/public/randomSentence.js');
 +</code>|http://www.impresspages.org/docs2/core2/blocks/|
 +
 +
 +===== Commands =====
 +
 +<sxh php>
 + //generate a named block
 + <?php echo $this->generateBlock('main'); ?>
 + <?php echo $this->generateBlock('custom_block'); ?>
 +
 +  //generate a link to a custom_zone
 +  <?php echo '<a href="'.$site->generateUrl(null, 'custom_zone').'">AddressBook records</a>'; ?>
 +
 +</sxh>
 +
 +
 +===== Ajax =====
 +
 +== Add Javascript ==
 +Add the **m g a** vars (http://www.impresspages.org/docs2/core2/mvc-model-view-controller2/)
 +To point to the right controler.
 +
 +<sxh js>
 +//in system import the *.js
 +// 2 is the internal import priority. Default is 1. Makes script be imported after all other, like jquery. 
 +$site->addJavascript(BASE_URL.PLUGIN_DIR.'zvg/zvgtable_zone/js/jstest.js', 2);
 +</sxh>
 +
 +<sxh js>
 +$(document).ready(function() {
 +  console.log("request per ajax now!");
 +  showRandomSentence();
 +});
 +
 +
 +//post request to our plugin to get new sentence
 +function showRandomSentence() {
 +    var data = Object();
 +    data.g = 'zvg'; //our module group
 +    data.m = 'zvgtable_zone'; //our module name
 +    data.a = 'getNewSentence'; //action (method) that need to be executed on the server
 +
 +
 +    $.ajax( {
 +    type : 'POST',
 +    url : ip.baseUrl, //ip.baseUrl is a root of your website available globaly in JavaScript
 +    data : data,
 +    success : sentenceResponse,
 +    dataType : 'json'
 +    });    
 +}
 +
 +function sentenceResponse(response) {
 +
 + console.log("Receive data:");
 + console.log(response);
 +}
 +</sxh>
 +
 +== Add php in sentenceResponse.php  ==
 +<sxh js>
 +class Controller extends \Ip\Controller{
 +    public static function getNewSentence() {
 +        global $site;
 +        $data = array(
 +            'status' => 'success',
 +            'sentenceHtml' => "hellow from controler"
 +        );
 +        
 +        $answer = json_encode($data);
 +        $site->setOutput($answer);
 +    }
 +
 +}
 +</sxh>