This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Overview

Kirby Components

Overview

Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints folders?

This Plugin will change your life!

screenshot

Watch the video tutorial or check the example project

Installation

Manually

Download and copy the plugin into your plugin folder: /site/plugins/

With Composer

composer require microman/kirby-components

First step

  1. Create a components folderfolder site/components
  2. Make a subfolder for your component, e.g. components/my_component
  3. Create at least one blueprint with the same name as the folder. e.g. my_component/my_component.yml
  4. Create at least one snippet. e.g. my_component//my_component.php

You can create more snippets and blueprints in your components folder. (called sub components) To access them later, declaring the location my_component/my_subcomponent

You can set label, title and icons in your blueprint. Even tabs and columns, if you like.

Using in your template

To output your component, use the component helper:

component('my_component');

Pass values to this component:

component('my_component', $page, ['title' => 'This is a different title.']);

The first and the second parameter could be an array or an Kirby object, that contains a content object. Try it out what is working for you.

Using in your panel

The component field

my_field:
  type: component
  fieldsets: my_component

You can also use Kirby blocks in here: fieldsets: blocks/heading

$page->my_field()->toComponent();

Extend your component like in the example above:

$page->my_field()->toComponent(['new_value' => 'My new value']);

The variables in the components snippet are accessible with $content

$content->field_in_component();

The component selector

If you add more than one component to the fieldsets, a selector appears:

my_field:
  type: component
  fieldsets:
    - my_component
    - my_component/my_subcomponent
    - my_other_component

plain selector

By choosing, the fields of the selected component will appear.

To change the labels in the selector, set the property 'title' of the component.

Component selector with images

Adding images to your component folder (with the same name as the component itself)

files selector

These images will shown in the selector and you can be styled with the selector property:

my_field:
  type: component
  selector:
    columns: 3
    background: var(--color-yellow-200) 
    ratio: 3/1
    fit: contain
    gap: 1em
  fieldsets:
    - my_component
    - my_component/my_subcomponent
    - my_other_component

images selector

Images toggles field

You can use the component selector also standalone:

images_toggles:
  type: imagetoggles
  root: location/of/the/images
  ratio: 2/1
  fit: cover
  gap: 1.2em
  options:
    - text: Text1
     value: value1
     image: image1.png
    - text: Text2
     value: value2
     image: image2.png
    - text: Text3
     value: value3
     image: image3.png

It follows the same rules as the togglesfield.

Output the component field

Use the toComponent()method.

$page->my_field()->toComponent();

Or you can extend the values (with an array or an Kirby object):

$page->my_field()->toComponent(['my_component_field' => 'My existing or new value']);
$page->my_field()->toComponent($page->any_section());

The toComponent() method delivers the selected component.

If you like to use all the available components of the component fields use toComponents():

<?php foreach ($page->my_field()->toComponents() as $component): ?>
  <?= $component ?>
<?php endforeach ?>

The components field

Add more than one component by using the components field. It follows the same rules as the Kirby blocks field.

multiple_components:
  type: components
  fieldset:
    - my_component
    - my_component/my_subcomponent
    - my_other_component
    - blocks/heading
    - blocks/text
    - blocks/list

components

Tab injection

Add a tabs with components to the component(s) fields.

multiple_components:
  type: components
  tabs:
    my_component/my_subcomponent:
      position: after
      label: Injected tab
  fieldset:
    - my_component

injected_tab

you can also extend your component there:

multiple_components:
  type: components
  tabs:
    my_component/my_subcomponent:
      position: after
      label: Injected tab
      fields:
        existing_field:
          label: Another Label
        new_field:
          type: text
  fieldset:
    - my_component

License

This is a free trial version of Kirby Components Plugin, which grants you the right to use the plugin for testing purposes. If you wish to use this plugin on one website or if you intend to use it for commercial purposes, you must purchase a license.

A license is required for those who wish to use the plugin to generate revenue, including but not limited to: e-commerce websites, affiliate marketing websites, and websites that require payment to access content. Licenses are non-transferable and cannot be shared with other users or websites.

