Let’s say I wanted to write a very basic photo gallery (this is just for my understanding) where the user would login via the manager, click "somewhere" to add a picture which would bring up a page where they could upload a photo and add a description. How would one go about this so I can understand how I would create custom managers in the backend that would make it easier for an end user and simply output it in a page.
Thanks...sorry I’m new here
Hell could make it even simpler...say I wanted a new admin page with one text box that saves that information to the database. How do I do this? and then how do I output the contents onto a page?
Thanks!
I already have it installed, I don’t actually need a photo gallery but I want to understand how I could make a backend page that has functionality, say saving something to a database and then how I would output that row into the frontend...does that make more sense? It’s hard to explain.
It look like I want to make module I think. Then use snippets to get the data into a template...that the best way?
-
☆ A M B ☆
- 24,524 Posts
I’ve got a tutorial on writing an AJAX-based editable database management module.
And yes, a snippet is how you would access the data for the front-end. I’ve even got a tutorial on using extjs to make a nice paging data grid with a simple search function.
http://www.sottwell.com/database-module.html
http://www.sottwell.com/article-extjs1.html
-
MODX Staff
- 10,725 Posts
Correct, module is the backend interface, usually for configuration and other administrative forms, and these can share parameters (think configuration settings) with snippets and/or plugins. Snippets become a front-end interface component and plugins can serve various purposes front- or back-end. Coming from WordPress, this can be confusing since our semantics are slightly different and the structure is broken down into smaller pieces.
-
☆ A M B ☆
- 24,524 Posts
In a nutshell:
Modules are for adding features to the Manager, such as a newsletter management feature.
Plugins are for interrupting normal processing to add custom functions (whether to parsing a document to generate a web page, or processing a user login, or processing the saving of an edited document, among the many processes that can be interrupted). This avoids the usual necessity to hack the core code.
Snippets are PHP code whose return values get inserted into the web page. Similar to putting <?php someFunction(); ?> in an HTML page.
Chunks are HTML code or raw text that gets inserted into the web page. They can contain snippet and TV tags.
TVs are sort of a blend of snippets and chunks that are related to specified templates and can be edited on a page-by-page basis. They are closely related to the default document variables such as [*pagetitle*] and [*content*], which are based on the database fields in the site_content table.
So how would one go about adding custom fields to edit page?
Thumbnail Name: [ some_file_name.png ]
Then that is saved in the database somewhere?
and I can use a snippet to display it in my template, but I am confused on easily modding the manager making daily tasks easier.