Skip to content
A wordpress Underscore-powered theme for wordpress
Branch: dev
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
wp-theme-2018 Bump version Jun 12, 2019
wp-theme-light Création du child theme 'epfl light' (#195) Apr 23, 2019
.gitignore Design: ajout du logo "50e anniversaire" (#164) Jan 14, 2019
CHANGELOG.md fix date for 1.4.8 version Jun 12, 2019
LICENSE Move project files out of the wp-theme instance Apr 24, 2019
README.md Improve doc Apr 24, 2019

README.md

Epfl theme (Wordpress)

Requirements

  • production build of elements located in /assets
  • composer

Setup

  1. Copy (or symlink) the theme in the /wp-content/themes directory of your project
  2. Nothing more, you're ready to go! 🚀

Recovering the last version of the styleguide

  • head towards https://github.com/epfl-idevelop/elements/tree/dist/frontend
  • use git clone / download zip to recover the files of this branch
  • put all these recovered files into wp-theme-2018/assets
    • delete the branch: git branch -D dist/frontend
    • git fetch and git checkout dist/frontend
  • commit the builds
  • here you go, you just updated the styleguide version contained in this theme !

Create a new release

Requirements:

process

  • make sure your local branches master and dev are up-to-date
  • start a release: git flow release start x.x.x
  • update the following files:
    • wp-theme-2018/VERSION with the version number
    • wp-theme-2018/style.css with the version number
    • CHANGELOG.md with a description of all the changes since last release
  • commit them in a "Bump version" commit
  • finish the release: git flow release finish x.x.x -p -m "x.x.x"
  • head over this repo on github, on the release tab (or go directly using https://github.com/epfl-idevelop/wp-theme-2018/releases/edit/x.x.x)
  • go to Draft a new release
  • choose the release number you just created, insert the changelog informations into the release description
  • Publish the release
  • congratulation, the repo has been released ! 🎉

Shortcodes

Each shortcode has its own subfoler in the shortcodes/ directory, placed at the root of the template.

The index.php automatically loads all files named controller.php in all subfolders.

├── shortcodes/
|   ├── index.php
|   ├── placeholder.php
|   ├── [shortcode-slug]/
|       ├── controller.php
|       └── view.php
└── ├── ...
file role
controller.php - recover the plugin datas using (actions)[]
- Pass data to the view
- Render view
- use (Shortcake)[https://github.com/wp-shortcake/shortcake] API to declare backend UI
view.php Output shortcode's html using given datas
shortcake.php Defines shortcake admin interface
placeholder.php a custom component to display in admin editor

Types

EPFL shortcode

These shortcodes are used to display data coming from EPFL Apis. the EPFL provides a plugin responsible for fetching the data, formatting it and declaring a correct backend UI via (Shortcake)[https://github.com/wp-shortcake/shortcake].

To share data between the plugin and the theme, the plugins use wordpress (actions)[].

The role of the theme is only to output correct markup for each given shortcode, using the given data, retrieved with the corresponding action.

Add a shortcode

  1. Create a new folder in shortcodes/
  2. create controller.php
  3. create view.php
  4. implement your logic in the controller, your rendering in the view
  5. enjoy!
You can’t perform that action at this time.