i use the feature of the json api in combination with select fields in blueprints. I wonder how i can define URLs for my test system and for the live system. I don´t want to change it all the time when i update my blueprint:
label: Linked Page
Now on the live system i have the domain
http://my-live-system.de. How can i implement my test system domain and my live system domain in the blueprint?
Is there a way to do that like the config.php:
# test system
# live system
Or other solutions?
Couldn’t you just use relative URLs instead? Something like
/api/query:pages in your case …
if you need an absolute URL you may try
echo $site->url() . "api/query:pages";
@tobiasweh You cannot echo anything in your blueprint, it’s just a yaml file.
And I don’t think you can use a relative url, either, i guess it will not validate.
One option/idea may be to write your own custom field, extending the default select field.
In your custom field code, you could check for a config value, then load the appropriate domain based on that. Or check the server name. (I’d probably use a config value, though.)
Ah … I thougt the URL from the field should be used in a template. didn’t get that it is a query for the select field