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

Access Grav functions outside directory

Started by Matt Shultz 9 years ago · 6 replies · 889 views
9 years ago

I have Grav installed to a subfolder of our web root (/blog). What must I include in a file outside of Grav's root in order to access Grav functions?

On our homepage, which is not within the Grav directory, we have a "Recent Blog Posts" widget. I'd like to use Grav syntax to display the 3 latest posts. I assume I can just build a function to dig into the Grav directory and grab the latest pages, but it'd be nice to use Grav's built-in functionality to accomplish this.

9 years ago

Hi there! So, you wish to use Grav functions on non-Grav website? I'm afraid this won't be possible...
But you can rather easy do it via RSS or ATOM feeds perhaps?

👍 1
9 years ago

Without writing an API in a plugin (examples already exist of this), you'd have to parse Grav-generated feeds as MakaryGo suggests or parse files. Those are the only three avenues for obtaining this data.

👍 2

Suggested topics

Topic Participants Replies Views Activity
Support · by webmasterodp, 1 week ago
4 157 6 days ago
Support · by nwhitfield, 1 week ago
2 136 1 week ago
Support · by stell, 3 weeks ago
5 369 2 weeks ago
Support · by gravinator, 1 month ago
5 559 2 weeks ago
Support · by Gravver, 3 weeks ago
6 347 3 weeks ago