Data folder structure


back to folders structure

Data

Inside Data folder there will be all data files. For now Solidify Engine can support the following data formats:

Solidify Engine will look for exact file extension from the list provided above. In case it is unable to find a match, the engine will blow up. In case there is a match, it will apply a parser based on exact extension to transform file content to in-memory data object.

On views and pages you can use global object Data to access actual data that is located on the file system.

All properties of Data object are case sensitive.

More advanced details about how to work with data can be found in data special properties section.

Example

Let's assume that you have the following folders structure on you file system:

Data
    misc
        social.json

And inside social.json you have the following content:

{
    "profiles": [{
        "url": "http://facebook.com/JohnDoe",
        "icon": "fb.png",
        "name": "facebook"
    }, {
        "url": "http://twitter.com/JohnDoe",
        "icon": "tw.png",
        "name": "twitter"
    }]
}

Then our template that we will use to show the list of social profiles will look like this:

<ul>
    {{# Data.misc.social.profiles }}
        <li>
            <img src="{{ icon }}"/>
            <a href="{{ url }}">
                {{ name }}
            </a>
        </li>
    {{/ Data.misc.social.profiles }}
</ul>

More details about layout templates can be found in the dedicated layout section.

Finally, the html rendered by Solidify Engine will look like this:

<ul>
    <li>
        <img src="fb.png"/>
        <a href="http://facebook.com/JohnDoe">
            facebook
        </a>
    </li>
    <li>
        <img src="tw.png"/>
        <a href="http://twitter.com/JohnDoe">
            twitter
        </a>
    </li>
</ul>

Solidify Project is powered by .NET Core 2.0 and distributed under MIT license