We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47630
    • 56 Posts
    Ok, so i create the snippet 'now';

    <?php
    return time();


    Then i added the 'where' into the rowTpl chunk:

    <script>
    &where=`{"freightdate:>":"[[!now:date=`%Y-%m-%d 00:00:00`]]"}`
    </script>
    	<tr>
        <td rowspan="4"> <!-- rowspan="4" makes the table look nicer -->
            <a href="#" class="toggle">[[+id]] - More info</a> <!-- link to toggle view of the child row -->
        </td>
        <td>[[+deptown]]</td>
        <td>[[+arrtown]]</td>
        <td>[[+freightdate]]</td>
        <td>[[+cubmt]]</td>
    </tr>
    <tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Vehicle Type</div><div>[[+vehicletype]]<br></div></td></tr>
    <tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Job Details</div><div>[[+freightvehicledetail]]<br></div></td></tr>
    <tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Contact Details</div><div>[[+freightvehiclecontact]]<br></div></td></tr>


    The result was not successful, I think I do mistake, did i add the 'where' to the correct place in the correct format?
      • 4172
      • 5,888 Posts
      ???

      you need that property in your bloX - snippet - call.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 47630
        • 56 Posts
        Quote from: Bruno17 at Jul 06, 2014, 11:13 PM
        ???

        you need that property in your bloX - snippet - call.

        Hi Bruno,

        Ok, I placed the 'where' into the bloX snippet:

        //include snippet file
        include($modx->getOption('core_path') . 'components/blox/blox.php');
        &where=`{"freightdate:>":"[[!now:date=`%Y-%m-%d 00:00:00`]]"}`
        return $output;


        But then the front end page turned blank.....I'm afraid I'm missing something really simple here!
          • 4172
          • 5,888 Posts
          yeah, I think you're missing http://modx.com/learn/modx-books/modx-the-official-guide/

          this property should be placed into your bloX - snippet - call

          [[!bloX?
          &packageName=`yourPackage`
          &classname=`yourClass`
          &tpls=`......`
          &where=`{"freightdate:>":"[[!now:date=`%Y-%m-%d 00:00:00`]]"}`
          ]]
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 47630
            • 56 Posts
            Oooops yes, maybe I was having a senior moment, LOL.
            Ok, so I got the correct place for the 'where' call:

            [[!bloX? &packagename=`available-freight` &limit=`0` &classname=`AvailableFreight` &tpls=`bloxouter:outeraTpl||row:rowaTpl` &where=`{"freightdate:>":"[[!now:date=`%Y-%m-%d 00:00:00`]]"}` &debug=`0`]]


            But the thing is it still results in a blank page.....
              • 4172
              • 5,888 Posts
              does this return anything, without the where-property?

              [[!bloX? 
                &packagename=`available-freight` 
                &limit=`0` 
                &classname=`AvailableFreight` 
                &tpls=`bloxouter:outeraTpl||row:rowaTpl` 
                &debug=`0`
              ]]


              what do you get with:

              [[!bloX? 
                &packagename=`available-freight` 
                &limit=`0` 
                &classname=`AvailableFreight` 
                &tpls=`bloxouter:outeraTpl||row:rowaTpl` 
                &where=`{"freightdate:>":"[[!now:date=`%Y-%m-%d 00:00:00`]]"}` 
                &debug=`1`
              ]]


              what is your xpdo-schema?


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

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 47630
                • 56 Posts
                The first one, without the where property, the page loads perfectly......All the tables are sortable, searchable & pagination works.

                The second one (even with debug set to 1) returns a completely blank page.

                The xpdo schema is:

                <model package="available-freight" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
                <object class="AvailableFreight" table="available-freight" extends="xPDOSimpleObject">
                <field key="id" dbtype="int" precision="11" phptype="integer" null="false" default=""/>
                <field key="freightcaptitle" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                <field key="vehicletype" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                <field key="deptown" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                <field key="arrtown" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                <field key="cubmt" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                <field key="freightdate" dbtype="date" phptype="date" null="true" default="0000-00-00"/>
                <field key="freightvehicledetail" dbtype="text" phptype="string" null="false" default=""/>
                <field key="freightvehiclecontact" dbtype="text" phptype="string" null="false" default=""/>
                <field key="_fromaddress_" dbtype="varchar" precision="128" phptype="string" null="false" default="0"/>
                    <field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                    <field key="createdby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                    <field key="createdon" dbtype="datetime" phptype="datetime" null="false" />
                    <field key="editedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                    <field key="editedon" dbtype="datetime" phptype="datetime" null="false" />
                    <field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                    <field key="deletedon" dbtype="datetime" phptype="datetime" null="false" />
                    <field key="deletedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                    <field key="publishedon" dbtype="datetime" phptype="datetime" null="false" />
                    <field key="publishedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                 
                    <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
                        <column key="id" collation="A" null="false" />
                    </index>
                         
                        <aggregate alias="Resource" class="modResource" local="resource_id" foreign="id" cardinality="one" owner="foreign" />
                        <aggregate alias="Creator" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign" />
                </object>
                </model>