We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19597
    • 44 Posts
    EDIT: Forgot to mention: I am running MODx REVO
    EDIT: Forgot to mention: I am running MODx REVO
    EDIT: Forgot to mention: I am running MODx REVO

    Scenario Example:
    Let’s say I have a Category in my Document Tree called "News", inside news are different documents titled:
    January 11, January 12, January 13
    so on and so forth.

    I want to place a Template Variable on my homepage that will index all Documents inside a Specific Category (in order of creation preferably?) in a list as such:

    Recent News:

    • January 11 < Link to Document
    • January 12 < Link to Document

    I desire this in hopes that whenever I make a new document in this category, it will automatically show up as the most recent news post on the index page, and be a click-able direct link to the full article.


    Is this possible? Has it already been created? I spent some time reading on Template Variables, and I already have a TV that allows me to select from multiple different images to display on my index pages, however the problem with just trying to re-use that TV is that with the addition of any new document in the category, I have to go back to the template and re-select (or add in addition) the new image to the selected images for that page. I want this to be totally automated as soon as I create the document.


    Best Case Wish List:
    If all the above is possible, it would also be great if there were some way to limit the amount of documents displayed? Say for example if I have 20 documents in News Category, only display the 10 most recent additions?



    Any and all help towards resolution greatly appreciated. Thanks!
      • 4172
      • 5,888 Posts
      Just use the snippet getResources.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 19597
        • 44 Posts
        Quote from: Bruno17 at Feb 22, 2011, 09:24 AM

        Just use the snippet getResources.

        I knew there was a simple way to do this... Geeze I wish this stuff was included in default MODx
          • 19597
          • 44 Posts
          Ok Obviously this is NOT as easy as getResources makes it seem like it is.

          I installed getResources from my MODx Control Panel, then proceeded to place this in my homepage:
          [[!getResources? &parents=`19` &limit=`5`]]

          as instructed in the documentation:
          http://rtfm.modx.com/display/ADDON/getResources


          I refresh the page that I pasted the snippet call into (id 14, which is a test environment with no other content besides the call) and it doesn’t display anything at all.

          What now?
            • 19597
            • 44 Posts
            Turns out I downloaded but didn’t actually INSTALL the snippet.. it’s now properly displaying the content the way I want it.. However they are not LINKS to the pages in question.

            Would I accomplish making them links simply by adding a <a href="[[+id]]"> </a> around the output in the template?

            Sorry, I’m still new to all of this and trying to understand all the different calls
              • 4172
              • 5,888 Posts
              you need to create a chunk with something like that in it:

              <li>
              <a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+pagetitle]]</a>
              </li>
              


              name that chunk for example: linkToResource

              and call getResources with tpl-parameter:

              <ul>
              [[!getResources? &parents=`19` &limit=`5` &tpl=`linkToResource`]]
              </ul>
              


                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 18373 ☆ A M B ☆
                • 3,141 Posts
                Welcome to MODX smiley


                The MODX CMF is intended to be as flexible and scalable as possible. If we’d include packages by default, that would mean you are (even if it’s psychological) limited to using that addon. And as there’s other solutions then using getResources (for example, using Wayfinder, or Ditto which you shouldn’t really use anymore, or writing your own snippet to do the trick) it’s not included by default.


                Here’s a brief list of addons you may be interested in to use:
                - Wayfinder: builds menus from your site tree (so updated when you modify your site),
                - Gallery: gallery (doh) addon
                - CodeMirror: use syntax highlighting when editing chunks, templates, snippets and plugins
                - TinyMCE: rich text editor for resources
                - FormIt: form processor which can be extended with hooks
                All of these are in the Package Manager smiley Most have a page on the RTFM too.
                  Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                  Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                  • 19597
                  • 44 Posts
                  Quote from: Mark at Feb 22, 2011, 03:28 PM

                  Welcome to MODX smiley


                  The MODX CMF is intended to be as flexible and scalable as possible. If we’d include packages by default, that would mean you are (even if it’s psychological) limited to using that addon. And as there’s other solutions then using getResources (for example, using Wayfinder, or Ditto which you shouldn’t really use anymore, or writing your own snippet to do the trick) it’s not included by default.


                  Here’s a brief list of addons you may be interested in to use:
                  - Wayfinder: builds menus from your site tree (so updated when you modify your site),
                  - Gallery: gallery (doh) addon
                  - CodeMirror: use syntax highlighting when editing chunks, templates, snippets and plugins
                  - TinyMCE: rich text editor for resources
                  - FormIt: form processor which can be extended with hooks
                  All of these are in the Package Manager smiley Most have a page on the RTFM too.

                  Hi Mark! Thanks for the kind welcome. Although, technically I’ve been using MODx Revo for a couple of months now.. I’m just slowly trying to take it all in. I think my main problem at this point is still trying to understand a bit about the different calls (i.e., +, *, ! etc). As well as of course not knowing which addons to get to accomplish my goals since I’ve never done/used most of them before.

                  That’s why I wanted to write back and specifically thank you for that awesome list!

                  I just have a couple of quick questions if you’d have a few more moments in your day:


                  Wayfinder: sounds like a great way to help me stop editing my menu every day or two, but will it be able to work with a CSS-based DropDown Unordered List style Menu? Or just a standard style menu sort of like the tree in Manager?
                  CodeMirror: I’m not quite sure I understand the point/concept of this. I’m going to try and find the documentation but was wondering if you may be able to explain a bit more on the side of "tech-savvy but not programming savvy" for me? Does CodeMirror essentially show you (via highlight) the open/close tags of all elements within your resource edit, sort of like Notepad++ or Firebug does?
                  TinyMCE: AMAZING, Thank you SO much for adding this to your list. Although this isn’t really a question, it was GOING to be the subject of my next post, which you’ve now averted the need for. This should make me a lot less worried about handing username/passwords out to clients to edit and add resources.


                  Gallery: I do not use yet, but sounds great. Will definitely add that to my collection.
                  FormIt: I already use this awesome little snippet actually, it was one of my first add-on installs (after SPForm, which fell short for me). I had a bit of a rocky start with it as well, because I was using ’ ’ marks instead of hash ` ` marks and did not realize until another great community member brought it to my attention. Once I had the hash marks in properly, it was flawless, like most everything else on MODx.



                  Anybody else with any of their favorite add-on suggestions for me to try? I welcome all input!
                    • 18373 ☆ A M B ☆
                    • 3,141 Posts
                    You can pass properties to the Wayfinder call to change how it’s outputting the menu. By default it uses a multi-level unordered list, so that works great smiley You can find more info on the RTFM page for Wayfinder.

                    As for ! * ~ $ + ++, check out the tag syntax page: rtfm.modx.com/display/revolution20/Tag+Syntax

                    CodeMirror pretty much shows syntax highlighting in chunks, snippets, templates and plugins similar to Notepad++.


                    Maybe you should read this Quick Start too: http://modx.com/learn/quickstart/
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                      • 19597
                      • 44 Posts
                      I have just tried to install TinyCME (Rich Text Editor), and no matter what I do, and whatever instructions/workarounds/threads I read, I just cannot get the editor to show up on ANY resource when I am editing it, or on new ones that I create.

                      It’s set to use Rich Text and Set as TinyCME Default in Settings, I’ve cleared all cache, server and local, uninstalled, reinstalled, changed the Zip, made sure the option for "Rich Text" was checked off... nothing works



                      Mark, do you have another suggestion other than Tiny? Or anything that can help me?