SMT USING EXTENSION

If we have a multiple domain smt pages and if we edit or change the content of the smt pages means the changes were made by the domain is affecting one domain to another domain so for that issue we need to create a configuration array to store the values like first we need to compare the details by SC.Configuration and to get smt configuration by addind code smt pages to get the SC.Configuration for smt pages

{
    "type": "object",
    "subtab": {
        "id": "pagesSmt",
        "group": "extensions",
        "title": "pagesSmt",
        "description": "smt Pages"
    },
    "properties": {
        "pages.Smt": {
            "group": "extensions",
            "subtab": "Domainname",
            "type": "array",
            "title": "smt_Pages",
            "description": "Config description example",
            "items": {
                "type": "object",
                "properties": {
                    "Domain": {
                        "type": "string",
                        "title": "Domain_Name",
                        "description": "",
                        "translate": true
                    },
                    "Phonenumber": {
                        "type": "string",
                        "title": "Phone_number",
                        "description": "",
                        "translate": true
                    },
                    "Phonenumber1": {
                        "type": "string",
                        "title": "Phone_number1",
                        "description": "",
                        "translate": true
                    },
                    "Email": {
                        "type": "string",
                        "title": "Email",
                        "description": "",
                        "translate": true
                    },
                    "Text": {
                        "type": "string",
                        "title": "text",
                        "nsType":"textArea",
                        "description": "",
                        "translate": true
                    },
                    "Ezsheild": {
                        "type": "string",
                        "title": "Ezsheild text",
                        "description": "",
                        "translate": true
                    },
                    "Supplies": {
                        "type": "string",
                        "title": "Supplies text",
                        "description": "",
                        "translate": true
                    },
                    "Micr": {
                        "type": "string",
                        "title": "Micr text",
                        "description": "",
                        "translate": true
                    }
                }
            },
            "default": [
                {
                    "Domain": "https://www.formsscasb.tk/",
                    "Phone number": "",
                    "Email": "info@formscs.com",
                    "Text": "",
                    "Ezsheild text":"",
                    "Supplies text":"",
                    "Micr text":""
                }
For smt pages to get the configuration details :

var data = SC.CONFIGURATION.pages.Smt;

var baseUrl = SC.CONFIGURATION.siteSettings.touchpoints.home

var currentDomain = SC.CONFIGURATION.micrositeSolution.domainName;

var list = _.each(data, function (params) {

            if (params.Domain == currentDomain) {

                return params

            }

        });

console.log('current Data', list);

$('.Email').text(list[0].Email);

$('.Phonenumber').text(list[0].Phonenumber);

Leave a comment

Your email address will not be published. Required fields are marked *