So, I have a unique situation and I'm wondering if someone might have a solution for this. I've been searching around the forums but haven't stumbled upon what might be causing the issue.
I'm working on a dealership website for a client and I'm using couch as the CMS. I love how easy it is to take static designs and make them dynamic with just a few tags thrown here and there.
The problem I'm running into is that, as a dealership, the client needs to display car information which is taken from a 3rd party database not managed by myself or the dealer.
Now, I've already written a php addon which will call up the database, get the needed info, and return it as a valid JSON object. I then set it to a page variable using the following:
<cms:brand> is the tag that accesses the database and returns the JSON object, and <cms:show brand_id/> is just an editable field that we hold the brand ID (a number) in. Then around the page I call those bits of JSON with:
or anything else I have stored using the dot notation.
Everything works just fine for Super Admins and Admins, but for anyone not logged in as an Admin, nothing is shown. On other pages I've pulled single items and returned html strings using this exact same method and it works for everyone, admins and users alike. It's only these couple, more complicated pages where I could use an array that it suddenly falls apart.
I really hate to have to call the database for each piece of info separately. It's much nicer to just call it once, get the 18+ strings, throw them into a JSON object and then call them where they are needed in the nested page with the dot syntax.
Any suggestions?
I'm working on a dealership website for a client and I'm using couch as the CMS. I love how easy it is to take static designs and make them dynamic with just a few tags thrown here and there.

Now, I've already written a php addon which will call up the database, get the needed info, and return it as a valid JSON object. I then set it to a page variable using the following:
- Code: Select all
<cms:set brand="<cms:brand id="<cms:show brand_id/>"/>" is_json='1'/>
<cms:brand> is the tag that accesses the database and returns the JSON object, and <cms:show brand_id/> is just an editable field that we hold the brand ID (a number) in. Then around the page I call those bits of JSON with:
- Code: Select all
<cms:show brand.brand_name/>
<cms:show brand.logo/>
<cms:show brand.trim/>
or anything else I have stored using the dot notation.
Everything works just fine for Super Admins and Admins, but for anyone not logged in as an Admin, nothing is shown. On other pages I've pulled single items and returned html strings using this exact same method and it works for everyone, admins and users alike. It's only these couple, more complicated pages where I could use an array that it suddenly falls apart.
I really hate to have to call the database for each piece of info separately. It's much nicer to just call it once, get the 18+ strings, throw them into a JSON object and then call them where they are needed in the nested page with the dot syntax.
Any suggestions?
