-
Notifications
You must be signed in to change notification settings - Fork 0
Creating custom tags for power development
Defining and utilizing custom tags is as easy as 1,2,3.
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>" }
]
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>
.
Now, you can use your custom tags freely, like so:
<header></header>
...content...
<footer></footer>
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.
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 toflsehtmlcomponent