We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41349
    • 10 Posts
    Hi
    I installed blox snippet and trу to get data from my custom table "my_rssfeeds"
    [[!bloX? &packagename=`rssfeeds`&classname=`Rssfeeds` &sortConfig=`[{"sortby":"createdon","sortdir":"DESC"}]` &where=`{"published":"1"}`]]

    But it out data from table "modx_rssfeeds". How i can set custom prefix "my_" for blox call?
      • 4172
      • 5,888 Posts
      A new version of bloX is coming soon. (This week)
      Then it will be possible to have custom-prefixes with the default-getdatas.php
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 41349
        • 10 Posts
        Quote from: Bruno17 at Nov 18, 2012, 05:15 PM
        A new version of bloX is coming soon. (This week)
        Then it will be possible to have custom-prefixes with the default-getdatas.php
        Thanks, Bruno.
        And just one question: how to disable pagination? I set limit=5 and blox out 5 per page, not first 5 records.
        • Quote from: Bruno17 at Nov 18, 2012, 05:15 PM
          A new version of bloX is coming soon. (This week)
          Then it will be possible to have custom-prefixes with the default-getdatas.php

          Sounds terrific. Waiting patiently for it.
          • Quote from: Bruno17 at Nov 18, 2012, 05:15 PM
            A new version of bloX is coming soon. (This week)
            Then it will be possible to have custom-prefixes with the default-getdatas.php

            Have you made this addition already?
            I was thinking in modifying it to make it work with my custom package but i can't find addPackage in your /core/components/blox/blox.php
            and then be able to do something like:

            $xpdo->addPackage('mypackage','/path/to/mypackage/model/','mp_');
              • 4172
              • 5,888 Posts
              should work with the latest one:
              https://github.com/Bruno17/bloX/tree/master/packages

              the stuff is done here by default:
              https://github.com/Bruno17/bloX/blob/master/core/components/blox/projects/blox/modTable/table/includes/getdatas.class.php

              you will need &prefix=`` and &use_custom_prefix=`1`
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
              • Thanks a lot Bruno!
                • Hi Bruno;
                  The following call and projects folder files are working good with my custom package.
                  I have made various tests using another custom classes and queries and works like a charm.
                  Thanks a lot for another very useful Extra.
                  Think we have almost all bases covered with MIGx/MIGXdb/bloX

                  What if i want a JSON output of this listings instead of templates?
                  I see myself using it a lot for getting consumable data in native apps and ajax front-end calls.
                  Maybe is a good option/feature-request to be included in bloX from start?

                  Of course i can make a task and templates like: outerTpl = '[]' outputSeparator ',' and rows like '{"[[+fieldname]]":"[[+fieldvalue]]"}' but will be more usable and portable if we can add a config setting there and templates then will be ignored and just output raw JSON data.

                  What do you think?

                  [[!bloX? 
                    &debug=`1` 
                    &use_custom_prefix=`1` 
                    &packagename=`cms` 
                    &project=`cms` 
                    &component=`cms` 
                    &prefix=`uepa_cms_` 
                    &packagename=`cms` 
                    &classname=`Content` 
                    &titlefield=`content_name` 
                    &task=`json`
                    &sortConfig=`[{"sortby":"id","sortdir":"DESC"}]` 
                    &where=`{"published":"1","content_category_id":"21"}` 
                  ]]
                  


                  [ed. note: lithiumlab last edited this post 11 years ago.]
                    • 4172
                    • 5,888 Posts
                    you can do

                    $bloxdatas['bloxoutput'] = $modx->toJson($rows);
                    return $bloxdatas;


                    and the Templates will be ingnored.

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

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                    • Thanks a lot!
                      Will check it out.