Site Globals
Manage site-wide configuration and shared data
Site Globals
Site Globals store site-wide configuration and shared data accessible from any template via {{siteglobals.*}} or {{sg.*}}.
Structure
Site Globals are organized into groups, each containing properties:
- Group: Company Info, Contact, Social Media, Settings
- Properties: Name, Phone, Email, Address, Logo, etc.
Create a Group
POST /api/v2/admin/site-globals
{
"Name": "Company Info",
"Alias": "company",
"Description": "Company information and branding"
}
Create a Property
POST /api/v2/admin/site-globals/{groupId}/properties
{
"Name": "Company Name",
"Value": "Acme Corporation",
"PropertyType": "SingleLineText"
}
Property Types
SingleLineText: Short text (company name, phone)MultiLineText: Long text (address, description)HTML: Rich HTML contentMedia: Image or file uploadBoolean: True/false checkbox
Using in Templates
Access site globals using dot notation:
Common Use Cases
- Company Info: Name, tagline, logo, description
- Contact Details: Phone, email, address, maps link
- Social Media: Facebook, Twitter, Instagram URLs
- Site Settings: Google Analytics ID, reCAPTCHA key
- Legal: Copyright text, privacy policy link
Best Practices
- Use descriptive group and property aliases
- Never hardcode company info — always use site globals
- Choose HTML type for rich content (footer, copyright notice)
- Use Media type for logos and brand assets
💡 Pro Tip
Site Globals make your site maintainable. Change the company phone once, and it updates everywhere automatically.
Code Examples
// JavaScript: Site Globals Manager
class SiteGlobalsManager {
constructor(token, baseUrl) {
this.token = token;
this.baseUrl = baseUrl;
}
async createGroup(name, alias, description = '') {
const response = await fetch(`${this.baseUrl}/api/v2/admin/site-globals`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
Name: name,
Alias: alias,
Description: description
})
});
return await response.json();
}
async createProperty(groupId, name, value, propertyType = 'SingleLineText') {
const response = await fetch(
`${this.baseUrl}/api/v2/admin/site-globals/${groupId}/properties`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${this.token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
Name: name,
Value: value,
PropertyType: propertyType
})
}
);
return await response.json();
}
async updateProperty(groupId, propertyId, value) {
const response = await fetch(
`${this.baseUrl}/api/v2/admin/site-globals/${groupId}/properties/${propertyId}`,
{
method: 'PUT',
headers: {
'Authorization': `Bearer ${this.token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ Value: value })
}
);
return await response.json();
}
async listGroups() {
const response = await fetch(
`${this.baseUrl}/api/v2/admin/site-globals`,
{ headers: { 'Authorization': `Bearer ${this.token}` } }
);
return await response.json();
}
async getGroup(id) {
const response = await fetch(
`${this.baseUrl}/api/v2/admin/site-globals/${id}`,
{ headers: { 'Authorization': `Bearer ${this.token}` } }
);
return await response.json();
}
}
// Usage: Setup company info
const sg = new SiteGlobalsManager(token, 'https://your-site.webinone.com');
// Create group
const company = await sg.createGroup('Company Info', 'company', 'Company details and branding');
// Add properties
await sg.createProperty(company.Id, 'Company Name', 'Acme Corporation', 'SingleLineText');
await sg.createProperty(company.Id, 'Phone', '+1 (555) 123-4567', 'SingleLineText');
await sg.createProperty(company.Id, 'Email', 'info@acme.com', 'SingleLineText');
await sg.createProperty(company.Id, 'Address', '123 Main St\nNew York, NY 10001', 'MultiLineText');
await sg.createProperty(company.Id, 'Logo', '/images/logo.png', 'Media');