Widget Storm Tutorial

Since 2008 — A different way through the web

v4.0 Since 2008 Open Source Widgets

What is a widget?

A widget consists of three layers — PHP, CSS and JavaScript — that together form an independent, reusable web component.

At Widget-Storm, everything is a widget. A button? Widget. A navigation bar? Widget. This whole page? Composed of widgets. Every widget has three files:

PHP
<section id="basic<?= $wgguid;?>" class="widgetstormlayer">
    <header><?= $wgparams->headercontent;?></header>
    <article><?= $wgparams->articlecontent;?></article>
    <footer><?= $wgparams->footercontent;?></footer>
</section>
PHP — the server-side structure of the widget
CSS
section#basic/*<?= $wgguid;?>*/{
    /*<?php
    if(isset($wgparams->layercss)) echo $wgparams->layercss;
    ?>*/
}
CSS — dynamic design with a PHP bridge
JS
jQuery('body').on('click', '.widgetstormlayer', function(){
    // Widget logic: AJAX loading, animations, events
    // Delegated handlers catch every instance
});
JavaScript — client-side interaction

The special part: the CSS file can contain PHP! The /*<?php ?>*/ bridge lets you generate CSS dynamically — individual styles per widget instance. The following widget demonstrates this live. Click on it:

The basic widget
Click this widget — it reveals its three layers (PHP, CSS, JS), reloads itself recursively, and demonstrates the principle of infinite composition.
Click the widget to learn more.

Three levels deep, then infinity. Every level is a complete widget — with its own PHP, CSS and JavaScript — loaded live through wgclient.php.

How does the system work?

The path from developer to user website — and back.

📝
Developer
PHP + CSS + JS
📤
wghandler
Upload & Encrypt
🗄
Server
DB + CodeVault
🌐
User-Website
Rendered Widget
🔗
wgclient
CSS | JS | PHP
Render
evaleval() führt hier den Widget-Code aus, der von authentifizierten Autoren in der Datenbank hinterlegt wurde. Kein User-Input erreicht eval() — es ist die Engine hinter der PHP-in-CSS Bridge und der dynamischen Widget-Komposition. + compose

The developer creates three files (PHP, CSS, JS) and uploads them, encrypted, to the server through the wghandler. The server stores them in the database. Users embed widgets through their wgclient — a personalized PHP file that acts as the bridge between their website and the Widget-Storm system. On the first request the widget code is stored locally in the CodeVault (wgbuilds/) — after that widgets are loaded straight from the file system, with no network round trip. That makes delivery extremely fast and independent of the central server.

As a user you embed widgets through three simple links:

Load CSS
<link rel="stylesheet" href="wgclient.php?wgname=basic&wgmode=css&wgparams=...">
Load JavaScript
<script src="wgclient.php?wgname=basic&wgmode=js&wgparams=..."></script>
Include PHP
<?php include "wgclient.php"; $wg->get("basic", "WidgetStormSystem", $params, "php"); ?>

The system loads each layer separately: CSS for the design, JS for the interaction, PHP for the structure.

As a developer you create three files and upload them:

Three-file pattern
mein_widget.php — server-side logic & HTML
mein_widget.css — design (with a PHP bridge)
mein_widget.js — client interaction

The wghandler encrypts the files (AES-256-CBC or RIJNDAEL-256) and uploads them to the server. The ##wgstart##name::author::params##wgend## markers make nesting possible: widgets load widgets.

Rendering control: you decide whether widgets are rendered locally from the CodeVault (the default — the fastest option) or fetched live from the server. In batch mode you can synchronize every widget from your local wgbuilds/ directory — and only your own widgets are processed.

For users: embedding widgets

From registration to a finished widget on your website in five steps.

1
Register
Open the Widget-Storm Station and create an account. You receive a personal key.
2
Sign in
Sign in at the Station. There you will find your dashboard area with all the tools.
3
Download the wgclient
Download your personal wgclient.php. This file is your bridge to the Widget-Storm system — it holds your encrypted key. Important: every new download generates a new key — a previously installed wgclient becomes invalid as a result. So download again only when you deliberately want to replace the client.
4
Embed
Place wgclient.php and wghandler.php on your web server — you generate both in the Station (the wghandler once, the wgclient as needed). Then embed widgets through a CSS link, a script tag and a PHP include.
5
Done!
Your website now renders Widget-Storm widgets. Updates are delivered automatically — you don't have to update anything.
HTML
<!-- Load CSS (in <head>) -->
<link rel="stylesheet"
    href="wgclient.php?wgname=basic&wgauthor=WidgetStormSystem&wgmode=css&wgparams=..."
    type="text/css">

<!-- Load JavaScript (before </body>) -->
<script src="wgclient.php?wgname=basic&wgauthor=WidgetStormSystem&wgmode=js&wgparams=..."></script>

<!-- Render PHP (in <body>) -->
<?php include "wgclient.php";
$wg->get("basic", "WidgetStormSystem", $params, "php"); ?>
Example: embedding a widget on your website
To the Station →

For developers: creating widgets

From idea to finished widget in four steps.

