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)
- 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/
, andthemes/
directory - add the quark theme with:
./bin/gpm install quark
- add the lightslider plugin with:
./bin/gpm install lightslider
- in
grav/user/plugins/
add theevents-schedule
plugin from Github:
git clone https://github.com/aoloe/grav-plugin-events-schedule events-schedule
- in
grav/user/plugins/
add theevents-ics
plugin from Github:
git clone https://github.com/aoloe/grav-plugin-events-ics events-ics
- in
grav/user/themes/
add theevents-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'sevents-ics.yaml
touser/config/plugins/
and customize theroute
tobc-oberurdorf.ics
.
- 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'sdata
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).
- we probably have to define
templates/modular/events-schedule-next.html.twig
- enable
onTwigTemplatePaths
inonPluginsInitialized
- 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
inconfig/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)
.
-
- get the mobile navigation on top of the slider:
- add a link for maps:
geo:0,0?q=my+street+address
where 0s are lat and long (https://en.wikipedia.org/wiki/Geo_URI_scheme) - write the text for the Schnuppertrainng
- write the footer.
- create the ical