We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37667
    • 18 Posts
    So I've read in several places about the benefit of using a custom table with one resource vs having thousands of resources. Sounds great if only I could figure it out.

    The project is a hotel search website with about 100,000 hotels. The hotel pages will all display using the same formatting so it would make sense to use a custom table for those. I also want those hotel resources to be accessible via getResources to act as children in a parent resource, which may itself be from a custom table. For example my data has over 10,000 cities and I want to have city pages, such as a page for San Francisco, and on that page will be city specific data as well as select hotel resources via getResources. Those hotel resources need to be controllable via publish and un-publish dates since I'll have certain hotels offer time sensitive promotions that I want to feature on the city pages.

    Also on both the hotel and city resources that are fed content from the custom tables, I need those resources to display with their own friendly URL such as domain.tld/cityname for the city page or domain.tld/hotelname for the hotel page.

    Also these custom table resources will need to find their way into wayfinder menus. For example I may have a California menu that has a list of cities in California that each represent a city resource from the custom table for cities.

    I've tried working through the tutorial at http://bobsguides.com/custom-db-tables.html but I'm no where near making it work. And I've read this on custom tables and 3rd party components http://rtfm.modx.com/display/revolution20/Using+Custom+Database+Tables+in+your+3rd+Party+Components and I've also got the modx: the official guide book and I'm just not getting how to bring this all together. Any insights or additional tutorials would be very helpful as this really unlocks the power of the CMS and it's just such a mystery on how to implement.

    If it matters I'm using revo 2.2.1.

    Thanks in advance for any and all help, I really need to make this work and I'm sure I'm not alone.
      • 4172
      • 5,888 Posts
      Cities can be Resources or, I think better, another custom-table.

      Its possible to manage them with a MIGXdb - CMP
      Hotels in a City can be a MIGXdb-TV in the City-MIGXdb-CMP-Form and/or a standalone MIGXdb - CMP

      Friendly urls could easily be done with a onPageNotFound - plugin

      MIGXdb can help to create your xpdo-packages and your CMPs to manage them.
      Will add a Tutorial how one can do stuff like that with help of MIGXdb soon.
      If you want to try it out, you can ask your questions about that on the MIGX - board.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 3548
        • 102 Posts
        I would strongly advise to put everything in custom tables and develop your own snippets. Everythin else will lead to headaches...IMHO (and experience...)
          Antonio Zdilar
          linearvector.com
          • 33968
          • 863 Posts
          Quote from: blankcheck at May 15, 2012, 03:14 PM
          I would strongly advise to put everything in custom tables and develop your own snippets. Everythin else will lead to headaches...IMHO (and experience...)
          +1

          With that much data it's going to be much more efficient and your search will be faster. You'll also need to look into some custom caching, and a manager component to administer your data. How's your php?
            • 37667
            • 18 Posts
            Quote from: Bruno17 at May 15, 2012, 03:52 AM
            Cities can be Resources or, I think better, another custom-table.

            Agreed, that's what I was trying to describe and I'm not finding how to do this.

            Quote from: Bruno17 at May 15, 2012, 03:52 AM
            Its possible to manage them with a MIGXdb - CMP
            Hotels in a City can be a MIGXdb-TV in the City-MIGXdb-CMP-Form and/or a standalone MIGXdb - CMP

            OK, I'll take a look at this and see if I can sort it out

            Quote from: Bruno17 at May 15, 2012, 03:52 AM
            Friendly urls could easily be done with a onPageNotFound - plugin

            Is this something that is already available or is it custom code?


            Quote from: Bruno17 at May 15, 2012, 03:52 AM
            MIGXdb can help to create your xpdo-packages and your CMPs to manage them.
            Will add a Tutorial how one can do stuff like that with help of MIGXdb soon.
            If you want to try it out, you can ask your questions about that on the MIGX - board.

            Thanks, any full tutorial on how to connect all these parts would be extremely useful.


            @blankcheck & Lucas: I completely agree to use custom tables, that's exactly what I was trying to describe and am not figuring it out. I guess this kind of implementation is outside the "easy to use" portion of modx lol. My PHP skills are beginner to novice, so I'm getting lost quick if there's not clear line by line instructions I can follow on how to build a site in this manner. I've already got a custom table installed via the instructions found here http://bobsguides.com/custom-db-tables.html, but I can't sort out including publish/un-publish and SEF URL's for each custom table record, and linking those records to other records via getResources or including them in menus via wayfinder.
              • 3548
              • 102 Posts
              I hope that you won't take this wrong way, but, it seems to me that you have only 2 options:


              • Take few months and learn MODX (from developing perspective)
              • Hire someone to do this for you

              This kind of project is not too complicated, but it isn't trivial either.
                Antonio Zdilar
                linearvector.com
                • 4172
                • 5,888 Posts
                If you're interested in doing it with help of MIGXdb and its not that urgent, you can create a new thread in the MIGX - board and we put it together step by step.
                Maybe at the end we have all steps together to create a nice Tutorial about it.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 37667
                  • 18 Posts
                  Quote from: blankcheck at May 16, 2012, 04:08 AM
                  I hope that you won't take this wrong way, but, it seems to me that you have only 2 options:


                  • Take few months and learn MODX (from developing perspective)
                  • Hire someone to do this for you

                  This kind of project is not too complicated, but it isn't trivial either.

                  No offense taken and I hope that you won't take this the wrong way, I agree I'm not a PHP guru but with clear instructions even us mere mortals can build great things. It has been stated many times here and in other threads that using custom tables unlocks the power of modx for large sites, so a clear A-to-Z step-by-step tutorial will go a long way to educating folks on how to maximize the potential of modx. I've been working on this for over a month as time allows, bought the book and read whatever I can find online but I'm not getting it to work. I'll be glad to help put together that tutorial to make the methods clear for others, hopefully you won't mind contributing.
                    • 37667
                    • 18 Posts
                    Quote from: Bruno17 at May 16, 2012, 04:20 AM
                    If you're interested in doing it with help of MIGXdb and its not that urgent, you can create a new thread in the MIGX - board and we put it together step by step.
                    Maybe at the end we have all steps together to create a nice Tutorial about it.

                    I'd be glad to do that assuming it will address all the issues I've described. But I'm not sure where the MIGXdb board even is. I've been searching in this forum and not finding it, and not seeing any forum link at http://modx.com/extras/package/migx. So if you could point me to the MIGX board I'd appreciate it.
                      • 4172
                      • 5,888 Posts
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!