We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29847
    • 13 Posts
    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
      • 29847
      • 13 Posts
      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!
        • 10449
        • 956 Posts
        For photo galleries, your first choice is probably MaxiGallery: http://modxcms.com/MaxiGallery-532.html / http://wiki.modxcms.com/index.php/MaxiGallery

        I don’t know what you mean by "custom managers", but you can create special manager-roles (in "security" tab), and disable certain features. If the end-client doesn’t need to run modules, disable modules. Simple as that.

        You can use QuickEdit to change content from the frontend.

        You can use template variables to create you own special input-fields.

        You should read the docs first, to get a feel of how things run. Install it locally and hack around (e.g. with XAMPP or something similar).
        http://modxcms.com/documentation.html
          • 29847
          • 13 Posts
          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.

            • 29847
            • 13 Posts
            It look like I want to make module I think. Then use snippets to get the data into a template...that the best way?
              • 28042 ☆ 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
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 29847
                • 13 Posts
                Yeah that’s fine but I’m still confused on how everything works. Let’s say in wordpress when you make a plugin, you can have a backend page where the end user logs in and can update your plugin with a GUI, say a photogallery or even a shopping cart, how can I use the modx framework to make similar packages?

                Is that simply making a module then the end user logs in, goes to Modules > Manage Modules > then clicks on the module and uses it? and then I use snippets/chunks to output the data from the module?

                Sorry if this is confusing everyone, I’m confused myself smiley
                  • 22303 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.
                    • 28042 ☆ 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.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 29847
                      • 13 Posts
                      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.