Grav - Admin Introduction



Grav Administration Panel plugin is a web graphical user interface (GUI) for Grav. It can easily create and modify pages. It is an optional plugin and to work effectively Grav does not depend on this totally. The Admin provides limited views for easy usage of Grav.

Features

Following are the features of administration panel −

  • Enable or disable the plugins present in the plugin manager list.

  • You can create, edit, copy and delete the pages easily.

  • List of latest page updates gets displayed on the Dashboard.

  • Latest available updates can be viewed easily by just one click.

  • Find the particular pages from the list by using search box.

  • It consists of functionality of the forget password.

  • Media files can be uploaded by drag-n-drop method.

  • Allows editing via yaml or forms in normal and expert modes.

  • Dashboard consists of site activity, latest page updates and maintenance status.

  • It consists of Ajax powered backup and clear-cache capabilities.

  • It consists of site and system configuration management.

  • New plugins and themes installation powered by GPM.

  • Automatic password encryption feature is provided during user login.

  • It provides code editor that highlights powerful syntax with instant Grav-powered preview.

  • Installed theme listing and configurations can be done by using Theme manager.

  • It also manages the logged-in users.

Installation

To access the admin plugin, we need to run the latest Grav. You can run the following command in the CLI (command line interface).

$ bin/gpm selfupgrade -f

The selfupgrade is used to update Grav to the latest version available. -f is used to refresh GPM(Grav Package Manager) index.

We need to install the admin, form, email and login plugins to make your admin plugin run properly. As all plugins have dependencies, you need to agree when it prompts you to install other plugins while installing the admin plugin; these plugins are available via GPM (Grav Package Manager). We'll study more about GPM in the chapter Grav - GPM.

Following command is used to install the admin plugin using the command prompt.

$ bin/gpm install admin

Manual Installation

We can install the administration panel manually by downloading the following plugins individually −

After downloading all the plugins, extract all the zip files and store in the <your_folder_name>/user/plugins folder. In the Plugin folder, you can store plugins with a unique name; the name should be related to the function of the plugin. The folder can be renamed as admin/, email/, form/ and login/. It is necessary to store all the four plugins in the Plugin folder together; otherwise the admin panel won't work properly.

Creating User

We can create the user account by using the command line interface. Use the following command to create a user account.

$bin/grav newuser

Otherwise, you can also create user account manually by writing the following lines of code −

email: admin@tutorials.com
access:
   admin:
      login: true
      super: true
   site:
      login: true
fullname: 'Tutorials Point'
title: tp
password: 'Password'

Save the above lines in the <your_folder_name>/user/account/admin.yaml file. The name which you have used to save your above code will be the username for your login, i.e., admin. You can edit the email, fullname, title and the password according to your requirements.

Usage

You can access the administration panel by pointing your browser to the localhost/<your_folder_name>/admin and you will get a screen as shown below. You can set the username and password in yaml file as specified in the creating user section.

Grav Introduction
Advertisements