Epfl theme (Wordpress)
- Based on _s theme (underscores)
- Implements the elements styleguide
- Uses shortcodes to display special content served by EPFL APIs.
- production build of elements located in
- Copy (or symlink) the theme in the
/wp-content/themesdirectory of your project
- 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
- 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
- understand the gitflow logic (gitflow cheatsheet)
git flowlocally How to install gitflow
- initialise git flow in your repo by typing
git flow init
- make sure your local branches
- start a release:
git flow release start x.x.x
- update the following files:
wp-theme-2018/VERSIONwith the version number
wp-theme-2018/style.csswith the version number
CHANGELOG.mdwith 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 !
Each shortcode has its own subfoler in the
shortcodes/ directory, placed at the root of the template.
index.php automatically loads all files named
controller.php in all subfolders.
├── shortcodes/ | ├── index.php | ├── placeholder.php | ├── [shortcode-slug]/ | ├── controller.php | └── view.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
||Output shortcode's html using given datas|
||Defines shortcake admin interface|
||a custom component to display in admin editor|
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
- Create a new folder in
- implement your logic in the controller, your rendering in the view