We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34950
    • 31 Posts
    After creating some content in MODX I thought about creating a blog section. I read this article:
    http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution

    However, what I understood is every blog post must be created as a singe resource, and getResource would fetch that content.
    Is it possible, and how hard can it be, to implement all content being drawn from the database itself (avoiding resource creation), where one row in the database table would be like one blog post? I was thinking about putting TVs on one resource, where TVs would be queries to the database. If this is implemented, is there a module (or a way to set up a module) which would fetch data to look like a proper blog?

    Can anyone offer advice or thoughts about this?
      • 32316
      • 387 Posts
      ummm - a resource is just a row in the database - already set up - with an editor and everything else.
      So the blog/resource content would be drawn from the database (as is all content in Modx unless you go out of your way to do otherwise)

      avoiding resource creation by creating a blog post seems to me just a matter of semantics (though semantics are important at times) - in other words: create a blog post / create a resource are really very similar just different words.

      I was thinking about putting TVs on one resource, where TVs would be queries to the database. If this is implemented, is there a module (or a way to set up a module) which would fetch data to look like a proper blog?
      As is virtually always is true the answer to ’Is it possible to ...fill in the blank... in Modx?’ is YES

      As to the question "how hard ...":
      how hard is personal depending on experience and your definition of hard.

      just my 2 cents
        • 34950
        • 31 Posts
        This is my first site in modx, so please excuse my errors in understanding of fundamentals smiley. Anyway, what I basically wanted to do is put all blog content in my table (not system modx_ table) and fetch it using queries. The blog post resource would not appear in the resource tree.
        Why do I want this? I already have my tables which join with each other. In one of those tables I thought about putting columns that correspond to the blog content (title, introtext, text etc.) That way I could display title, introtext on other pages (not blog style).
          • 34193
          • 330 Posts
          How much experiance do you have with PHP if any it’s not hard to write a snippet to get the db stuff using php in the same way you would a standard php file create a connect script, carry out the query, echo the results (allthough the prefered way in a snippet is to return the ouput and then modx takes care of echoing it) but it is stored as a snippet and included in the page that way.

          If you are using revo then you can look at using xpdo to do the data retreival for you see http://rtfm.modx.com/display/revolution20/Developing+in+MODx
          and
          http://rtfm.modx.com/display/xPDO20/Home
            • 1169
            • 312 Posts
            @gr00

            This is just my 2cents worth.
            And South African cents are one seventh US so not worth much.

            I do not see any good reasons for not using resources unless you plan to have 10,000 blog posts.
            I would suggest a container for each category.

            How you display your resources is not dependent on if it is a blog or any other resource. That is the function of the template.
            You can chose witch parts of any resource to display or not to display and in what format.

            As the snippets are already available for a blog I do not see the necessity to reinvent the wheel.

            Others may feel different on this issue.

            That being said you are free to chose. MODX won’t mind how you chose to implement you site.
              DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
              • 34950
              • 31 Posts
              OK, I decided to go for a classic blog - with resources like in tutorial. Probably what I thought about other tables linking I will make with tags.
              Thanks all.