Download the PHP package owebstudio/kirby-template-stacks without Composer

On this page you can find all versions of the php package owebstudio/kirby-template-stacks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-template-stacks

Kirby Template Stacks

[!IMPORTANT] This plugin is in maintenance mode and only gets security fixes. It supports Kirby 3.5 to 5. Kirby 6 has its own push(), endpush() and stack() helpers, so you don't need this plugin anymore. Remove it before you upgrade to Kirby 6, see Upgrading to Kirby 6.

Template stacks allows you to push to named stacks which can be rendered somewhere else in another snippet or template. This idea is inspired from Laravel Blade Stacks.

Upgrading to Kirby 6

Delete the plugin folder from site/plugins (or run composer remove owebstudio/kirby-template-stacks) before you update Kirby. Your push(), endpush() and stack() calls then use the Kirby 6 helpers. Most templates work without changes, but check these differences:

Template Stacks Kirby 6
push('scripts', true) push('scripts', unique: true)
stack('scripts', true) stack('scripts', return: true)
Items are joined without a separator. Items are joined with a line break. Use stack('scripts', '') to join them without one.
A stack keeps its items after it is rendered. A stack is emptied after it is rendered. Use stack('scripts', clear: false) to render it again.
A stack in <head> stays empty, because the pushes in the template run after it. Stacks can be rendered anywhere, also before the pushes, e.g. in <head>.

Change the true arguments first. In Kirby 6 the second argument of push() is the content and the second argument of stack() is the glue. So push('scripts', true) adds 1 to the stack and prints the content in place, and stack('scripts', true) prints the items joined with 1 instead of returning them.

Installation

  1. Download the latest release
  2. Unzip downloaded file
  3. Copy/paste unzipped folder in your /site/plugins folder

Methods

stack()

Calls a given stack name and prints all the items in it. The last data is printed last.

push() ... endpush()

Pushes data to a given stack name. The sent data is thrown to the end of the stack.

If the pushed data is unique and in a repeating loop, you can send the secondary parameter as true. For example; if you want a javascript library to be loaded only once in a blocks field.

Samples

Sample 1: with snippets and templates

Defining stacks

/site/snippets/header.php

/site/snippets/footer.php

Pushing contents to the stack

/site/templates/home.php

Sample 2: with new snippets with slots feature

Defining stacks

/site/snippets/layouts/default.php

Pushing contents to the stack

/site/templates/home.php


All versions of kirby-template-stacks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
getkirby/composer-installer Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package owebstudio/kirby-template-stacks contains the following files

Loading the files please wait ...