aoloe / htdocs-bc-oberurdorf-grav

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grav for bc-oberurdorf.ch

This is a metarepository for the Grav based website for the BC Oberurdorf.

For a full install you need:

  • Grav

  • the bcoberurdorf-quark theme

  • the following plugins

    • lightslider (standard plugin)
    • events-ics (my github)
    • events-schedule (my github)
  • Basic install as of impagina.org (i should take it out of there)

Setup

  • download Grav and put it in the grav directory at the root of the web server.
  • remove the grav/user/ directory
  • get https://github.com/aoloe/htdocs-bc-oberurdorf-grav as grav/user/
  • create the grav/user/config/security.yaml file and fill fill the salt value
  • create the accounts/, plugins/, and themes/ directory
  • add the quark theme with: ./bin/gpm install quark
  • add the lightslider plugin with: ./bin/gpm install lightslider
  • in grav/user/plugins/ add the events-schedule plugin from Github:
    git clone https://github.com/aoloe/grav-plugin-events-schedule events-schedule
  • in grav/user/plugins/ add the events-ics plugin from Github:
    git clone https://github.com/aoloe/grav-plugin-events-ics events-ics
  • in grav/user/themes/ add the events-ics plugin from Github:
    git clone https://github.com/aoloe/grav-plugin-events-ics events-ics

Using the events-ics and `events-schedule plugins:

  • add the events-ics plugin, copy it's events-ics.yaml to user/config/plugins/ and customize the route to bc-oberurdorf.ics.

Creating the events-schedule plugin

  • make sure that the cache is writable
  • follow https://learn.getgrav.org/plugins/plugin-tutorial for creating the plugin.
  • for now, only do onPageContentRaw when the plugin is active on the given page.
  • read the yaml file from the plugin's data directory.
  • create a modular template called events-schedule.md
    • blueprints/pages/modular/events-schedule-next.yaml
      • we probably have to define public function onGetPageBlueprints(Event $event) if we want it to work in the admin (cf. the lightslider plugin).
    • templates/modular/events-schedule-next.html.twig
    • enable onTwigTemplatePaths in onPluginsInitialized
    • add the plugin's template directory in onTwigTemplatePaths
    • for the localized dates, i need to get grav to read the right file in system/languages:
      • set default_lang: de in config/site.yaml

      • and in config/system.yaml set:

        languages:
          translations: true
          supported:
            - de
      • you can now get the month name with:

        $language = Grav::instance()['language'];
        dump($language->translate('MONTHS_OF_THE_YEAR', null, true));

        where public function translate($args, array $languages = null, $array_support = false, $html_out = false).

TODO:

About


Languages

Language:CSS 54.6%Language:PHP 34.1%Language:Twig 6.5%Language:Python 4.7%