I am pretty new in Wordpress and I am a little overwhelmed with the amount of elements and possibilities we have to build our site. So I would like some advices.
The first think I want to do is a dynamic page with a Gallery of photos.
In a nutshell: I have an API: it receives a code in the URL and gives back the array of paths for some URL photos (actually is a complex JSON response with also these elements).
My question is, can I make a page in WordPress that:
- Have a field for inserting the code;
- Once the code inserted, it would read the response of the API
- Parse the response to get the path of the photos
- Display in the screen the photos in these URL's
Which elements should I start to search?: javascript, php, some plugins REST, API?
UPDATE
- The data would not be saved, everytime the page is loaded again.
- Thepage will be accessible by anyone in the front-end.
- The API is accessible by a simple URL with a ?code='XXXX' field in the URL.
- The form and the display can be in the same page.
Rigth now I've been using Php in a Symfony2 framework to do the job, but as I need to put in Wordpress I migth need to make other strategies:
public function galerieAction($code){
$url = 'http://myapi/photos/'.$code.
$json = file_get_contents($url);
$pellicule = json_decode($json);
$url = 'https://server.com/server/of/photos';
foreach ($response->photos as $photo){
$link = $url.$photo->path;
echo "<img src='".$link."' />";
}
}
}