We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
Subscribe: RSS
  • You are welcome!

    And try pdoTools - it is really awesome.
    • I notice the latest pdoTools has some new snippets included. pdoField. That make three now, getResourceField, the fastField plugin and pdoField. I wonder which is more efficient? I'm very fond of the fastField plugin, the idea of adding a new tag [[#id.field]] is interesting.
        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
      • For sure when I get better with coding, looks amazing!
        • pdoField is the replacement for getResourceField and UltimateParent.
          [[!pdoField?
              &id=`[[*id]]`
              &topLevel=`2`
              &field=`longtitle`
              &default=`pagetitle`
          ]]
          


          It will find parent of [[*id]] on level 2 from root of context of the resource and return field [[*longtitle]]. If it empty - will be returned [[*pagetitle]].

          Also this works with TVs:
          [[!pdoField?
              &topLevel=`2`
              &field=`myTV2`
              &default=`myTV1`
              &processTVs=`1`
              &prepareTVs=`1`
          ]]
          


          Parameter &top works not so in UltimateParent. It will get parent on specified level from resource. BTW pdoField works with respect to contexts.



          pdoTools documentation on russian - http://bezumkin.ru/modx/pdotools/
          For now I did`t describe general pdoTools features and pdoResources snippet.
          • Ah, yes.. I just realized it's a "higher" level tools suitable for a casual user.
            That makes it even more attractive, will definitely find good use for it.
            I feel lucky thanks! Can't wait to get back to this thread to report.
            • Quote from: panahapi at Oct 01, 2013, 05:05 AM
              Ah, yes.. I just realized it's a "higher" level tools suitable for a casual user.

              Yep. There is 6 snippets for now:

              pdoResources - fast replacement for getResources
              pdoSitemap - fast replacement for GoogleSiteMap
              pdoCrumbs - fast replacement for Breadcrumb
              pdoField - replacement for getResourceField and UltimateParent
              pdoUsers - list users of your site by groups and\or roles
              pdoNeighbors - show links to neighbors documents (next, prev and up)

              Also you can simple get resources in your snippets like that:
              $pdo = $modx->getService('pdoFetch');
              if ($resource = $pdo->getObject('modResource', 15)) {
                  print_r($resource);
              }


              Or you can retrieve and template a number of resources:
              $pdo = $modx->getService('pdoFetch');
              $resources = $pdo->getCollection('modResource', array('id' > 0, 'published' => 1), array('limit' => 10, 'includeTVs' => 'myTV1')));
              if (empty($tpl)) {$tpl = '@INLINE <p>[[+idx]]. [[+pagetitle]]</p>';}
              
              $output = '';
              foreach ($resources as $row) {
                  $output .= $pdo->getChunk($tpl, $row)
              }
              return $output;
              
              [ed. note: bezumkin2 last edited this post 8 years, 3 months ago.]
              • One question, Vasiliy..

                Is Bootstrap a requirement and is the javascripts plays well with other framework, say, Foundation?

                Edited: Never mind, I think I figured it out it is indeed made w/ Bootstrap in mind [ed. note: panahapi last edited this post 8 years, 3 months ago.]
                • No, it is not requirement. You can modify any chunks as you need.

                  Javascript requires only jQuery.
                  • Quote from: bezumkin2 at Oct 01, 2013, 03:09 PM
                    No, it is not requirement. You can modify any chunks as you need.

                    Javascript requires only jQuery.

                    Yes, I could see that.
                    I don't know perhaps if modifying the chunks is not so practical then switching to Bootstrap is no big deal. Thanks for the answer!
                    • I upgraded pdoTools but it only upgraded to 6.0 from the MODx provider.

                      You mention that you've enabled the Provider without keys for the free packages
                      http://forums.modx.com/thread/86923/minishop2-not-available-on-extras#dis-post-479038

                      How is this done?

                        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