biankakriege / contao-company-data
Package info
github.com/biankakriege/contao-company-data
Type:contao-bundle
pkg:composer/biankakriege/contao-company-data
Requires
- php: ^8.3
- contao/core-bundle: ^5.3 || ^5.7 || ^6.0
- giggsey/libphonenumber-for-php: ^8.13
- spatie/schema-org: ^3.10 || ^4.0
- symfony/http-client: ^6.4 || ^7.0 || ^8.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
English | Deutsch
biankakriege/contao-company-data is an extension for the Contao CMS.
Manage company data and contact persons in one place and reuse them in content elements, modules, form notifications and as structured data (schema.org JSON-LD). Change it once, and every page shows the update.
Installation
Search for biankakriege/contao-company-data in the Contao Manager or install it via Composer:
composer require biankakriege/contao-company-data
Usage
Companies and persons
Create companies under Content › Company data: address, contact details, legal notice and logo. Each company can have persons with position, contact details, office hours and image.
Content elements and modules
- Contact details: contact details of a company, e.g. for the imprint or footer
- Person list / Single person: contact persons of a company
- Logo and Company contact details as frontend modules, e.g. for the page layout
Use Field selection to choose which data each element shows.
Forms
In the form settings (Enrich form data with company) you can append an email signature or provide placeholders such as ##form_company_name## for the Notification Center.
Structured data (JSON-LD)
Select a company in the website root (Company (JSON-LD)) to output it as Organization on every page. The content elements add the company and the shown persons as well. Schema.org type, description, an optional image (e.g. team or office photo) and profiles (sameAs) are set per company. The empty WebPage node Contao adds to every page is completed with URL, title, description, language and the company as publisher.
Check the result with the Schema Markup Validator.
IndexNow (optional)
Notifies Bing and other IndexNow search engines when a published page, news item or event is saved. To enable it, set a key and place a file with the same name in public/:
# .env.local
INDEXNOW_KEY=8f2c1e7a9b4d4f0e
echo -n 8f2c1e7a9b4d4f0e > public/8f2c1e7a9b4d4f0e.txt
Without a key nothing is sent. News and events are only covered if the respective bundle is installed.
Insert tags
{{company::field}} outputs a field of the company selected in the website root, {{company::field::alias}} the field of a specific company. Instead of the alias you can also use the ID.
Fields: name, address, street, postal, city, country, phone, fax, email, website, logo (path) and the legal notice fields such as imprintName or imprintVatIdentificationNumber.
{{company::name}}, {{company::address}}
{{company::phone::muster-gmbh}}
{{company_person::field::alias}} outputs a field of a published person, e.g. {{company_person::email::erika-muster}}. Fields: fullname, title, name, position, department, phone, mobile, fax, email, website, address, country and image (path).
Templates
All templates can be overridden as usual, e.g. bk_company_contact.html.twig, content-person-list.html.twig or mail_signature.html.twig.
For tel: links, the Twig filter tel_href formats a phone number as E.164. The argument is the ISO country code (the company's country, a mandatory field). Numbers that cannot be parsed are output unchanged. The templates provide the code as countryCode:
<a href="tel:{{ phone|tel_href(countryCode|default) }}">{{ phone }}</a>
License
LGPL-3.0-or-later





