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

Grav Page Inject Plugin and Custom Page Template

Started by Muut Archive 10 years ago · 6 replies · 890 views
10 years ago

I am injecting a page using the page inject plugin.


plugin:page-inject

TXT

My challenge is that title is being displayed twice.  See the output

My control template:

{% block controls %}
<div class="controls">
<h2>{{ page.title }}</h2>
{{ page.content }}
</div>
{% endblock %}

TXT


 [Screen Shot 2016-10-06 at 11](//muut.com/u/getgrav/s2/:getgrav:Ji7Y:screenshot20161006at11.18.29am.png.jpg)
10 years ago

Are you sure you not outputting the title in the content? or the page that has the page inject is not already including the same title?

10 years ago

Yes, i did validate that. This is happening for anything that I pull from the header. I was able to test this using a custom header variable:

TXT
variable1: inject me

Content:
Screen Shot 2016-10-10 at 2

Controls Template:

TWIG
<div class="control">
    <h2>{{header.variable1}}</h2>
    {% block control %},{{page.content}},{% endblock %}
</div>

Output:
Screen Shot 2016-10-10 at 2

10 years ago

Should be sorted in v1.2.0 of page-inject plugin.

10 years ago

Sweet! I've updated my Page Inject plugin and the problem has been solved! Thanks again for your assistance and help!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1359 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 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago