I’ve made a catalogue solution to present articles, products or whatever you want.
It is in beta version, can you send me feedback ? Here is the
demo, the codes follow.
Attachment: A screenshot of the edit mode.
What it does:
- All the "fields" for articles are tv or document fields : pagetitle, longtitle, description.
- Include maxiGallery snippet, you can add a gallery (with lightbox
)for each article and manage it (dowload, sort, add, remove), see MaxiGallery snippet
- Full frontend edit after manager loggin, edit fields, add article, delete article, manage images.
- List of all articles with one thumb image for it (if set)
The files:
- A snippet to add an article
- A snippet to delete an article (and its gallery)
- A snippet to present a list of articles with one thumb
- A chunk that is a template to display full articles informations
- A plugin to redirect editor to the frontend with QuickEdit rights.
Todo:
- Add comment to the code
- write a good readme
- test and more
Here it is:
Each product is a document under a folder (utilised for the articles list) in the documents tree
The ListArticles page (the root folder for article):
It contains only a call to the [[ArticlesList]] snippet:
The database is searched to retrieve all articles, and then for each one we search if it has an image.
The content is displayed in a table
Each image (or non-image text) is linked to the article’s page.
The article Page:
It contains only a call to a chunk that is a template to diplay each article on one page:
{{ArticlesTpl}}
This chunk contains the fields to display the articles in a [*#NameFields*] so they can be edited with quickedit.
Somes are TV, other are page propriety (pagetitle, longtitle, description)
There is a call to maxigallery to display the gallery.
There is a link to return to the list of all the articles.
The call to [[RemoveArticle]] and [[AddArticle]] are used to add and remove an article.
The [[AddArticle]] snippet:
The [[RemoveArticle]] snippet:
And the redirect snippet to disallow manager access to non-Admin users:
You must add this new event in the "system_eventnames" table (this is the sql code):
INSERT INTO `modx_system_eventnames` ( `id` , `name` ,`service` , `groupname` )
VALUES ( '93','onBeforeManagerPageInit', '2','');
Added these lines to the /manager/index.php at line 184, just before [tt]// first we check to see if this is a frameset request[/tt] to invoke the new event.
( I don’t know what to do with the parameter :[tt]array("action" => $action)[/tt])
// ****HACK**** New event added:
$modx->invokeEvent("OnBeforeManagerPageInit",array("action" => $action));
//***********************************************************************
In the Redirect plugin with the "Manager Access Events" "OnBeforeManagerPageInit" and "OnManagerLogin" checked.
if ($_SESSION['mgrPermissions']['id']!='1'){$modx->sendRedirect($modx->makeurl($modx->config['site_start']));}
PS:I’m not a coder and haven’t an high skill in english (isn’t it ?)