Skip to content

The simplytest.me demo ​

The demo is one Drupal site, the news site of a fictional public service, Open Commons, with the same content in eight design systems and in plain Frame. You launch it on simplytest.me in a few minutes, switch the theme with a button and see the same page, built with the Frame editor, drawn by CivicTheme, GOV.UK, USWDS, the Government of Canada (GCDS), ILO, WFP, UNDP and the Europa Component Library (ECL, the design system of OpenEuropa's oe_theme). Everything in it (names, news, logos, images) is made up.

What is in it ​

  • Eight design systems and plain Frame. The kits are the themes in examples/ds_<kit> (civictheme, govuk, uswds, gcds, ilo, wfp, undp, ecl). For the demo each has a subtheme, frame_demo_<kit>, in modules/frame_demo/themes. Plain Frame works too: when Frame itself is the active theme (not the base of another) it attaches the library frame/basic, a plain readable look for the header, menus, breadcrumb, footer and forms (see The base theme).
  • One set of components. The module frame_demo has the components (modules/frame_demo/components), called the contract: site header, main menu, breadcrumb, site footer, footer links, welcome, banner, card, card grid, button, alert, accordion and accordion item, tabs and tab, quote, rich text, section, two columns, slider, news explorer, logo and review. Each demo theme replaces every one of them (replaces: 'frame_demo:<name>') with its own version that has exactly the same props and slots. Pages store the id frame_demo:<name>, core renders the version of the active theme, so the page does not change when the theme does.
    • Banner has the variants default, emphasis, image (beside the text) and background (behind the text). With motion the image moves slowly: the markup gets the class fd-motion and the library frame_demo/motion is attached; visitors who ask for reduced motion get a still image. The image is a responsive picture when its image style is one.
    • Button is primary, secondary or tertiary, in small, medium and large.
    • Slider has the variants default and compact. Default is the big hero slider of the home page, compact is the strip of partner logos.
  • News. The content type News and the vocabulary News topic, with twelve articles with images.
    • The view news has two displays. /news is the news explorer, a React component put on the page by the views style React component (SDC) of Frame: an instant filter by topic, a search, a sort and numbered pages, over the JSON of the view news_api (/api/news, Views Better REST); the classes of the active design system style it. /news/archive is the same news rendered by the server with Better Exposed Filters, in the look of each theme.
    • The teaser and the full display of a News item are built with Frame (Manage display of the content type): a layout of components made in the editor, not a Twig template.
  • Paragraphs. The paragraph types demo_banner, demo_card, demo_card_grid and demo_accordion (with demo_accordion_item) print the same components, so a paragraph shows in the version of the active theme too. The module needs paragraphs_library, hence entity_usage in the launch URL. A Paragraphs Library item, a call to action, is reused on the Home and About pages.
  • Presets. Hero with a moving image (banner, background, motion), Call to action (large primary button), Quiet link (small tertiary button), Logo strip (compact slider) and Feature card (card).
  • Tokens and links. Texts use tokens: [site:name], [site:slogan], [current-date:long]. Links to pages are stored as entity:node/<id>, what the editor stores for a page picked from the list, so they survive a new alias.
  • Theme switcher. Theme Flip puts a button in the page that changes the theme for the visitor: the eight kits and plain Frame.
  • Login: admin / admin.

The module builds all of this when it is installed (Drupal\frame_demo\DemoContent) and removes it when it is uninstalled. It is for demos, not for production sites.

Launch it ​

https://simplytest.me/configure?project=frame&version=1.0.x-dev&add[0]=paragraphs&add[1]=entity_usage&add[2]=better_exposed_filters&add[3]=views_better_rest&add[4]=theme_flip

simplytest.me installs Frame and the five projects (Paragraphs, Entity Usage, Better Exposed Filters, Views Better REST, Theme Flip). It does not yet read simplytest_dependencies of frame.info.yml (the list of what to enable after the additional projects: here frame_demo). A patch for simplytest.me is in demo/simplytest/simplytest-dependencies.patch. Until it is merged, enable the module by hand once the site is up: Extend, tick Frame Demo, or drush en frame_demo -y.

The compiled files (assets/ of the base theme, modules/frame_editor/js/, the demo themes and the kits) are committed in the branch, so the checkout simplytest.me makes works without a build.

Run it on your computer ​

demo/simplytest/setup.sh does what simplytest.me does: a Drupal project from Composer, Frame from this working tree, the additional projects, drush si, the modules, the theme, and simplytest_dependencies. It needs Docker.

sh
demo/simplytest/setup.sh build      # a fresh site; prints a login link
demo/simplytest/setup.sh reinstall  # only the install steps
demo/simplytest/setup.sh start      # start the server again
demo/simplytest/setup.sh stop

The site is at http://127.0.0.1:8200 (admin / admin). See demo/simplytest/README.md.

Add a component to the contract ​

  1. Add the component to modules/frame_demo/components/<name> (<name>.component.yml, the Twig file, CSS and JS).
  2. In every demo theme add components/<name> with the same props and slots and replaces: 'frame_demo:<name>'; only the markup, the classes and libraryOverrides are the theme's own. modules/frame_demo/themes/README.md lists the rules and the data attributes the shared scripts (tabs, slider, news explorer) expect.
  3. Run npm run build in the theme and FrameDemoContractTest (modules/frame_demo/tests/src/Kernel). The test fails when a theme misses a replacement or when props, slots, enums or the page templates differ from the module's.
  4. Commit the built assets/ too (see Build).

Licences and brands ​

  • The French State design system (DSFR) is not part of the demo: its licence does not allow its use outside French public sites. examples/ds_dsfr is not committed.
  • Logos, emblems and the fonts that are tied to an organisation's brand were removed from the kits, or replaced by fonts under open licences (SIL Open Font License); each vendored package keeps its licence file and a SOURCE.txt.
  • The demo is not affiliated with or endorsed by the owners of these design systems. The Welcome component of every theme says so.