This is a sample of using Startup API themes and Bootstrap 3-based "awesome" theme in particular.
Same method applies to any theme (e.g. Bootstrap 2-based "classic" theme too), you'll just need to use different HTML.
Set Startup API them
UserConfig::$theme = 'awesome';
Set optional CSS theme
UserConfig::$bootstrapTheme = 'sandstone';
Define your Twig namespace, load data and render pages
StartupAPI::$template->getLoader()->addPath(__DIR__ . '/templates/themeapp', 'themeapp');
Load global variable and add more page-specific data
// start with global template data needed for Startup API menus and stuff
$template_info = StartupAPI::getTemplateInfo();
// add more data for your page
$template_info['random_number'] = rand(1, 100);
Render the template
StartupAPI::$template->display('@themeapp/index.html.twig', $template_info);
Extend Startup API page template
{% extends '@startupapi/page.html.twig' %}
Put your content into "content" block
{% block content %}
Your random number is {{random_number}}
{% endblock %}
Enable dev mode to switch CSS themes on the fly (see theme drop-down in the top bar)
UserConfig::$DEVMODE = TRUE;
Brute-force override Startup API theme. Just create files in that folder to override corresponding files in Startup API theme folder.
UserConfig::$theme_override = __DIR__ . '/templates/startup-api';
You'll most likely want to override page.html.twig to have global header and footer overrides across the pages.
If you override global template, and use some variables there that you need to pass, set a config variable first:
UserConfig::$app_global_template_variables = array('current_menu' => 'homepage');
And retrieve them in "APP" sub-object in Twig
{{APP.current_menu}}
This is commonly used to set current menu item in custom the nav, page title or display some other info in global nav.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
This line of text is meant to be treated as fine print.
The following snippet of text is rendered as bold text.
The following snippet of text is rendered as italicized text.
An abbreviation of the word attribute is attr.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Someone famous in Source Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Someone famous in Source Title
# | Column heading | Column heading | Column heading |
---|---|---|---|
1 | Column content | Column content | Column content |
2 | Column content | Column content | Column content |
3 | Column content | Column content | Column content |
4 | Column content | Column content | Column content |
5 | Column content | Column content | Column content |
6 | Column content | Column content | Column content |
7 | Column content | Column content | Column content |
Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit.
Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork.
Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater.
Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.