Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

How would I add external content to a page?

Started by Muut Archive 10 years ago · 4 replies · 717 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 1357 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2954 9 years ago
Archive · by Muut Archive, 9 years ago
3 1120 9 years ago