Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
35
votes
5answers
10k views

How can I retrieve channel data in json format?

I've played around with a few implementations but I still don't feel like either is right. I first came across building the JSON itself. This would be in a file at "craft/templates/entries.json". [ ...
8
votes
1answer
459 views

Console script tags garbling up non-html output (e.g. json) when in devMode

I have a plugin returning json from a controller action using $this->returnJson(...). Works great in production, but when devMode = true, the json is invalidated because Craft is still dumping the ...
2
votes
2answers
792 views

ElementAPI - Can I use javascript/ajax to load json

Probably a dumb question, but since i wasn't sure while reading on github, i'll ask here. I am wondering if I can reach the JSON I created with an URL or is it only for use in PHP? I would like to ...
4
votes
2answers
2k views

Passing multiple parameters to the Element API

How should I go about passing multiple parameters to the Element API? The scenario is that I would like to display all my categories for a given section in a form, and allow the user to select ...
7
votes
2answers
954 views

Can I change which 'Format' options are available in my Rich Text field?

I want to update my Rich Text field so only H1, H2 and H3 are the available options in the 'Format' selector. Is this possible?
6
votes
2answers
2k views

Craft CMS and JS/MVVM frameworks

Does anyone have an experience in using Craft in conjunction with a front-end JS MVC/MVVM framework such as Backbone, Ember or Angular? We have a project coming up where there may be a lot of JS ...
3
votes
3answers
322 views

BaseController::returnJson & devMode interference

While developing an API for a client site I recognized that there was a tag being returned after our JSON response (generated using BaseController's returnJson method). I copy & pasted some of ...
2
votes
1answer
416 views

Feed Me: How to format JSON for a table field?

I need to import some data into a table field. What's the best way to format the data in my original JSON feed? I've tried this: [ "first value", "second value", ] and this: [ {"col1":...
1
vote
1answer
699 views

Element API: Remove additional set of square brackets from JSON-String

We're currently having an Android-App access some of the entries of our Craft-based website. We are currently still using a self built API, and for easier creation of new API-Calls we are trying to ...
1
vote
1answer
700 views

Are there any alternatives to the deprecated Export plugin?

This thread Export Craft Data leads me to add a new question. What is a good Craft 3 export plugin? I know several for imports, for example the FeedMe plugin is doing a great job, but nothing to ...
1
vote
2answers
276 views

Querying channel entries hits memory limit

We have a channel that has about 700 entries but is paginated with a limit of 30 entries. Our client is looking to add a button so users can print out all entries. One of our proposed solutions was to ...
1
vote
1answer
1k views

Best solution for get json results from third party api?

I need to get blog posts from hubspot api using this approach. http://developers.hubspot.com/docs/methods/blogv2/get_blog_posts Since craft uses twig I'm unable to use php in the templates, so I ...