mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
Check to ensure template has modular templates before showing add modular button
This commit is contained in:
@@ -385,6 +385,17 @@ class Admin
|
||||
return $routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get All modular types
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function modularTypes()
|
||||
{
|
||||
return Pages::modularTypes();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all plugins.
|
||||
*
|
||||
|
||||
@@ -108,7 +108,9 @@
|
||||
{% if mode == 'list' %}
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<a class="button" href="#modal" data-remodal-target="modal"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</a>
|
||||
{% if admin.modularTypes is not empty %}
|
||||
<a class="button" href="#modular" data-remodal-target="modular"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD_MODULAR"|tu }}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if admin.multilang %}
|
||||
<div class="button-group">
|
||||
|
||||
Reference in New Issue
Block a user