Now it’s ready, I totaly rewrote the display snippet with ... Ditto .
An example is better than words:
check the demo
Posted in the repository
I have a folder wich is the under that each article is a document.
This folder is used to display a list of the articles.
The List of Articles:
In this folder I only have a call to a snippet:
[!RunDitto? &SelectFilterTV=`Category` &SelectPerPage=`10,15,20,25` &tpl=`ProduitAllDittoTpl` &language=`francais`!]
- &filtertv: optionnal parameter if you want a select list to allow the user filter the results with tv value.
- &perpage: optionnal parameter of comma delimited numbers to allow the user to choose number of results per pages in option list.
- &tpl: the template for Ditto.
In this Template I have a call to the snippet MaxiGallerySolo to display a thumb of the article if a gallery exist for this article.
There is a small problem because I use several call to this snippet (one per article) and regClientScripts() is redefined so it cause an error, for the moment this function is commented, I’m going to talk to doze to find a solution.
- &language=`francais`: for the frogs, if ommited english is used. (you must have the lang file: /assets/snippets/ditto/lang/francais.inc.php)
A form is construct automatically to allow user choices.
If no parameters are set, no form is displayed.
Then, RunDitto call Ditto with these parameters.
The Articles:
Each Article page contain only a chunk:
{{ArticleTpl}}
It contains all the fields, some are Document properties (title, longtitle, description) others are TV, all displayed with [*#my_fields_names*] so the registered user (in manager) could edit them in the front-end.
There is a call to the MaxiGallery snippet to display a gallery for that article login users(in manager) can uplod and manage their images.
[[MaxiGallery? &manager_webgroups=`Registered Users` &thumb_use_dropshadow=`1` &thumb_shadow_bgcolor=`C7C2A1` &pic_use_dropshadow=`1` &pics_in_a_row=`3` &display=`embedded` &embedtype=`lightboxv2`]]
There is two call to [[effaceprod]] and [[ajouteprod]] to display buttons for registered user to allow them add or delete an article.
The redirect plugin:
This plugin dissalow the user to have access to the backend (the manager), after he is logged in the manager login, he is redirected to the frontend with manager rights, so he can modify fields, add or erase an article.
I hope that in the next releas of MODx the option "access to the manager" will work, because the redirect plugin need to hack the core to insert a new event, before manager is load.
TODO:
Add a cart’s system, the one of Susan seems very promising.
Thanks to MODx, Ditto, MaxiGallery and all of you, I’m waiting for your feedbacks (good and bad).