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

How to add a button to the titlebar of an admin page?

Started by Muut Archive 10 years ago · 4 replies · 541 views
10 years ago

Hello Grav Community,

can somebody please briefly list the steps that are required to add some buttons to an admin page?
I've added a new page and menu to the admin plugin (similar as it's done in the comments plugin), but placing the following in the templates .html.yaml file (which has been copied from the comments plugin) doesn't display anything, so I guess something is missing:

TWIG
{% block titlebar %}
    <div class="button-bar">
        <a class="button" href="{{ base_url_relative }}/myplugin"><i class="fa fa-arrow-left"></i> {{ "MYPLUGIN.BTN_NEW"|tu }}</a>
        <button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "MYPLUGIN.BTN_SAVE"|tu }}</button>
    </div>
    <h1><i class="fa fa-fw fa-plug"></i> {{ "MYPLUGIN.TITLE"|tu }}: {{ plugin.name|e }}</h1>
{% endblock %}

Any advise is welcome,
Thank you.

10 years ago

Yes, that's where it was placed, but nothing showed up. All out of a sudden it worked - unfortunately I have no clue what went wrong. Anyway, thank you for your support.

10 years ago

Maybe you forgot to clear the cache after creating or modyfing your script. I recommend to completely turn off all cache functions during development.

10 years ago

Yes, it's most likely related to it. Well, I did clear the cache various times, but finally gave up on it. The next day, after installing the update to 1.0.9 (whole system was rebooted in between) the buttons showed up.

Suggested topics

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