Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Creating custom tags for power development

Ejaz edited this page Feb 7, 2021 · 2 revisions

Defining and utilizing custom tags is as easy as 1,2,3.

Method 1, predefined tags via JSON

Define Custom Tags

Define your custom tags in another file that is accessible from your original, in our case we'll call this tags.json.

Now, define your tags in an array like so:

[
{ "tag":"header", "value":"<h1>FLSE</h1><button>About</button><button>Contact</button>"},
{ "tag":"footer", "value":"<p>This is the site footer</p>" }
]

Import Custom Tags

You'll need to now import your tags into the file you want to drop them into, so FLSE knows what to do with them. Add the following tag to the bottom of your page:

<flseimport src="tags.json" type="components"/>

components means we'll be importing downloadable components, however don't be confused as they are not the same as <flsehtmlcomponent>.

Use Custom Tags

Now, you can use your custom tags freely, like so:

<header></header>
...content...
<footer></footer>

Method 2, use the contents of a file as a tag

Import Custom Tag

You'll need to import your file like so:

<flseimport src="filename.html" type="component" name="tagname"/>

Make sure the type is component and not components as that will make FLSE believe that you are attempting to parse a JSON array that we mentioned in method 1.

Your name needs to be the name of the tag you wish to use.

Your src needs to be the file that you want the contents to be used for the tag.

Use Custom Tag

Now you can use your custom tag like so:

<tagname></tagname>

Important Information: FLSE import and FLSE custom tags will be suceeding flsehtmlcomponent, so make sure you switch to the newer format as it boasts better stability compared to flsehtmlcomponent


Looking for something else?