We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22527
    • 6 Posts
    Greetings all, I’m new here. I’m trying my best to follow the rules, but I couldn’t figure out how to properly categorize this post.

    I’ve been tasked with a project that I’d like to use ModX for, due to what I’ve heard about its flexibility - I will most likely be adding in quite a bit of external php snippet functionality to do this. I’m just looking for some "best practice" direction, as hunting around on the forums and searching google has been relatively fruitless in this regard.

    My client wants an inventory list system a bit like one featured on the below site, but it will be with RVs instead of yachts, and will be far less complex (no filters or sorting is required, but the level of detail on individual items will be similar):

    http://yachtauctions.com/inventory.php

    He wants to be able to add and edit RV listings himself on the site - eventually he may want to add other types of item categories, so I’d like to design it in such a way that it can be extended easily to those ends (object-oriented, probably). Here’s where I’m stuck: Is there an easy way to build this sort of functionality into the manager with Revolution or should I just hand-code some custom php snippets for those pages, and design the this specific administration panel outside of ModX’s manager? My understanding is that this is the whole point of using Revolution rather than Evolution (expanding the Manager). Even then, I don’t even have a clue where to start. embarrassed

    I had some php and oop training in college, but I’ve not been using these skills recently, and I’m quite rusty. Any guidance on this would be amazing - I’m trying my best to help a friend in need.
      • 33983 ☆ A M B ☆
      • 181 Posts
      There are always at least a few different ways to do something if not more in MODX and I will give you what I think would be the easiest way.

      1. Make a template called RV Products
      - In the template make lots of TVs that handle all of the data for the RV. See: http://rtfm.modx.com/display/revolution20/Template+Variables and http://rtfm.modx.com/display/revolution20/Creating+a+Template+Variable
      2. You will probably need to write a custom snippet(http://rtfm.modx.com/display/revolution20/Snippets) using the extra getResources(http://rtfm.modx.com/display/ADDON/getResources) that will sort your list of RVs which will be Resources(web pages).

      If you write a custom manager page(http://rtfm.modx.com/display/revolution20/Custom+Manager+Pages) then you limit your ability to customize it in the future with out reprogramming, but it may be more efficient depending on how complex your search/sort queries would be.
        • 22527
        • 6 Posts
        Thank you for the help! smiley That sounds like a splendid way to make use of template variables, I can’t believe I didn’t think of them as being so versatile (it’s in the name...sheesh). I clearly have a lot to learn here.

        As I get further into this project I’ll post my progress under this thread as I go along - more detail will be provided in case it can be of use to other noobs like myself.

        As far as the administrative section / session management goes (the part I am still most confused about), from what I understand, it could (and should, in this instance) still be a login separate of ModX, right? My client is an older gentleman and could be intimidated by managing data within Manager. I was thinking a simple "add RV" page and a "edit RV" page, and perhaps even an "edit all" page for deleting and editing multiple listings more easily.

        I’m sure this has been covered somewhere else before, as it’s pretty common - if someone has a good tutorial or reference on this subject, please let me know. I’ll keep hunting the forums and manual pages as needed.
          • 33983 ☆ A M B ☆
          • 181 Posts
          I would advise K.I.S.S (keep it simple). You don’t need to write an extra plugin to have him log in, think of it this way. Can I make the manager simpler for my client/end user? Regardless of what you end up with there will be some training involved. For one you can hide any unnecessary tabs. Here is a good place to read up on: http://www.gregorysmart.com/2010/11/19/guest-post-configuring-the-manager-for-the-non-administrator/. Also read over: http://rtfm.modx.com/display/revolution20/Administering+Your+Site.

          There is also an extra Frontpage: http://modx.com/extras/package/frontpage which may allow you to not have the client log into the manager.
            • 22527
            • 6 Posts
            Please pardon my ignorance/slowness in learning on this. embarrassed I’ve really been trying to "get it", but I’m still struggling, and this overly verbose post might prove detailed enough for someone else to be interested enough to provide input, too. About halfway through writing this, ironically, I’ve begun to understand what I’ll be doing (I...think).

            I’ve been obsessively studying my butt off for the last few days on everything (very helpfully) posted here, but there are still some fundamentals of this project that have me completely stumped, specifically on how to implement these things inside of ModX. I’m afraid that what I’m asking for is more hand-holding, unfortunately. Please look over this and let me know where I’m wrong or am confused.

            Please allow me to reiterate my exact scenario. - I’d appreciate help from anyone who can chime in. See below for my ugly, makeshift sitemap of sorts - I am a strong visual and interactive learner, so similar existing code examples would be amazing.

            KEY for the sitemap below:
            ? = I’m really confused about how the logical layout of this page (split into TVs, templates, chunks, snippets, etc) is going to look like, even for basic operation
            ! = This page is relatively close to complete, as far as the client’s requirements are concerned (very ugly, but he doesn’t care)
            ( ) = me attempting to describe the resource in some detail and what other resources/elements will be applied to it/are already applied

            ![[~Home]] resource page (has "BaseTemplate" template applied to this resource, css is referenced by template, currently working fine)
            |
            --?[[~RV_List]] resource page (lists all currently published/selling RVs; this will probably utilize [[getResources]] snippet to pull some TVs from each of the below resources, and [[getPage]] for pagination. This resource page will be loaded INTO [[~Home]] when it is clicked on in the wayfinder nav menu, as per my understanding, which is why it will get its own template for content being displayed {as Josh helpfully suggested}).
            |
            --?[[~SPECIFIC RV Detail Example 1]] resource page (one resource for *each* RV? How should I name these to keep them organized in Manager, then? Anyways, this will output all TVs for stored item through the resource - also will use dressy jQuery-style hover pictures as featured on client’s desired sample page http://yachtauctions.com/listing.php?vessel=6514 {not mine and I have no affiliation with them}, I’ll worry about that later when data is actually displaying lipsrsealed)
            |
            --?[[~SPECIFIC RV Detail Example 2]] resource page (uses same template file as above, the only difference being that it contains different default {create/edit doc tab, in Manager} and user-made TVs {template variables tab} as part of the resource)
            |
            --?[[~SPECIFIC RV Detail Example 3]] resource page (the third sample RV. These will all be stored under their own subfolder for basic organization - I’ll make a separate Manager login for the client, separate of mine, with all non-critical editing areas hidden, he will still see these for editing purposes...sound right to you?)
            |
            --![[~Informational Page 1]] (using same "BaseTemplate" as home)
            |
            --![[~Informational Page 2]] (using same "BaseTemplate" as home)

            All I need is for someone to either a.) confirm that this all seems about right, or b.) tell me that I’m completely off my rocker in how I’m attempting to build this functionality into the site (and provide some examples, or explain where I’m wrong, ideally).

            Thanks again for the previous help, Josh, at least I’ve gotten this far!