{% extends "sprout-base-seo/_layouts/general" %} {% import "_includes/forms" as forms %} {% import "sprout-base-fields/_includes/forms" as sproutFields %} {% import "sprout-base-seo/_includes/sproutseo" as sprout %} {% do view.registerAssetBundle("barrelstrength\\sproutbase\\app\\seo\\web\\assets\\globals\\GlobalsAsset") %} {% set settings = craft.sproutSeo.getSettings() %} {% set contactOptions = craft.sproutSeo.getFinalOptions('contacts', 'contactType', globals) %} {% set cols = [ { type: 'selectOther', options: contactOptions }, { type: 'textual' } ] %} {% block content %}

{{ "Adding Corporate Contacts to your site's structured data can prominently display contact information on the Google Knowledge panel in some searches. Telephone numbers must use an international format starting with the '+' character such as: +1-800-555-1212"|t|raw }}

{{ csrfInput() }} {% for contact in globals.contacts %} {% endfor %}
{{ "Contact Type"|t }} {{ "Telephone"|t }}
{{ sproutFields.selectOther({ name: 'sproutseo[globals][contacts][' ~ loop.index ~ '][0]', options: contactOptions, value: contact.contactType, otherPlaceholderText: 'Custom Contact Type'|t }) }} {{ forms.text({ name: 'sproutseo[globals][contacts][' ~ loop.index ~ '][1]', value: contact.telephone, errors: '' }) }}
Add a Contact

{% js %} $( document ).ready(function() { var globals = {{ globals.contacts|json_encode|raw }}; if (globals == null) { $('#addContact').trigger('click'); } }); (function() { var tableId = 'sproutseo-schema-contacts'; var baseName = 'sproutseo[globals][contacts]'; var columns = {{ cols|json_encode|raw }}; var settings = {}; new Craft.SproutSeo.EditableTable(tableId, baseName, columns, settings); })(); {% endjs %} {% endblock %}