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 update1a. We've noticed issues may occur sometimes on Windows (or with WAMP) where the cURL requests made by the PHP API wrapper have SSL authentication issues. In that case you can add the following lines to
StageBloc.phpin the_request()method:$options[CURLOPT_SSL_VERIFYPEER] = false; $options[CURLOPT_SSL_VERIFYHOST] = false; -
Rename
config-sample.phptoconfig.phpand runchmod 777 config.phpso 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
indexpage 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, andJSfile to populate your new theme in the dropdown selector. The.sbtextension is used forHTMLfiles, meaning "StageBloc Theme". The theme path can be change in theconfig.phpfile using the$themePathvariable. -
Theme Views: If you don't like having your entire site contained within a single
theme.sbtfile, you can create your own theme view structure usingtheme.sbtas the "manifest" (a list of .sbt files). Set the$themeViewsPathconfig variable to a path relative to your theme, and save your<theme_view_name>.sbtfiles within that path. The maintheme.sbtfile 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.