590

Product support

Get help in the plugin support forum.

Categories

Synder.BlogCustoms is a simple solution to add custom datasets to your single post-entries of the RainLab.Blog OctoberCMS plugin and use them in your Twig theme files.

Attention: Synder.BlogCustoms requires PHP 7.4+!

Features

  • Create as many custom datasets as you need / post.
  • Declare the custom value type ('text', 'number' or 'array').
  • Use and Output all your custom datasets natively in your theme.
  • Own FormWidget to handle custom datasets, which just looks like the repeater widget.

Requirements

Honest Reviews are always welcome

We really appreciate it if you leave us an honest review, if you're missing a feature or encounter a bug please don't hesitate and open an issue on our GitHub repository or write us an e-mail at october@synder.dev. Thanks!

You Custom Datasets can easily be added on the Post Form.

You can use all declared custom datasets directly in your theme files, where RainLab.Blog (or to be more precise, where the Post Model of the RainLab.Blog plugin) is available as well. Synder.BlogCustoms adds two dynamic properties to RainLab's Post model:

  • customs, which contains the processed datasets as key: value paired array
  • rawCustoms, which contains Laravels / OctoberCMS' Collection class instance

It is highly recommended using customs in your frontend presentation and rawCustoms on custom backend forms or environments.

Available Types

Each single custom dataset allows you to define a field type, if you aren't familiar with those, then always leave it at the standard value "Text". However, the current version allows you to choose from 3 different types:

  1. Text - Just text, nothing special
  2. Numeric - Formats the value as an integer or float
  3. Array - Splits the data value into an array using comma (,) as explode character.

This type-declaration is only available on the customs property AND is currently not used in any validation process. The rawCustoms property contains the plain, unformatted string.

Important: If you pass an empty field / string, the value will be processed into null regardless of the declared type!

Example

Assume you've 3 custom datasets defined in your current post view (text, numeric and array), you are able to access and use them like any other Twig variables:

{{ post.customs.text }}

{{ post.customs.numeric + 12 }}

{% if 'value1' in post.customs.array %}
    YaY
{% endif %}
1.0.4

Support for PHP 8.0 and updated plugin details.

Jul 24, 2021

1.0.3

Bugfix Composer.json version constraint

Jul 23, 2021

1.0.2

Bugfix Reinitialize select2 fields.

Jul 22, 2021

1.0.1

Add AJAX handler to update (new) custom datasets.

Jul 22, 2021

1.0.0

First Version.

Jul 22, 2021