-
- 144 Posts
Does it work together with simplesearch?
If so, is there a small example to get me started.
Thanks and good job.. this is a very cool plugin!
-
- 144 Posts
The strange thing is that I have a table brands. I have created 4 rows with my module. (adjusted Doodles module)
I can see this table in the database with the 4 rows.
Now when I use the rowboat call like this:
[[!Rowboat?
&table=`modx_brands`
&tpl=`brandsTpl`
&limit=`10`
&sortBy=`name`
]]
I only see 2 results in the output.
This should be 4 according to the table. Removing the limit 10 resolves the issue but that doesn’t make sense.
The limit should count the rows and show at least the 4 available rows. So somehow the limit is not working.
-
- 99 Posts
I am using rowboat in another snippet to return a single value from a custom table. I’m just looking for the value and thus am not using the tpl param in my call. Using debug mode, I see that the query is working fine and getting the correct value. The documentation claims that if you omit the tpl param, rowboat should return an array. However, it’s returning a string representation of an array [ i.e., what you would see if you’d run print_r($result) ]. Is this intentional, or essentially a TBD item for the snippet? If I go in and alter rowboat to return an actual array, will that negate some other functionality of the snippet? Thanks for your input!
------
Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
-
- 4,149 Posts
Snippets in MODX Revolution can only return strings.
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com
-
- 99 Posts
OK, that answers that question
Now, conceivably might it be more useful to return a json-encoded string instead ... so it can be more easily decoded (thus not requiring so much processing of the string via explode to get it back into a real array)? This could be set via a new param (e.g., "returnJSON"). I realize this would be limited to the php 5.2+ crowd, but that could be tested for before attempting to encode. Could this be a desirable alteration to the rb snip?
------
Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.