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

Need help make a basic plugin that shows a html template

help-wanted plugins

Started by Dean Bateman 3 years ago · 1 replies · 419 views
3 years ago

Hi,

I am trying to create a plugin that when I go to a set route set in the admin (https://site.com/viewer) it will display an HTML template stored within the plugin.

if anyone could give me some ideas on how to code the viewer.php file or show me an example of a plugin that does something simular that would be great, I have looked through the grav docs but can't find anything that will work.

blueprint.yaml

YAML
form:
  validation: loose
  fields:
    enabled:
      type: toggle
      label: PLUGIN_ADMIN.PLUGIN_STATUS
      highlight: 1
      default: 0
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool
    route:
        type: text
        label: Page Route
        help: Enter the route for your 3d viewer page.
        default: /viewer

/user/plugins/viewer/templates/viewer.html.twig

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

{% block content %}

<h2> TEST Viewer </h2>

{% endblock %}

2 years ago

Hi ,
I can help you in develop basic plugin and customization needed.
Have good experience with TWIG file customize

Please connect further, If still hiring

Regards
Deep

Suggested topics

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