VaeQL http://forum.vaeplatform.com/categories/vaeql/feed.rss Thu, 01 Nov 12 04:31:22 -0400 VaeQL en-CA Passing ID to PHP function in VaeQL http://forum.vaeplatform.com/discussion/309/passing-id-to-php-function-in-vaeql Thu, 09 Aug 2012 23:47:36 -0400 adam_crvn 309@/discussions

<v:collection path="exhibitions[hasValidEvents(<v->, $event_day) > 0]">


hasValidEvents is a PHP function in __vae.php, and it returns a 0 or a 1 for every entry. I can manually call it inline with no issues as such:


<v=hasValidEvents('1240912', $event_day)>


This will return a 1 or 0 properly, but trying to use or any other way I know to access the ID does not have the desired result.
]]>
VaeQL http://forum.vaeplatform.com/discussion/41/vaeql Tue, 02 Nov 2010 13:03:58 -0400 michael 41@/discussions
Could you guys please update the documentation so that more developers start using VaeQL??]]>
Sorting a collection by dates within range of records http://forum.vaeplatform.com/discussion/289/sorting-a-collection-by-dates-within-range-of-records Thu, 19 Apr 2012 12:25:53 -0400 seb 289@/discussions
First question on forum:

I am trying to list a number of records, sorted and grouped by their "start_date" and within the range of their dates.

Essentially I am looking for something like a combination of <v:date_selection> and <v:collection>. Maybe I am overlooking some incredibly obvious way to do this, but could someone give me a pointer?

A <v:date_collection> perhaps. This would be very helpful in rendering calendars and events lists.

I am looking for HTML close to the below. In the meantime, do I need to loop through each day with PHP and use the <v:collection> to pull the records for that date?


<dl>
<dt>Thursday 19 April</dt>
<dd>event 1</dd>
<dd>event 2</dd>
<dd>event 3</dd>

<dt>Friday 20 April</dt>
<dd>event 4</dd>
<dd>event 5</dd>
</dl>
]]>
predicate expression - searching for records that have an empty field http://forum.vaeplatform.com/discussion/166/predicate-expression-searching-for-records-that-have-an-empty-field Fri, 02 Dec 2011 15:47:33 -0500 michael 166@/discussions
<v:collection path="holes" paginate="10">
<v:img path="thumbnail" width="620" height="620"/>
</v:collection>


I am trying to filter out all records that have embed code data I tried this, but it did not work

<v:collection path="holes[swf=='']" paginate="10">
<v:img path="thumbnail" width="620" height="620"/>
</v:collection>


However, the opposite query does work

<v:collection path="holes[swf!='']" paginate="10">
<v:img path="thumbnail" width="620" height="620"/>
</v:collection>


So I am confused.]]>
using a Checkbox simple structure in a predicate expression http://forum.vaeplatform.com/discussion/279/using-a-checkbox-simple-structure-in-a-predicate-expression Tue, 14 Feb 2012 16:36:40 -0500 michael 279@/discussions
All I can get get results for is all not'featured' categories like so:
<v:nested_collection path="categories[featured='0']">

But is the opposite of what I want. Help!?]]>
query by a set of ID's http://forum.vaeplatform.com/discussion/164/query-by-a-set-of-ids Sat, 05 Nov 2011 22:39:29 -0400 tgillis 164@/discussions I have a real-estate database with a list of properties, and I want to send a query to return an arbitrary collection by ID. In SQL it would be something like
select * from properties where ID in (2,3,5,6,7)

]]>
Get total count of items in a parent collection and its nested collections http://forum.vaeplatform.com/discussion/112/get-total-count-of-items-in-a-parent-collection-and-its-nested-collections Wed, 27 Apr 2011 09:26:48 -0400 adam_crvn 112@/discussions

<v?=ceil(vae("store[category/name='<v=name>']")->totalMatches()) ?>
]]>
XPath - Contains function http://forum.vaeplatform.com/discussion/39/xpath-contains-function Fri, 29 Oct 2010 15:33:35 -0400 scottr 39@/discussions path = rings[contains(sku,'ME')]
rings is my collection, sku is the field in the collection I want to search and "ME" is what I'm searching for.

But Vae shoots me back an error: http://cl.ly/f152885e8ae89059f6d6

Don't know if this helps, but here is a link to the moz dev forums: https://developer.mozilla.org/en/XPath/Functions/contains about the function.]]>
Sorting a collection by the unique Year in a date structure. http://forum.vaeplatform.com/discussion/96/sorting-a-collection-by-the-unique-year-in-a-date-structure. Thu, 24 Feb 2011 12:40:07 -0500 michael 96@/discussions
<ul>
<v:collection path="exhibitions[end_date<now()]" unique="date('Y',end_date)">
<li><a href=""><v:text path="end_date" strftime="%Y" /></a></li>
</v:collection>
</ul>

]]>
escaping characters in predicate expressions http://forum.vaeplatform.com/discussion/70/escaping-characters-in-predicate-expressions Tue, 21 Dec 2010 19:08:35 -0500 michael 70@/discussions
however, when I use a char entity or when I escape it with a slash, I get zero results.


<v:collection path="products[options/size='5'10']">
</v:collection

results in an error


<v:collection path="products[options/size='5\'10']">
</v:collection


<v:collection path="products[options/size='5'10']">
</v:collection



Gives me zero results]]>
str_replace in the PATH, does it work? http://forum.vaeplatform.com/discussion/45/str_replace-in-the-path-does-it-work Thu, 04 Nov 2010 13:53:45 -0400 michael 45@/discussions
<v:text path="str_replace(' ','_',title)" />

I cannot get this to spit out a value]]>
Predicate expressions http://forum.vaeplatform.com/discussion/33/predicate-expressions Tue, 26 Oct 2010 15:38:18 -0400 scottr 33@/discussions Example: I search "10002" I would like to find all zipcodes thats start with "100".
Kevin said I should I use VaeQL so, I implemented the change and searched for the substr of the requested zip code.

This is what gets outputted
stores[postal_code='100']
so the full line of markup would read:

<v:collection path="stores[postal_code='100']">

My question is, is Vae capable of searching a string that doesnt match the full string of a dataset? Can it find all the zip codes in my collection that start with "100" when searching for 10002?

Thanks.]]>
Accessing the parent entry of a nested structure http://forum.vaeplatform.com/discussion/18/accessing-the-parent-entry-of-a-nested-structure Tue, 28 Sep 2010 17:42:48 -0400 michael 18@/discussions
I can access the 'title' text structure of the category of a ring by doing <v=category/title>

but how do I access the 'title' text structure of the parent category?


<v=../category/title>

doesn't work.


<v=category/../title>

doesn't work.


]]>