We've developed quite an extensive theming engine at StageBloc. That being said, sometimes creating themes within the browser can be a pain. We've created this codebase to allow for much easier local theme development via our API. By submitting a theme to our API, we'll render it into HTML
and send it back.
This codebase makes use of our StageBloc PHP API Wrapper.
-
In order to use this for local theme development, you'll need a localhost set up capable of running PHP.
-
You'll also need to sign up for StageBloc and be an admin for at least one account.
-
Once you've cloned the repo, run the following commands from the project's root directory to get the resources for the StageBloc PHP API Wrapper and Bender:
git submodule init git submodule update
-
Rename
config-sample.php
toconfig.php
and runchmod 777 config.php
so that we can populate it with your access token upon authentication and other data. -
That's it! You can edit themes in your IDE / text editor of choice. Simply load the
index
page of this project in your browser to see your themes as you would with any localhost.
-
Adding themes: Themes are stored in the
/themes/
directory. Simply add a folder there with anHTML
,CSS
, andJS
file to populate your new theme in the dropdown selector. The.sbt
extension is used forHTML
files, meaning "StageBloc Theme". The theme path can be change in theconfig.php
file using the$themePath
variable. -
Theme Views: If you don't like having your entire site contained within a single
theme.sbt
file, you can create your own theme view structure usingtheme.sbt
as the "manifest" (a list of .sbt files). Set the$themeViewsPath
config variable to a path relative to your theme, and save your<theme_view_name>.sbt
files within that path. The maintheme.sbt
file will now become your manifest, within which you can include individual views in the following manner:{Include file="[ optional/path/to/ ] <theme_view_name>.sbt"}
Found a bug or missing a feature? Don't hesitate to create a new issue here on GitHub.