We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34120
    • 236 Posts
    I posted a thread the other day about site and data structure. Since then I’ve been searching around the forums and a few other sites for more information on this.

    Could xPDO be used to pull data from a custom table and display it on a page? As mentioned on my previous thread I’m creating a resource/page for each product item. I’m not sure if I’m on the right path here. What is the best practice for building a catalog/ecommerce type site? I’ve read on a thread that using singular pages isn’t really the best approach. I’m also concerned about overhead and pulling all the TVs from the individual pages into lists.

    Apologies if this is a bit of a repost but I’m looking into specifics using Revolution now.
    Many thanks in advance.
      • 28215
      • 4,149 Posts
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 34120
        • 236 Posts
        Thanks for the links Shaun, I’ll get reading...
        I guess it’s difficult for you to comment without knowing the specifics of my project. Would you say this is a preferable method to creating a single resource for every item?
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: rf9 at May 28, 2010, 10:44 AM

          Thanks for the links Shaun, I’ll get reading...
          I guess it’s difficult for you to comment without knowing the specifics of my project. Would you say this is a preferable method to creating a single resource for every item?
          IMO, this is the best option for any kind of data that exceeds a quantity of about 100, though I’m an extremist and would likely do it regardless of quantity. To me, MODx Resources are simply a view into dynamic data; a place for content that is ready for presentation, not source data that you may need to view in many different ways. YMMV; certainly a list of 10 things would be more practical as simple Resources in MODx than requiring the design and development of a custom data model and potentially a custom UI for managing your model’s data.
            • 23491 ☆ A M B ☆
            • 1,056 Posts
            Quote from: rf9 at May 28, 2010, 10:44 AM

            Thanks for the links Shaun, I’ll get reading...

            I agree, thank you for this collection of links. This is exactly what I was looking for!

            @OpenGeek,

            I would imagine there could be a way to accomplish friendly URLs via a Plugin (or similar) for data contained within 3P tables, correct?

            I love the idea of managing the data outside of MODx Resources, namely for the performance reasons. I know that with hundreds of products (thinking e-commerce catalog here) the system can begin to suffer performance loss when managing each product as a Resource with multiple TVs, etc. Unfortunately, it does require additional work to attempt exposing 3P data, especially if you’re seeking unique Friendly URLs (e.g. in an XML sitemap) or creating groups of links/content without using Wayfinder/getResources, etc.

            The need for a custom UI to manage the model’s data is a separate opportunity, but one definitely worth taking. I am looking to tackle both of these myself to better familiarize myself with Revo/xPDO/ExtJS.
              Mike Reid - www.pixelchutes.com
              MODx Ambassador / Contributor
              [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
              ________________________________
              Where every pixel matters.
              • 22295
              • 153 Posts
              Quote from: pixelchutes at May 28, 2010, 04:06 PM

              The need for a custom UI to manage the model’s data is a separate opportunity, but one definitely worth taking. I am looking to tackle both of these myself to better familiarize myself with Revo/xPDO/ExtJS.

              I went that road, with a system that everything is front-end, from user administration tasks to content management - it’s all in the front. (except me) no one there uses the /manager.. and I must say:
              a. for ALL end-users (regardless to technical knowlage - admins, moderators, or simply content editors), custom front-end interface is a blessing, compared to any hack/scaled-down/managermanager/etc manager ui... they get what they want - how they want it.
              b. Permissions - you can easily extend and use your own permission sets, tailored for your client - this is a great thing, especially as these always resolve with a simple $modx->hasPermissions(’yourCustom’).
              c. In revo - it’s way simpler then you imagine (mvcC model..) You can reuse many of the existing processors within the /manager. you don’t need to start from zero.

              I would advice to start by looking at the NET tab in Firebug, while using the /manager for various actions, you’ll get the idea without digging into to much code.
                • 34120
                • 236 Posts
                Thanks for the great post OpenGeek that’s a huge help and has really clarified things for me.
                I guess this approach is really about using MODx as a framework rather than a CMS (hence CMF I suppose smiley)
                I’m going to get stuck into this now and see how I go, I’m sure there will be a few questions to follow.

                @ oori and pixelchutes, interesting stuff. I may get around to looking at this further down the line, thanks.

                Cheers all, much appreciated.
                  • 34120
                  • 236 Posts
                  Quote from: splittingred at May 28, 2010, 07:41 AM

                  http://svn.modxcms.com/docs/display/revolution/Using+Custom+Database+Tables+in+your+3rd+Party+Components
                  I’ve been working through the above tutorial and I’ve got as far as the ’using a new model’ section. I’m stumped at the helper file snippet ’StoreFinder’, I’m not sure where this file needs to go.
                  let’s create a snippet called ’StoreFinder’ in our MODx Revolution instance, and put this inside of it (obviously changing the first line to the correct path):

                  Also I’m not creating a component as such I’m just looking to access a custom database table. Is it still best to use the component format?

                  Many thanks
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: rf9 at Jun 07, 2010, 10:01 AM

                    Quote from: splittingred at May 28, 2010, 07:41 AM

                    http://svn.modxcms.com/docs/display/revolution/Using+Custom+Database+Tables+in+your+3rd+Party+Components
                    I’ve been working through the above tutorial and I’ve got as far as the ’using a new model’ section. I’m stumped at the helper file snippet ’StoreFinder’, I’m not sure where this file needs to go.
                    let’s create a snippet called ’StoreFinder’ in our MODx Revolution instance, and put this inside of it (obviously changing the first line to the correct path):

                    Also I’m not creating a component as such I’m just looking to access a custom database table. Is it still best to use the component format?
                    It’s a Snippet. You create Snippets in the Element tree. This is one of the basic principles of MODx: PHP code that appears in MODx content is encapsulated in Elements known as Snippets.

                    Any PHP code Snippet is for our purposes a Component (or 3PC) or part of a Component. In this case a Component would be the custom model you are creating plus any Snippets that might use your custom model. Anything that is not part of the core of MODx is an Extra and is by itself or in combination with other Extra’s, a 3rd-Party Component (3PC).
                      • 34120
                      • 236 Posts
                      Thanks OpenGeek, the 3PC stuff makes sense as does the elements and snippets structure. I’ve made a transport package before so I’m a little familiar with this layout.

                      I still can’t get my head around the ’StoreFinder’ snippet. As I understand, it’s a temporary snippet for development. It allows you to develop in a different directory to your MODx install. Should it be placed in the MODx install or in the directory where you are developing the component?