Hot answers tagged

2

Craft includes Guzzle which is very full-featured... I'd use that. Sorry I don't have time for converting your example but here's a simplified version of how to use it in a Craft plugin: $client = new \GuzzleHttp\Client([ 'base_uri' => 'https://www.example.com/api', 'http_errors' => false, 'timeout' => 10 ]); $data = ['some' => '...


2

To me it looks like the entries in the section with the handle pages have their own URLs. This means that if you visit a URL that belongs to an entry in that section Craft will automatically make that entry available in the template as the entry variable. That being said your solution is in this case: {% set currentPageId = entry.id %} {% set pages = craft....


Only top voted, non community-wiki answers of a minimum length are eligible