Download the PHP package juvo/bricks-dynamic-data-tags without Composer

On this page you can find all versions of the php package juvo/bricks-dynamic-data-tags. 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 bricks-dynamic-data-tags

God damn easy Bricks Builder Dynamic Data Tags

You are a developer and want to add dynamic data tags to the bricks builder? This package is for you. From now on you can add your dynamic data tags with 3 lines of code. It automatically registered tags, parses filters and even allows you to add your very own pattern parsing.

Feature overview:

Quick Demo using within Child Theme

Installation

To install the package you can use composer. Run the following command in your terminal:

You should initiate the registry as early as possible. The best place to do this is in your plugin's main file or the functions.php of your theme.

Usage

To register a simple dynamic data tag you can use the following code snippet. The first parameter is the tag name, the second parameter is the tag label, the third parameter is the tag group and the last parameter is the callback that returns the tag output.

To register another tag to the same group you simply do:

Bricks Builder Dynamic Data Tags List

Filter tags that get registered

The juvo/register_dynamic_tags filter allows you to modify the tags that get registered. This filter passes the at this point added data tags as array. You can use this to remove tags.

Filter the tag pattern

The juvo/dynamic_data_tag/parse_tag filter allows you to modify how all tags are parsed. This filter passes the tag pattern and the tag name as arguments. It allows you to parse a custom structure of for your data tags. To add new variables that are passed to the callback make sure to add them as a named capturing group with the regex.

Your callback now needs one more parameter:

Filter the tag pattern by tag name

The juvo/dynamic_data_tag/parse_tag filter allows you to modify the tag pattern for a specific tag.

Modify the data passed to the callback

If you used one of the parse_tag filters to add your own structure and variables to a tag, you can use this filter to modify the variable itself. This is needed e.g. if you can add your new strucutre multiple times. By default parameters are split with ":" and filters are split with "|". If you add a new structure that is for example split with "~" you should use this filter split the data accordingly.

Use named filters

It is possible to register dynamic data tags like these: {single_tag:tag=tag_slug:link=true}. In your callback you need to parse the filter values to work with key value pairs. This example allows you to display tags, filter which tag to display by slug and filter the tags name should be wrapped in a link to the term itself.

In this example

Modify allowed html tags

The output of the callback is filtered with wp_kses to prevent XSS attacks. You can modify the allowed tags with the wp_kses_allowed_html filter. This filter passes the allowed tags and the context as arguments. You can use this to modify allowed html tags.

To allow different html tags per dynamic data tag there is also a special hook. As you can see in the code snippet, general tags are filtered first and then passed to a tag specific filter.

Advanced examples:

iFrame

Registers a dynamic data tag that displays the current post embedded in an iFrame.

Post Data

Register a dynamic data tag {post_data} to display post data. A filter allows to select which data to display. Another custom filter "bold" allows to mark certain data to be bolded. The tag can be used like this: {post_data:title:post_type~bold=post_type~bold=title} will be displayed as "Title, Post Type".


All versions of bricks-dynamic-data-tags with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
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 juvo/bricks-dynamic-data-tags contains the following files

Loading the files please wait ....