Download the PHP package thepixelage/craft-fragments without Composer

On this page you can find all versions of the php package thepixelage/craft-fragments. 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 craft-fragments

Fragments icon

Fragments Plugin for Craft CMS

Fragments is a Craft CMS plugin for managing content and presentational fragments. It allows you to decouple your entry types from content blocks, widgets or components that are ad-hoc or presentational in nature, similar to blocks and regions in Drupal or modules and positions in Joomla.

Fragments

With Fragments comes a set of entities to help you manage content and presentational fragments:

Why Fragments?

There are many situations where fragments of content need to be displayed in multiple pages, but they are ad-hoc content parts or data that may not be part of your entry types.

For example, your Services pages may need a call-to-action button or lead form specific to the service. While you may model a custom field in the Services entry type to allow content editors to indicate the call-to-action to display, this piece of information becomes coupled to the entry type. If these buttons and lead forms also need to appear on other pages, each of the other entry types also need to have this field added to them.

Without Fragments, you may use features in Craft CMS to cobble together a solution around this, but they bring along some challenges:

With Fragments, your content editors can create call-to-action fragments that can be included in template zones outside of the entry types.

Documentation

Learn more and read the documentation at https://www.thepixelage.com/plugins/fragments.

License

This plugin requires a commercial license purchasable through the Craft Plugin Store.

Requirements

This plugin requires Craft CMS 3.6.0 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Fragments”. Then click on the “Install” button in its modal window.

With Composer

Open your terminal and run the following commands in your project directory:

Setup

Before you can start creating fragments, you need to set up the fragment types and template zones. The Fragments section will only appear after at least one fragment type and one template zone are created.

Fragment Types

Fragment types are similar to how entry types are set up. Custom fields can be specified to give a structured content model for the fragments.

To create a new fragment type, go to Settings → Fragments → Fragment Types.

Zones

Template zones (or zones, as we simply call it) allow you to specify areas in your templates where fragments can be created and displayed in. Zones can also limit the fragment types that are allowed to be created in them. This helps make it easier to organise and manage fragments in the zones.

To create a new template zone, go to Settings → Fragments → Zones.

Querying Fragments

To query a list of fragments in a zone to display in your templates:

Once you have queried the list of fragments, you can access the fields the same way you do for Entries.

To target only fragments of a certain fragment type, modify the previous query like this:

GraphQL Support

GraphQL is supported from version 1.1.0. An example query is shown below:

The arguments zone and type work the same way as the Twig example above.

Use currentUrl to pass in a URL that can be used to match against any fragment visibility rules that you have set up.


Created by ThePixelAge


All versions of craft-fragments with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.0.0-beta.1
ext-json Version *
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 thepixelage/craft-fragments contains the following files

Loading the files please wait ....