Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

How would I add external content to a page?

Started by Muut Archive 10 years ago · 4 replies · 869 views
10 years ago

I notice there are two embed/inject content style plugins but neither does what I want. I'd like to display the output from a script on the site on the home page. The script is not PHP and I do not want to use an iframe. Is there a way to do this?

I'm getting hit hard by the learning curves here, but making good progress! Thanks for any ideas.

10 years ago

Or maybe there's a way to use something like json and mustache? I'm totally unfamiliar with twig (for now), but maybe twig could take json and output it via a template?

10 years ago

Twig itself cannot, but a simple plugin could use a PHP-library or function to read the external data (for example in JSON-format), store it in the Data-folder, and output it it in a twig-template. You basically just need a plugin to read and save the data so it is available to you for manipulation.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2588 9 years ago
Archive · by Muut Archive, 9 years ago
2 1703 9 years ago
Archive · by Muut Archive, 9 years ago
2 4996 9 years ago
Archive · by Muut Archive, 9 years ago
1 3826 9 years ago
Archive · by Muut Archive, 9 years ago
3 1810 9 years ago