We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51584
    • 5 Posts
    Hi,

    I came across a question when I compare MODx to Contao.

    In Contao I add a page and inside the page I add articles (at least 1 up to n). Those articles contain then various different block types (i.e. text, headline, image gallery, etc.), acutally the main content displayed in the frontend.

    Now, in MODx I see a resource, which has a template assigned. This template has one main window, which is displayed via [[*content]] in the template. How, how do I add additional parts? Only via template variables assigned to a template?

    Regards, Thomas
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can use Template Variables; MIGX and MIGXdb are especially useful for this kind of thing. There are a number of drawbacks to using TV for extended Resource content, though.
      https://rtfm.modx.com/extras/revo/migxdb/migxdb.tutorials/migxdb.create-a-basic-gallery-management-from-scratch-with-migxdb

      You can also create custom Resource types. This is not so easy, but BobRay has provided an add-on to simplify the procedure.
      http://bobsguides.com/blog.html/2014/06/02/why-extend-modresource/
      http://bobsguides.com/classextender-class.html

      Another method to do what you are describing is done with the ContentBlocks add-on.
      https://www.modmore.com/contentblocks/




        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
        • 4172
        • 5,888 Posts
        To add multiple 'articles' to one parent-resource, you can just add child-resources in the resource-tree and use getResources or pdoResources to create a list-output of the children.

        Its a good idea to use the Collections-Extra for articles-like children.
        Then they are hidden from the resource-tree and you have a nice grid to manage them.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 30585
          • 833 Posts
          I've just looked at Contao, and there are some similarities with MODX. Naturally, there are things that I believe MODX does much better.

          For example, If you want a page with more than 10 child articles (usually the case with news items or blog posts), you can use Collections. Articles that are under a Collection resource (page) will be hidden from the tree and listed in a grid view for easy browsing. Contao does something similar. On its demo site, If you look under: News > Contao Official Demo News, there are three articles. In MODX, the Contao Official Demo News page, could be Collection resource under which, news articles would be listed.

          As far as Contao's content blocks, here's a quick conversion:

          Contao => MODX
          ==================
          headline => pagetitle
          text => content
          gallery => MIGX TV or Gallery
          subtitle => longtitle (if applicable)
          excerpt => introtext (Does not exist in Contao, but you get the point)
          Add content image => Image TV (This is basically a featured image)
          Protect element => Resource Groups
          Visibility => Publish Date / Unpublish Date
          Media Elements => For inline media elements, just insert them directly in the content area using the RTE. For Attachements (Widgets), use TVs or Extras, such Videobox
          File Element => Not sure what these are

          In MODX, any resource (page) can be an article (or anything for that matter). It's really up to you to define them as such. Contao's Element Types are mostly filled with things like: bullet lists, tables, code blocks, accordions, links, etc. In MODX, these these things are handled by RTEs, and rightly so.

          In addition to the excellent extras in MODX's repository, modmore.com offers premium extras, such as ContentBlocks, MoreGallery and Redactor. You might find them useful.
            A MODx Fanatic