You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ You should now have all the plugin files under
28
28
enabled: true
29
29
active: true
30
30
processed_content: true
31
+
remote_injections:
31
32
```
32
33
33
34
If you need to change any value, then the best process is to copy the [page-inject.yaml](page-inject.yaml) file into your `users/config/plugins/` folder (create it if it doesn't exist), and then modify there. This will override the default settings.
@@ -70,4 +71,24 @@ There are two ways to use this plugin in your markdown content:
70
71
71
72
Sometimes you just want the content of another page injected directly into your current page. Use `content-inject` for this purpose. The content is not rendered with the associated twig template, merely injected into the current page.
72
73
74
+
## Remote Injects
75
+
76
+
It is now possible to retrieve remote content from another Grav instance as long as both of the sites are running the latest version of the `page-inject` plugin. First in the **client** Grav instance you need to define a remote connection to another Grav **server** in the plugin configuration. For example:
77
+
78
+
```yaml
79
+
remote_injections:
80
+
dev: https://dev.somehost.com/
81
+
foo: https://foo.com/bar
82
+
```
83
+
84
+
This will then allow you to inject page content from one Grav instance to another using this syntax:
Where the `remote://dev` protocol tells the plugin to retrieve the requested page from the `dev` injection configuration via the path `/home/modular/_callout`.
91
+
92
+
This is particularly useful for modular content that is already a snippet of content that is being reused on the **server**. This will retrieve the content, and because a modular page's content is pre-rendered with the appropriate Twig template, it will include all the HTML of the modular page. If you request a regular page (non-modular), there will be no Twig and just plain HTML content will be sent.
0 commit comments