two part question:
i have a custom table and that keeps bid information. i’d like to have a tv of [*bidCount*] on my auction items (these are seperate documents in the doc tree) that binds to a sql query getting count of bids for each item.
1. first question: i’ve created a tv of "bidCount" for a template called "auction item" with a default value of:
"@SELECT COUNT( id ) AS cnt FROM `bids` WHERE doc_id ={{id}} GROUP BY doc_id //{{id}} should evaluate to the current document id
i realize that the query is stored in the database so wondering if there is a placeholder for [*id*] that will evaluate to the current docs id as each "auction items" page is viewed.
2. when i tested it for a specific id i show on my page "array". i’m needing it evaluate to the actual count of bids as a number b/c i’d like to use this as a sort field in later ditto calls. is this possible?
thanks in advance for any suggestions. this forum is always very helpful