Config to add custom css and javascript (Eg. google anlytics)

This commit is contained in:
jitendra 2020-09-03 19:24:15 +05:30
parent cc23180664
commit 4b6bb0a8f5
13 changed files with 75 additions and 10 deletions

View File

@ -88,6 +88,25 @@ return [
'channel_based' => true,
],
],
], [
'key' => 'general.content.custom_scripts',
'name' => 'admin::app.admin.system.custom-scripts',
'sort' => 1,
'fields' => [
[
'name' => 'custom_css',
'title' => 'admin::app.admin.system.custom-css',
'type' => 'textarea',
'channel_based' => true,
'locale_based' => false,
], [
'name' => 'custom_javascript',
'title' => 'admin::app.admin.system.custom-javascript',
'type' => 'textarea',
'channel_based' => true,
'locale_based' => false,
]
],
], [
'key' => 'general.design',
'name' => 'admin::app.admin.system.design',

View File

@ -1351,7 +1351,10 @@ return [
'contact-number' => 'رقم الاتصال',
'bank-details' => 'التفاصيل المصرفية',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1334,7 +1334,10 @@ return [
'contact-number' => 'Kontakt Nummer',
'bank-details' => 'Bankdaten',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
],
],
];

View File

@ -1356,7 +1356,10 @@ return [
'contact-number' => 'Contact Number',
'bank-details' => 'Bank Details',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1316,7 +1316,10 @@ return [
'contact-number' => 'Número de contacto',
'bank-details' => 'Detalles del banco',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1352,7 +1352,10 @@ return [
'contact-number' => 'شماره تماس',
'bank-details' => 'اطلاعات دقیق بانکی',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1357,7 +1357,10 @@ return [
'contact-number' => 'Numero di contatto',
'bank-details' => 'Coordinate bancarie',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1352,7 +1352,10 @@ return [
'contact-number' => 'Contact nummer',
'bank-details' => 'Bankgegevens',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1341,7 +1341,10 @@ return [
'contact-number' => 'Numer kontaktowy',
'bank-details' => 'Dane bankowe',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1355,7 +1355,10 @@ return [
'contact-number' => 'Número de contato',
'bank-details' => 'Detalhes bancários',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -1338,7 +1338,10 @@ return [
'contact-number' => 'İletişim numarası',
'bank-details' => 'Banka detayları',
'mailing-address' => 'Send Check to',
'instructions' => 'Instructions'
'instructions' => 'Instructions',
'custom-scripts' => 'Custom Scripts',
'custom-css' => 'Custom CSS',
'custom-javascript' => 'Custom Javascript'
]
]
];

View File

@ -32,6 +32,10 @@
{!! view_render_event('bagisto.shop.layout.head') !!}
<style>
{!! core()->getConfigData('general.content.custom_scripts.custom_css') !!}
</style>
</head>
@ -117,6 +121,10 @@
<div class="modal-overlay"></div>
<script>
{!! core()->getConfigData('general.content.custom_scripts.custom_javascript') !!}
</script>
</body>
</html>

View File

@ -57,6 +57,10 @@
{!! view_render_event('bagisto.shop.layout.head') !!}
<style>
{!! core()->getConfigData('general.content.custom_scripts.custom_css') !!}
</style>
</head>
<body @if (core()->getCurrentLocale()->direction == 'rtl') class="rtl" @endif>
@ -206,5 +210,9 @@
</script>
@stack('scripts')
<script>
{!! core()->getConfigData('general.content.custom_scripts.custom_javascript') !!}
</script>
</body>
</html>