Skip to content

Latest commit

 

History

History
executable file
·
426 lines (298 loc) · 6.16 KB

abe-attributes.md

File metadata and controls

executable file
·
426 lines (298 loc) · 6.16 KB

Abe attributes

abe tags can own many attributes

for example the type text, some required and other optional

{{abe type='text' key='text_key'}}
  • type
  • key

are always required for all content type

Type of abe content

Other attributes

tab (String)

Default: "default"

tab="NameOfTheTab"

Html input will be displayed into the tab NameOfTheTab

Allowed:

  • CamelCase
  • Underscore
  • Spaces
  • Special charactères

key (String)

Default: ""

key="keyData"

the key used into json file

Allowed:

  • CamelCase
  • Underscore
  • Dot

Examples:

{{abe type='text' key='title'}}
{
	"title": "value"
}
{{abe type='text' key='blog.title'}}
{
	"blog": {
		"title": "value"
	}
}

You can use dot json for keys the result will create json value when the data is saved

mypage.content.title.value as key will output

{"mypage": {"content": {"title": {"value": ""}}}}

type (String)

Default: "text"

type="text"

Result:

MacDown Screenshot

Look at all abe type here

autocomplete (Boolean)

Default: null

autocomplete="true"

Json example for autocomplete

[
	{
		"id": 1,
		"name": "test 1",
		"lang": "de"
	},
	{
		"id": 2,
		"name": "test 2",
		"lang": "fr"
	},
	{
		"id": 3,
		"name": "test 3",
		"lang": "es"
	}
]

MacDown Screenshot

for abe type data, display input form autocomplete into admin

desc (String)

Default: ""

desc="some description for the contributor"

The admin description over the input

Allowed:

  • CamelCase
  • Underscore
  • Spaces
  • Special charactères

display (String)

Default: null

display="variable"

for abe type data (autocomplete true or false)

Example:

display="{{name}}"

Json

[
	{
		"id": 1,
		"name": "test 1",
		"lang": "de"
	},
	{
		"id": 2,
		"name": "test 2",
		"lang": "fr"
	},
	{
		"id": 3,
		"name": "test 3",
		"lang": "es"
	}
]

the autocomplete value visible under the input will use name from json

  • test 1
  • test 2
  • test 3

Autocomplete 1

Multiple variables are allowed for example with our json:

display="{{name}} - {{lang}}"
  • test 1 - de
  • test 2 - fr
  • test 3 - es

Autocomple 2

editable (Boolean)

Default: true

editable="true"

if editable true user can change the value, if not abe will set the values

max-length (Int)

Default: null

max-length="3"

for abe type data, array max selection

min-length (Int)

Default: 0

min-length="1"

for abe type data, array min selection (if required)

source (String | variables)

Default: null

source="[ source type ]"

see abe type data

duplicate (Boolean)

Default: true

duplicate="true"

if set to false, when user duplicate a post. The value will not be duplicate into the new post

Example:

{{abe type='text' key='title' duplicate="false"}}

Json before duplicate:

{
  "abe_meta": {
    "template": "autocomplete",
    "link": "/test.html",
    "date": "2016-12-15T16:46:22.946Z",
  },
  "title": "test"
}

Json after duplicate:

value of title is not filled after duplicate the post with name test-2.html

{
  "abe_meta": {
    "template": "autocomplete",
    "link": "/test-2.html",
    "date": "2016-12-15T16:46:22.946Z",
  },
  "title": ""
}

reload (Boolean)

Default: false

reload="true"

if reload true, on blur event on the input field the post preview will be reloaded

required (Boolean)

Default: false

required="true"

If set to true user cannot publish the post without required field

Example:

{{abe type="text" key="title" required="true"}}

if submited but empty

Required

visible (Boolean)

Default: true

visible="true"

if visible set to false, the value will not be set into post page (but will be visible on the admin and set into the json file)

order (Int)

Default: 0

order="1"

to order the input in the admin

{{abe type='text' key='title1' desc='title 1' order="2"}}
{{abe type='text' key='title2' desc='title 2' order="1"}}

title1 is added before on the template but without order the result on the admin is inversed

Order

filetype (String)

Default: ""

filetype="image"

file (String)

Default: ""

file="partial.html"

see abe import

locale (String | variable)

Default: ""

locale="fr"

prefill (Boolean)

Default: false

prefill="true"

For abe type data, if set to true will add default values

On the admin side prefill add a reload button on the right

Prefill

prefill-quantity (Int)

Default: null

prefill-quantity="3"

How many default values to prefill