Skip to content

Commit

Permalink
doc: #77 abe attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Dec 13, 2016
1 parent 1063ee3 commit 4443843
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,25 @@ List of self-descriptive Abe tag
{{/each}}
```

## Template designer references

- [abe tags template integration](docs/abe-tags.md)
- [abe attributes](docs/abe-attributes.md)
- [abe handlebars variables](docs/abe-handlebars-variables.md)
- [abe handlebars helpers](docs/abe-handlebars-helpers.md)

## Template cms admin

- [abe users management](docs/abe-users.md)
- [abe route list](docs/abe-url.md)
- [abe config json](docs/abe-config.md)

## Template plugins developer

- [abe plugin install](docs/abe-plugins.md)
- [abe plugin hook list](docs/abe-hooks.md)
- [abe attributes](docs/abe-attributes.md)

More detailled documentation comming soon

## Adding a template and assets (css / js / images ...)
Expand Down
File renamed without changes.
115 changes: 115 additions & 0 deletions docs/abe-tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Abe tag

> You can add abe tag to you template following simple rules
## Abe DOM element

This abe tag will display `text` on the document

TEMPLATE

```html
<html>
<head>
</head>
<body>
{{abe type='text' key='text_dom'}}
</body>
</html>
```

RENDER

```html
<html>
<head>
</head>
<body>
Hello
</body>
</html>
```

## Abe DOM Attributes

This example will be added to `body > class` html attributes

TEMPLATE

```html
<html>
<head>
</head>
<body class="{{abe type='text' key='text_class'}}">

</body>
</html>
```

RENDER

```html
<html>
<head>
</head>
<body class="class-hello">

</body>
</html>
```

## More examples

#### multiple attributes
multiple attributes are allowed on the same html DOM object

```html
<html>
<head>
</head>
<body class="{{abe type='text' key='text_class'}}" id="{{abe type='text' key='text_id'}}">

</body>
</html>
```

#### concatenate with attribute

```html
<html>
<head>
</head>
<body class="my-body-class {{abe type='text' key='text_class'}}">

</body>
</html>
```

#### if handlebars

On the next example if variable `text_class` is not empty use `text_class` otherwise use `my-default-class`

```html
<html>
<head>
</head>
<body class="{{#if text_class}}{{abe type='text' key='text_class'}}{{else}}my-default-class{{/if}}">

</body>
</html>
```

# [ WARNING ] THE FOLLOWING EXAMPLE ARE NOT IMPLEMENTED YET

Multiple abe attribute into the same html tag

```html
<html>
<head>
</head>
<body class="{{abe type='text' key='text_1'}}{{abe type='text' key='text_2'}}">

</body>
</html>
```

0 comments on commit 4443843

Please sign in to comment.