1
Create three files
Create mein_widget.php, mein_widget.css and mein_widget.js. Use $wgparams for parameters and $wgguid for UID scoping.
2
Configure the wghandler
The wghandler encrypts your files and uploads them to the server. New users use AES-256-CBC; existing users can seamlessly keep working with their current method (RIJNDAEL-256).
3
Upload
Start the upload process. The wghandler sends each layer to the server individually. You set the availability (open, authenticated or payment). Uploads are tied to your author account — widgets by other authors are protected from being overwritten. Alternatively, in batch mode you can synchronize every widget from your local wgbuilds/ directory at once.
4
Live!
Your widget is available instantly. Every authorized user can embed it through their wgclient. On the first request it is automatically stored in the user's CodeVault — after that it is loaded locally, with no network round trip. When something changes, simply upload again.
mein_widget.php
<?php if(isset($widgetparams->uid)) $wgguid = $widgetparams->uid; else $wgguid = ""; if(isset($wgparams)){ $text = isset($wgparams->text) ? $wgparams->text : "Hello World"; ?> <div id="mein_widget<?= $wgguid;?>" class="mein-widget"> <p><?= $text;?></p> </div> <?php } ?>
mein_widget.css — with a PHP bridge
/*<?php if(isset($wgparams->uid)) $wgguid = $wgparams->uid; else $wgguid = ""; ?>*/ div#mein_widget/*<?= $wgguid;?>*/{ background: rgba(170,210,210,0.08); border: 1px solid rgba(170,210,210,0.2); padding: 1em; border-radius: 0.4em; }

The /*<?php ?>*/ syntax is the PHP-in-CSS bridge. It allows PHP code inside CSS files, executed at render time.

mein_widget.js
/*<?php if(isset($wgparams->uid)) $wgguid = $wgparams->uid; else $wgguid = ""; ?>*/ jQuery(document).ready(function(){ jQuery("#mein_widget/*<?= $wgguid;?>*/").on("click", function(){ jQuery(this).toggleClass("active"); }); });

Widgets can load other widgets — through markers:

Nesting syntax
##wgstart##widget_name::author::params##wgend##

The server resolves these markers recursively: the CSS and JS of the nested widgets are appended, the PHP is executed inline. This is how complex compositions are built from simple building blocks.

UID scoping with ##wgself##
##wgself## is replaced with: widgetname + md5(guid)

Use ##wgself## in CSS/JS selectors
to isolate instances from one another.
PHP-in-CSS Bridge ##wgstart## Nesting UID-Scoping JSON Params

Try it out

Edit the parameters and watch the result in real time.

The live editor below demonstrates the core principle: change the text and CSS, and the widget re-renders in real time — through the same wgclient.php endpoint that external websites use too.

Edit parameters
Live preview
Loading widget…

This is the Widget-Storm principle: each layer is loaded separately. The live editor posts parameters to /wgclient.php and receives rendered HTML and CSS back. Server-side rendering is possible — but normally your wgclient stores the widget files locally on your web space, so everything is loaded straight from there. Faster, more independent.

Features & possibilities

What sets the Widget-Storm system apart.

📦
Three-layer architecture
PHP, CSS and JavaScript — every widget is a complete component with server-side logic, design and interaction.
🌐
PHP-in-CSS Bridge
CSS files can contain PHP: /*<?php ?>*/ is activated at render time. Dynamic styles per instance.
🔄
Widget nesting
Widgets load widgets through ##wgstart##...##wgend## markers. Recursive, unlimited, automatic.
Automatic updates
Widget code is loaded from the server. When the developer updates it, every user receives the new version instantly.
🔒
Encrypted transmission
All data is encrypted at the application level — either with RIJNDAEL-256 (legacy, since 2008) or AES-256-CBC (modern). Every user has a personal key.
💾
CodeVault — local speed
The CodeVault stores widget code as local files on your server. That means load times in the microsecond range instead of network round trips — and full functionality even when the Widget-Storm server is temporarily unreachable.
🎯
UID scoping
Every widget instance receives a unique ID. CSS selectors and JavaScript handlers are isolated — no collisions.
🔑
Availability levels
Developers control who may use their widget at upload time: open (all registered users), authenticated (only with explicit permission) or payment (paid). Widgets by other authors can never be overwritten.

Each of these feature cards is a wg_card widget — composed into a grid, reusable on any page.

❮?php ?❯ PHP — Serverseitige Struktur
{ css } CSS — Dynamisches Design (PHP-Bridge)
js( ) JavaScript — Interaktion

Open widgets

Every tutorial widget is publicly available. Use them on your own website.

Everything on this page? These are widgets. Every single element — buttons, cards, code displays, tabs, steps, diagrams — is a self-contained widget that you can use on your website.

wg_badge
Status labels and tags
wg_button
Universal buttons with variants
wg_card
Feature cards with glass morphism
wg_section
Section container with an anchor
wg_codeview
Code display with a copy function
wg_step
Timeline steps with animation
wg_tabpanel
Tab switching
wg_diagram
Animated architecture diagrams
wg_liveeditor
Live widget playground
HTML
<!-- CSS -->
<link rel="stylesheet"
    href="wgclient.php?wgname=wg_badge&wgauthor=WidgetStormSystem&wgmode=css&wgparams=..."
    type="text/css">

<!-- PHP -->
<?php include "wgclient.php";
$wg->get("wg_badge", "WidgetStormSystem", '{"text":"New","variant":"success"}', "php"); ?>
Example: embedding wg_badge on your website

Enterprise guidelines

Widgets can be more than UI elements — our wg_demo_todo demonstrates built-in persistence, AES-256 encryption and authentication. Completely backend-free, free of charge and open.
See all widgets → To the Station