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.

In your users_config.php file

  • Set Startup API them

    UserConfig::$theme = 'awesome';
  • Set optional CSS theme

    UserConfig::$bootstrapTheme = 'sandstone';

In your pages, e.g. index.php

  • 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);

In your Twig template, e.g. index.html.twig

  • 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 %}

More useful stuff

  • 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.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

Example body text

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.

Emphasis classes

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.

Blockquotes

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
Legend
A longer block of help text that breaks onto a new line and may extend beyond one line.

$

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.

Pagination

Alerts

Warning!

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.

Oh snap! Change a few things up and try submitting again.
Well done! You successfully read this important alert message.
Heads up! This alert needs your attention, but it's not super important.

Labels

Default Primary Success Warning Danger Info

Basic

Contextual alternatives

Striped

Animated

Stacked

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

List groups

Panels

Basic panel
Panel heading
Panel content
Panel content

Panel primary

Panel content

Panel success

Panel content

Panel warning

Panel content

Panel danger

Panel content

Panel info

Panel content

Wells

Look, I'm in a well!
Look, I'm in a small well!
Look, I'm in a large well!

Modals

Popovers

Tooltips