Quote from: thissideup at Dec 16, 2009, 03:56 PM
I reviewed the documentation to install it, but didn’t find anything that actually explains what the tools does.
in short words. with bloX you can organize your php-scripts and html-chunks for projects and there tasks in files. bloX takes an array from the file getdatas.php and renders these datas into chunks from filesystem.
you can use it like ditto, if you want, but you can also list datas from custom-tablerows or create you own array in getdatas.php, which you want to render into chunks.
ok, will try it as short as possible.
I found, when developing webprojects for modx you have to switch often between snippets and chunks to edit them. To do that from modx-manager it is not very efficient and you have no version control. then I found for most projects I need a part for getting datas into an array and one part which renders this datas into my chunks. Additionally sometimes you have to store datas from frontend into the database.
So I was looking for a way
1. how to organize my project-files in directories
2. how to get the different needed datas easy into one array
3. how to render these array into different chunks from filesystem (often there are also nested chunks, for example calendar views, dropdowns, ralational-subdatas....)
To 1
How to organize the files you can see in the screenshot.
There are folders under custom/ for projects with subfolders for tasks belonging to these projects.
in these task-folders there are two folders templates/ and includes/
under templates ...guess... there are all chunks needed for this task.
under includes there is mostly only one file ’getdatas.php’ sometimes there is also a file onsavedatas.php or additional files ith functions and classes
special for this task.
To 2
to get datas into arrays I have the the file getdatas.php for each project. Here I can use modx-api functions and some special functions from blox-class, for example $this->getrows() which gets all datarows depending of parameters from my bloX-snippetcall.
these parameters can be for example
&parents
&documents
&filter //creates the where clauses for mysqlstatment
&orderBy
&tablename
&IDs
&pagestart
&perPage
there are some more and you can add your own..........
there are also functions to create arrays for month-calendar-views and to put events into these arrays for render them later.
...and more.
at the end of getdatas.php blox needs an array
$bloxdatas
this array can have $bloxdatas[’innerows’][’nestedarray’]=$nestedarray
$nestedarray can have more innerrows and so on.
To 3
ok, now these datas are rendered into chunks. the outer chunk by default is bloxouterTpl.html
if there is a arraykey [’innerows’][’nestedarray’] bloX looks for an chunk nestedarrayTpl.html to render the array under [’innerows’][’nestedarray’] into that.
and so on.
I had a look to some snippets how they do that, mainly ditto and maxigallery and use the same technic a little bit modified with the chunkie-class for phx.work and setting the placeholders and rendering the chunks and so on.
Did also some tests with revolution and found we do no longer need this chunky-class and phx. First tests are looking good in revo.
ok in short word this is what bloX can do for you. Hold all your files on filesystem and use them directly, without the need to create chunks and snippets in the database for special projects. As they are now in files it is easy to use SVN or Git and edit them directly in your editor or IDE (I use the aptana-plugin for eclipse, because I can develop directly on my online-files from different computers at home and at work).
Of course you can also use modx-chunks. You only need the parameter &tpls=`bloxouter:myouterchunk,nestedarray:mynestedchunk,....andSoON`
bloX has also some special functions to work together with Xedit. Xedit is our frontend-editor-project we are working on, see my signature for infos.
I’ve worked in a UNIX/Linux environment for all of my s/w development career, and am more efficient with the command line than GUIs. Yes, that means I use VIM.
I also use SVN for my version control.
of course you can also use VIM and SVN, why not, because all chunks and snippets for your projects are in files.