Good software ! I like it so !
About the beta 3 version :
- Few documentation about plugins.
- How to merge 2 cells in the editor ?
- How to list the images when inserting, without writing the url ?
- How to write a plugin for XH ? (very good question !)
Otherwise, great job, congratulations and bravo!
Beta 3
Re: Beta 3
Hallo Patrik, there is a FAQ-Section under developement:PatrikGC wrote:- Few documentation about plugins.
http://www.cmsimple-xh.de/faq/ - the translators are working.
CMSimple_XH versions "beta x.x" are for testing, for Experts. We will make some documentation before publishing CMSimple_XH 1.0
You can make Plugins for CMSimple_XH like Plugins for CMSimple classic. Some hints for CMSimple_XH you will find here:PatrikGC wrote:- How to write a plugin for XH ? (very good question !)
http://www.cmsimple-xh.de/english/?Developers-Area
Re: Beta 3
Hi Patrik!
You can also upload and delete images with this filebrowser.
Have fun and thanks for posting your hints.
Holger
Mark the two tablecells, open the context-menu with a right-click, select cells -> merge cellsPatrikGC wrote:- How to merge 2 cells in the editor ?
Open the "Insert Image" dialog with a click on it's button, then press the "Browse server" button to open the Filebrowser in a new window. Here you can see a list with a preview of all your images in the /images folder. A click on a filename will insert the image into your content.PatrikGC wrote:- How to list the images when inserting, without writing the url ?
You can also upload and delete images with this filebrowser.
Have fun and thanks for posting your hints.
Holger
Re: Beta 3
And here is a brand new plugin example: http://www.cmsimplewiki.com/doku.php/plugins/examplePatrikGC wrote:- How to write a plugin for XH ? (very good question !)
Re: Beta 3
Bonjour Patrick,
I guess the tutorial johnjdoe pointed to helped a lot. It is a really nice one. Here is some additional information on how to make use of the new pluginloader's (that is already shipped with cmsimple_xh) api to the page specific data. They are stored in the file pagedata.php within the content folder. At the top of it you will find a list of the available data fields.
Reading: The informations about the current page can be accessed via the global variable $pd_current. It holds an array using the data fields as keys. (e.g. $pd_current['last_edit'] contains the date of the last edit of the current page.) To gather all pages just use $pd_router->find_all();. There are some more functions to select and sort the page infos - have a look at plugins/pluginloader/pagedata/page_data_router.php
Writing: If your plugin needs to add its own data to the page informations, let's say as "my_test_field", just add this line:
Create a function that returns the html-form you want to add: This function
To get it all together, here is a short example: A plugin that adds some additional information - might be an excerpt or something - to the pages and shows a list of this excerpts, sorted by the date of the last edits. Something like this would have been hard work before, with the new pluginloader it can be done in about 30 lines of code:
Create the folder "plugins/my_test_plugin", add the files "index.php" and "my_test_plugin_view.php" to it.
index.php:
my_test_plugin_view.php:That's all! It is a working plugin. Everything else, about configuration and language files, has not changed at all and was described in the tutorial better than I could ....
Regards
Martin
I guess the tutorial johnjdoe pointed to helped a lot. It is a really nice one. Here is some additional information on how to make use of the new pluginloader's (that is already shipped with cmsimple_xh) api to the page specific data. They are stored in the file pagedata.php within the content folder. At the top of it you will find a list of the available data fields.
Reading: The informations about the current page can be accessed via the global variable $pd_current. It holds an array using the data fields as keys. (e.g. $pd_current['last_edit'] contains the date of the last edit of the current page.) To gather all pages just use $pd_router->find_all();. There are some more functions to select and sort the page infos - have a look at plugins/pluginloader/pagedata/page_data_router.php
Writing: If your plugin needs to add its own data to the page informations, let's say as "my_test_field", just add this line:
Code: Select all
$pd_router -> add_interest('my_test_field');
- has to be named like your plugin, extended by '_view' and expects the infos of the current page as parameter. E.g.:
Code: Select all
function my_test_plugin_view($page){ //code that generates and returns your form }
- This form has to contain a hidden field named "save_page_data" - and of course the input fields for your data (e.g. <input type="text" name="my_test_field" value="'. $page['my_test_field'] .'" />)
- Store this function in a file that is named just like the function in the root folder of your plugin. (E.g. plugins/my_test_plugin/my_test_plugin_view.php)
Code: Select all
$pd_router -> add_tab('label of the tab', $pth['folder']['plugins'].'my_test_plugin/my_test_plugin_view.php');
Create the folder "plugins/my_test_plugin", add the files "index.php" and "my_test_plugin_view.php" to it.
index.php:
Code: Select all
<?php
if(!defined('PLUGINLOADER_VERSION')){ // make sure an appropriate pluginloader is installed
die('Plugin '. basename(dirname(__FILE__)) . ' requires a newer version of the Pluginloader. No direct access.');
}
$pd_router -> add_interest('my_test_field');
$pd_router -> add_tab('My test', $pth['folder']['plugins'].'my_test_plugin/my_test_plugin_view.php');
$my_pages_array = $pd_router->find_all();
// o.k. - this sorting has nothing to do with the new function
// - I just could not resists to do something with the page data
$sorter = array();
$keys = array();
foreach($my_pages_array as $index => $data){
$sorter[$index] = $data['last_edit'];
$keys[$index] = $index;
}
array_multisort($sorter, SORT_DESC, $keys, SORT_DESC, $my_pages_array);
// prepare the output
$my_output = '<ul>';
foreach($my_pages_array as $key => $params){
$key = $keys[$key];
$my_output .= '<li><a href="'.$sn.'?'. $u[$key].'">'.$h[$key].'</a>:';
$my_output .= $params['my_test_field'].'</li>';
}
$my_output .= '</ul>';
// this will add the list on top of your pages
// probably you want to echo the $my_output somewhere in the template instead
$o .= $my_output;
?>
Code: Select all
<?php
function my_test_plugin_view($page){
global $sn, $su;
$view = '<form action="'.$sn.'?'.$su.'" method="post">';
$view .= "\n\t".tag('input type="text" size="50" name="my_test_field" value="'. $page['my_test_field'].'"');
$view .= "\n\t".tag('input name = "save_page_data" type = "hidden"');
$view .= "\n\t".tag('input type="submit"').tag('br');
$view .= "\n".'</form>';
return $view;
}
?>
Regards
Martin
Last edited by Martin on Wed Sep 16, 2009 7:37 pm, edited 1 time in total.
Re: Beta 3
I thank you all !
Merge cells : ok for the right clic, I didn't know it.
Pictures : I must resize the opening window for seeing the picture files inside. And after, I can insert a picture in my text.
Plugins : I thank you all for the links, I will go and see them.
Martin : Great thanks for the small tutorial !
And now, as we say it in french : yapluka
yapluka -> il n'y a plus qu'à... -> we must do it now / let's go
Merge cells : ok for the right clic, I didn't know it.
Pictures : I must resize the opening window for seeing the picture files inside. And after, I can insert a picture in my text.
Plugins : I thank you all for the links, I will go and see them.
Martin : Great thanks for the small tutorial !
And now, as we say it in french : yapluka
yapluka -> il n'y a plus qu'à... -> we must do it now / let's go