Coming from WordPress
Capell is a Laravel application you own, so most WordPress ideas map to Laravel code plus editor screens in Admin.
| WordPress | Capell | Where it lives |
|---|---|---|
| Page or post | Page | Pages in Admin |
| Post type | Page type (blueprint) | Build your first page type |
| Custom field | Editor field on a configurator, stored in meta | ServicePageConfigurator in that guide |
| Block | Widget on a layout | Widget registration |
| Shortcode | Widget or Blade component | Public Blade receives hydrated data |
Theme and functions.php | Theme views plus Laravel providers | app/Providers, resources/views/capell |
| Plugin | Composer package | Packages |
wp_query in a template | Render data contributor | Templates never query models |
Convert a sample site
Section titled “Convert a sample site”For a site with a Service post type, a price custom field and posts at addresses such as /services/logo-design/:
-
Create the page type and field by following Build your first page type. That guide seeds a Brand Sprint service page at
/services/brand-sprint. Do not import a post that has the same address, because the page you already have serves it and no redirect is made. -
To keep old addresses, install URL Manager before you import. It is a paid package, so you need the Composer repository and credential described in Paid package access before
composer requirecan find it. Require WordPress Importer in the same step, because it is paid too. Without URL Manager the import still succeeds, but it creates no redirects and old addresses return 404:Terminal window composer require capell-app/url-manager capell-app/wordpress-importerphp artisan capell:package-cache:clearphp artisan capell:extension-install capell-app/url-managerThe install step also activates WordPress Importer and Migration Assistant, which it requires.
-
Create one page per post in Admin, or import the WXR export with WordPress Importer. Run it first without
--executeto preview, then with the target IDs.--type-idmust be a blueprint of typepage: use the ID of the Service blueprint from the previous guide. On a new starter project it is10; print yours with this command:Terminal window php artisan tinker --execute='echo Capell\Core\Models\Blueprint::where("key", "service")->value("id");'php artisan wordpress-importer:import site.xmlphp artisan wordpress-importer:import site.xml --execute --site-id=1 --layout-id=1 --type-id=10 --actor-id=1Imported pages get an address from their title, so
/services/logo-design/becomes/logo-design, and URL Manager adds a 301 from the old address. -
The import does not copy custom fields. Open each imported service in Admin and enter its Price, because the public page shows an empty price until you do. The starter layout shows each page’s title and summary, so add the imported body text to the layout when you convert it.
-
Replace each shortcode with a widget or Blade component.
-
Request each old address anonymously and check it redirects to the new page:
Terminal window curl -sI http://localhost:8000/services/logo-design/