By downloading and using this plugin, you agree to the terms and conditions of the License Agreement. Failure to comply with the terms of the License Agreement may result in revocation of your license and legal action.

To purchase a license or learn more about our licensing options, please visit our website or contact us at Contact Email. Thank you for your interest in Kirby Components Plugin!

You might also like...
A simple plugin to display a block name that player break or place in popup!

🧱 • Block Popup Version Status Date 1.0.0 stable-alpha 12/10/2022 📫 • General: Plugin Introduction: This is a simple plugin to add the function to d

A PocketMine-MP Unregister-Command completely different from the others on Poggit.

This Unregister-Cmd plugin is completely different from the ones you see on Poggit while that much easier and constantly in active development. Featur

A useful PocketMine-MP plugin that allows you to create crates in-game!

ComplexCrates A useful PocketMine-MP plugin that allows you to create crates in-game! Commands Main command: /crate Sub commands: create

A library of powerful code snippets to help you get the job done with Gravity Forms and Gravity Perks.

Gravity Wiz Snippet Library Gravity Wiz is creating the most comprehensive library of snippets for Gravity Forms ever. We'll be consistently moving ou

MagentoSnippets - Magento Front End Snippets, plugin for Sublime Text

MagentoSnippets Magento Front End Snippets, plugin for Sublime Text. This tool serves to aid the productivity during the Magento's theme development t

StickWithIt is an online food ordering website created using PHP. You can view and purchase various items as well as remove items from the cart.

StickWithIt (App Name) StickWithIt is an online food ordering website created using PHP. The database used here is MYSQL database. The tool used here

A PHP library that can be used manually as well as a CLI script that you can just run on your file

Run phpcs on files and only report new warnings/errors compared to the previous version. This is both a PHP library that can be used manually as well

Nextcloud AIO stands for Nextcloud All In One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Nextcloud All In One Beta This is beta software and not production ready. But feel free to use it at your own risk! We expect there to be rough edges

Releases(v1.0.1)
Owner
Roman Gsponer
Webdeveloper
Roman Gsponer
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Collection of useful PHP functions, mini-classes, and snippets for every day.

JBZoo / Utils Collection of PHP functions, mini classes and snippets for everyday developer's routine life. Install composer require jbzoo/utils Usage

JBZoo Toolbox 786 Dec 30, 2022
Make Laravel and Storyblok work together beautifully.

Use Storyblok’s amazing headless CMS in way that feels familiar to Laravel developers This package allows you to use fantastic Storyblok headless CMS

Richard Le Poidevin 47 Oct 27, 2022
Easily create and work with code snippets from PHP

code-snippets Easily create and work with code snippets from source code files of any type in PHP. The original code this package is based on was borr

Permafrost Software 8 Sep 4, 2022
Another initiative where patient in need of Blood and recovered patients willing to donate Blood can come together under one platform and connect with each other.

This is yet another initiative where patient in need of Blood and recovered patients willing to donate Blood can come together under one platform and connect with each other.

Rohit Tiwari 1 May 5, 2022
The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

netz98 758 Dec 28, 2022
⚡ Php snippets, random stuff, demos, functions, fast message system, agnostic and framework free - 100% compactible ;) ⚡

⚡ Php8 FPM Nginx Fast, Scripts, Pearls & Treasures ?? Want to run and test asap ? docker-compose up -d phpgit_php8;ip=$(docker-machine ip default);ech

Benjamin FONTAINE 0 Mar 20, 2022
Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files

toKirby Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files. You can easily install and test it in a few steps.

R. Banus 4 Jan 15, 2022
Shows you the current diocese that you're in, as well as the bishop.

Use config.php to create variables $dbuser and $dbpass for the database connection. Run `php -f ./coa/newcheck.php` to update database information fr

Canon Law Ninjas 2 Dec 2, 2021
A PHP Library To Make Your Work Work Easier/Faster

This Is A Php Library To Make Your Work Easier/Faster,

functionality 2 Dec 30, 2022