# definition.json

The definition.json file establishes general characteristics of the Tenant such as the name and URL of the website, social media links, the navigation menu and the extraction mechanisms that are used.

It also enables the modification of certain ads and metrics settings, the behavior of UI elements, and the configuration of the Marfeel native apps.

When the scaffolding of a Tenant is done, it includes this file with basic information filled in: the general attributes, the fields that are common for every site, and the section pages that need to be marfeelized.

For example, this is how a simple definition.json file can look like:

{
    "name":"index",
    "title":"Title of the awesome example site",
    "uri":"www.example.com",
    "userInterface":{
        "lang":"en",
        "themeName":"mediaBlog",
        "resourcesHost":"https://bc.marfeelcache.com"
    },
    "configuration":{
        "cronRefresh":"0 1 0 1/1 * ? *",
        "whiteCollarScript":"index/src/whiteCollar/main.js",
        "whitelist":"picture-container",
        "blacklist":"date"
    },
    "sectionDefinitions":[{
        "name":"home",
        "styles":"photo",
        "title":"Home",
        "configuration":{
            "cronRefresh":"0 0/3 * 1/1 * ? *"
        },
        "feedDefinitions":[{
            "uri":"http://www.example.com/",
            "alibabaDefinition":{}
        }]
    },{
        "name":"section",
        "title":"Section 1",
        "feedDefinitions":[{
            "uri":"http://www.example.com/category/sports/",
            "alibabaDefinition":{}
        }]
    }
    ]
}

The first properties that appear at the beginning define the name of the directory where the Tenant is located, the title and the uri of the website.

Then userInterface contains properties that configure the Marfeel version: lang declares the language, themeName sets up the Marfeel theme, and resourcesHost indicates the domain where the Tenant is hosted. Besides, it can contain a wide range of features flags.

# Types of flags

To deliver a customizable product, Marfeel has developed a wealth of flags that are set in a Tenant's definition.json. They are divided into the following categories:

# User Interface flags

They customize the behavior of ads and UI elements. See the User Interface flags catalog to find the available options.

# Extraction flags

These are related to the extraction mechanisms that a Tenant uses.

For example, they can indicate if the section pages are built with a WhiteCollar or the MarfeelPress plugin.

They can also manage the extraction in article pages with blacklist and whitelist, image settings and other options available in the Extraction flags catalog.

# SectionDefinitions flags

The navigation menu of the Tenant is configured with these flags. They apply to both the lateral and the horizontal menus.

Every menu item is created with these basic attributes:

  • name registers the name of the menu item that can be reused in other parts of the code. For example, to set up ads, create content groups or for styling purposes.
  • title is the text of the menu item as it shows on the screen.
  • feedDefinitions contains the uri of the page where the menu item links to. Also, it enables further customization with alibabaDefinition.

To see the extra settings that are supported for menu items, see the SectionDefinitions flags.

# Cherokee flags

cherokee is the attribute in definition.json that contains the configuration of the Marfeel native apps of a Tenant.

This is an example of how it looks like:

"cherokee": {
    "title": "Name of the app",
    "oneSignalAppId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "pluginsToRemove": "",
    "distributionBuild": true,
    "apps": [
        {
            "badget": "indexAppIcon",
            "ios": "https://itunes.apple.com/es/app/example/idxxxxxxxxxx",
            "android": "https://play.google.com/store/apps/details?id=com.marfeel.cherokee.index.www.example.com"
        }
    ]
},

The list of supported cherokee flags can be found in the catalog.

# Ad flags

There are several settings regarding ads that can be modified with the ad flags available in the catalog.

If any of them is needed, it has to be used in features of the userInterface attribute.

# Social flags

Social media networks like Twitter, Facebook and Instagram are very important to many Tenants. To configure features about this, it is possible to use social flags on every site.

# Metrics flags

To add extra options that affect the analytics systems of a Tenant, the definition.json also accepts certain metrics flags.

# Inheritance

definition.json follows Marfeel's inheritance rules.