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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Inject Page in Modular Pages (Custom Theme)

theme

Started by desta 4 years ago · 4 replies · 541 views
4 years ago

I'm just little confuse about inject-page plugin, when i save in content markdown file.

MARKDOWN
[content-inject path="/fasilitas-and-pelayanan/layanan-unggulan" /]

i'm save it in modular pages in _akses file.

MARKDOWN
user/pages/02.beranda/_akses (type: modular/akses)

when i'm debug it its show just like it

PHP
#raw_content: "[content-inject path="/fasilitas-and-pelayanan/layanan-unggulan" /]\n"

and not showing in beranda page. and this template twig modular i'm using,

PHP
{% extends 'partials/base.html.twig' %}

{% block content %}
    {% for module in page.collection() %}
        {{ module.content|raw}}
    {% endfor %}
{% endblock %}

i just want show content of /fasilitas-and-pelayanan/layanan-unggulan page to /beranda page, but /beranda page is modular template.

please advice some trick.

thanks

4 years ago

@topidesta, Using the 'One Page' skeleton plugin Page-Inject works as expected in both content of modular page as well as in content of module.

The post is a bit confusing to me...

  • Do you want to inject the page into the content of module '_akses', or into the content of modular '02.beranda'?

  • when i’m debug it its show just like it

    • How did you "debug"?
    • Where is #raw_content: being displayed?
  • and not showing in beranda page

    • Again, do you want to inject the page into the content of module '_akses', or into the content of modular '02.beranda'?

Please clarify...

last edited 02/19/22 by pamtbaau
4 years ago

Thanks for your response.

  • Do you want to inject the page into the content of module ‘_akses’, or into the content of modular ‘02.beranda’?

yes. but when i'm try with

TXT
[plugin:page-inject](/fasilitas-and-pelayanan/layanan-unggulan)

it's not show an content, but just a Link . it's about template/ system.yaml setting?

4 years ago

So to the question "This or that?" your answer is "Yes"? 😃

4 years ago

@topidesta, You probably already know that programming/coding is about specificity and accuracy. The same holds for asking questions and answering questions.

May I therefor suggest you take a little bit more time creating a post and also answering posts? If you want to go fast, go slow...

  • You didn't answer my questions.
  • You are mixing page-inject and content-inject in posts which are totally different beasts.
  • You are mixing Markdown style and Shortcode style.
    See the plugin's docs about requirements when using Shortcode style.
  • [plugin:page-inject](/fasilitas-and-pelayanan/layanan-unggulan)
    it’s not show an content, but just a Link

    • page-inject doesn't inject content, but injects an entire page instead
    • What does the Link look like? I cannot imagine plugin PageInject creates a <a> link/anchor.
👍 1
last edited 02/21/22 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 49 1 week ago
Plugins · by Xavier, 4 weeks ago
2 57 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1184 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 75 2 months ago