Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/docs/site/docs/blueprints/08-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ wp_insert_post(array(
]
}} />

## Run Symfony without WordPress

Blueprints can also skip the WordPress download and boot a standalone PHP app.
This example loads a bundled Symfony app with Composer dependencies already
installed, so it starts without cloning a Git repository or running a Node/Sass
build in the browser.

The app demonstrates Symfony attribute routes, autowired services, Twig, and
HttpClient. Its landing page also explains where to open the Playground file
browser and Blueprint viewer.

<BlueprintExample
title="Blueprint URL"
blueprintUrl="https://raw.githubusercontent.com/WordPress/blueprints/trunk/blueprints/symfony-package-radar/blueprint.json"
/>

## Enable an option on the Gutenberg Experiments page

Here: Switch on the "new admin views" feature.
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/site/docs/main/guides/php-frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Here is the complete embed:
"step": "unzip",
"zipFile": {
"resource": "url",
"url": "https://wordpress.github.io/blueprints/blueprints/symfony-package-radar/symfony-package-radar.zip?v=html-api-2026-06-08"
"url": "https://wordpress.github.io/blueprints/blueprints/symfony-package-radar/symfony-package-radar.zip?v=wp-php-toolkit-html-2026-06-09"
},
"extractToPath": "/app"
}
Expand Down
16 changes: 13 additions & 3 deletions packages/docs/site/src/components/Blueprints/BlueprintExample.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ import CodeBlock from '@theme/CodeBlock';

<div className="margin-vert--sm">
{!props.justButton && (
<CodeBlock title={props.title} language="json">
{props.display || JSON.stringify(props.blueprint, null, '\t')}
<CodeBlock
title={props.title}
language={props.blueprintUrl ? 'text' : 'json'}
>
{props.display ||
props.blueprintUrl ||
JSON.stringify(props.blueprint, null, '\t')}
</CodeBlock>
)}
{!props.noButton && <BlueprintRunButton blueprint={props.blueprint} />}
{!props.noButton && (
<BlueprintRunButton
blueprint={props.blueprint}
blueprintUrl={props.blueprintUrl}
/>
)}
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

export function BlueprintRunButton({ blueprint }) {
export function BlueprintRunButton({ blueprint, blueprintUrl }) {
const [isRunning, setIsRunning] = React.useState(false);
if (!blueprint) {
if (!blueprint && !blueprintUrl) {
return null;
}
if (!isRunning) {
Expand All @@ -17,9 +17,15 @@ export function BlueprintRunButton({ blueprint }) {
</button>
);
}
const url = `https://playground.wordpress.net/?mode=seamless#${btoa(
typeof blueprint === 'string' ? blueprint : JSON.stringify(blueprint)
)}`;
const url = blueprintUrl
? `https://playground.wordpress.net/?mode=seamless&blueprint-url=${encodeURIComponent(
blueprintUrl
)}`
: `https://playground.wordpress.net/?mode=seamless#${btoa(
typeof blueprint === 'string'
? blueprint
: JSON.stringify(blueprint)
)}`;
Comment on lines +24 to +28
return (
<iframe
style={{
Expand Down
Loading