What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

Code-Free Templating

johnywhy

New member
Joined
Nov 15, 2022
Messages
5
Reaction score
0
HTML Coins
0
I'm just sharing a tool i developed that might be helpful to others.

It's a code-free, client-side templating tool, that will enable an HTML dev to display a collection of repeated items on a webpage with identical HTML, but different content.

GUmOYoyFM3np.png


"Template" meaning there's only one copy of the HTML, shared by all the items in the collection. To change the layout of all the items, you only have to edit the template.

Code-free meaning, you don't need to write or know Javascript. Everything is done in HTML, including the template, container, and data.

The content is separate from the HTML, so you can update the data without touching the HTML.

It's best for small projects with few items that don't change too often, where you can't or don't want to do server-side programming.

Feel free to ask questions here or on github.

https://github.com/johnaweiss/HTML-Micro-Templating

Here's a simple example.
  • The container puts the collection on the webpage.
  • The template contains double-bracketed placeholders, which get loaded with data.
  • The data is stored in a hidden area of the webpage
Code:
<body>
     <!-- CONTAINER -->
     <span mt-records="EEs" mt-template="engineer" class="engineers"></span>
</body>


     <!-- TEMPLATE -->
<template id="engineer">
    <span>
        <a target="_blank" href="http://[[LINK]]">
            <img src="[[IMAGE]]" alt="">
            <div class="caption">[[NAME]]</div>
        </a>
    </span>
</template> 


        <!-- DATA -->
    <mt-records hidden id="EEs">
        NAME
        LINK
        IMAGE

        Benervive Guper
        https://www.Guper.com
        Guper.jpg

        Phoey Ramstung
        https://Ramstung.com
        Ramstung.jpg

        Sam Smith
        https://samsmith.com
        sam.jpg
    </mt-records>
 
Unfortunately, I don't have any knowledge on coding. This all looks alien to me but thank you so much for sharing such wonderful information. I'm very sure that it's going to be useful for one person here.
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back