Skip to content

Commit

Permalink
Merge pull request #13 from oveleon/feature/logo-url
Browse files Browse the repository at this point in the history
Feature: LogoUrl and PHP8 + Contao 4.12 compatibility
  • Loading branch information
zoglo authored Nov 17, 2021
2 parents b1f5077 + 6f455c3 commit cad2af8
Show file tree
Hide file tree
Showing 38 changed files with 1,597 additions and 1,346 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019
Copyright (c) 2021 Oveleon https://www.oveleon.de

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
303 changes: 253 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,258 @@
# Contao Company Bundle
Allows you to manage company details for one or more companies provided in settings and root pages. Company details stored in settings are used as fallback, if an specific company detail is missing in involved root page.
<h1 align="center">Contao Company Bundle</h1>
<p align="center"><i>The Company Bundle adds company information via Insert-Tags, social media information and a logo module for websites and different website roots.</i></p>
<p align="center">
<a href="https://www.oveleon.de"><img src="https://img.shields.io/badge/oveleon-maintained-83aa0e?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAUCAYAAABvVQZ0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA/xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPH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GGaJRHKSIaYfIm7JRSsvHIyuM/wMorNeEfUMqKnbKwU2TBwpSUSWYWFmSBDKWmWcgwcX2Pvrc5HXfuXL/6zD2P3z2Puedouq5rilG40JPxAuUmeX84tGTkwyXsghOWYQmKoFazExzVDXFIgEeazcPV9TCnzGplRiHMl7KgCWYghy9vQAasMEfkTqQarJ9JFWw0YlhJFv2rUv8tdKiDhTib0eiHQyhOsR2xyjlp0BF5MBELdr6WohE++X6raBOz6PwWCfiCOLzDN8sRGICYyfdrgBA8Q2kmfnzQJirghlw+XZANUQ5qFmHY52R9/9lWCXjBpbRPcaubDhtHsRoOuN1reAO/1H/PpzfdaqrggzOLK7YFD6zPMqeL9at0gwWZuKa0i3hkuZf1E6tteqEZnmCRbZVwxPIOn3V83litaogzbrPuhDOIwbyUd8q8SavBOpl0rnxROadFugkFVoOJAx1h4rRJvw9e2b9u3ACrY9ENAZaD/L/E0aiHMbbfQc3v7bFxWAchqptHAAqN3HQrM0JcsXFohzzexWPYk5N+BBgAix5VyvzRZbwAAAAASUVORK5CYII=" alt="Oveleon"></a>
<a href="https://github.com/oveleon/contao-company-bundle"><img src="https://img.shields.io/badge/license-MIT-83aa0e?style=flat-square"/></a>
<a href="https://packagist.org/packages/oveleon/contao-company-bundle"><img src="https://img.shields.io/packagist/dt/oveleon/contao-company-bundle?color=0A7BBC&style=flat-square"/></a>
</p>

---

> Working with **Contao 4.9** and up to **Contao 4.12** (PHP ^7.4 and PHP 8)
---

The company bundle allows you to manage company details for one or more companies provided in the contao settings and website roots. Company details stored in the settings are used as a fallback if specific company details are missing in the involved website roots.
Company details can be displayed dynamically by using the provided company modules (social-media-list & logo) or alternatively by using the provided company insert tags.
You can display company details dynamically simply by using the provided company modules or alternatively by using a company insert tag.

## Overview
The following company details can be stored in settings and root pages:

- `Logo`
- `Company name`
- `Street`
- `Postal code`
- `City`
- `State`
- `Country`
- `Phone number`
- `Phone number 2`
- `Fax number`
- `E-mail address`
- `E-mail address 2`
- `Info`
- `Info 2`
- `Social-Media links`

## Modules
The following frontend modules are provided:

- `Logo`: Displays the stored company logo
- `Social media list`: Displays stored social media links
+ [Features](#features)
+ [Installation](#installation)
+ [Composer](#via-composer)
+ [Contao Manager](#via-contao-manager)
+ [Setup](#setup)
+ [Company-Details](#setup-company-details)
+ [Logo](#logo-module)
+ [Social-media-list](#social-media-list)
+ [Insert tags](#insert-tags)
+ [Company-details](#company-details)
+ [Additional](#additional)
+ [Front end Modules](#front-end-modules)
+ [Support](#support)
+ [Sponsoring](#sponsoring)

## Features

- Compatible with Contao 4.9 and higher versions (PHP 8 Support)
- Easy setup for company details
- All company details can be overwritten within website roots
- Fallback company details
- Insert tags
- Logo module
- Href works with prepend locale and different website roots
- Social media lists

![](https://www.oveleon.de/share/github-assets/contao-company-bundle/frontend/frontEnd.jpg)

## Installation

#### Via composer
```
composer require oveleon/contao-company-bundle
```

#### Via contao-manager
```
Search for contao company bundle and add it to your extensions.
```

After installing the contao-company-bundle, you need to run a **contao install**.

## Setup

### Setup company details

1. Go to `System > Settings` and navigate to the palette: `Company-details`

![Admin View: Company Details](https://www.oveleon.de/share/github-assets/contao-company-bundle/backend/systemSettings.jpg)


2. Type in your company details to be used with insert-tags and save the changes


3. Additionally you can select a logo and create multiple social media entries


4. If you want to overwrite your company-details for different website roots, go to `Layout > Site structure > Edit page (Root page)` and navigate to the palette: `Company-details`.
Keep in mind that saving these will overwrite the modules and insert-tags for this root page.

### Logo module

1. Create the front-end module *Logo*
2. Set up an image size
3. Embed the module within your layout (e.g. header-section) or in your articles

### Social media list

1. Create the front-end module *Social media list*
2. Choose a template (Default or nolabel)
3. Embed the module within your articles
4. (Additionally you can choose the template `nolabel` and style them with an icon font)


## Insert tags
All company details can be called anywhere by the following insert tags:

- `{{company::name}}`
- `{{company::street}}`
- `{{company::postal}}`
- `{{company::city}}`
- `{{company::state}}`
- `{{company::country}}`
- `{{company::phone}}`
- `{{company::phone2}}`
- `{{company::fax}}`
- `{{company::email}}`
- `{{company::email2}}`
- `{{company::info}}`
- `{{company::info2}}`

### Additional insert tags:

- `{{company::mailto}}`: Outputs a mailto link e.g. `<a href="mailto:my@mail.de">my@mail.de</a>`
- `{{company::mailto2}}`: Outputs a mailto link e.g. `<a href="mailto:my@mail.de">my@mail.de</a>`
- `{{company::tel}}`: Outputs a tel link e.g. `<a href="tel:01234567890">+49 1234 / 56 78 90</a>`
- `{{company::tel2}}`: Outputs a tel link e.g. `<a href="tel:01234567890">+49 1234 / 56 78 90</a>`
- `{{company::address}}`: Outputs the full address
- `{{company::countrycode}}`: Outputs the country code
Your company information can be displayed using following *insert-tags*.

> For more information on *Insert tags*, please visit the official <a href="https://docs.contao.org/manual/en/article-management/insert-tags/" title="Insert tags :: Contao Manual" target="_blank">Contao documentation</a>.
**Example**
```
{{company::name}}
{{company::tel}}
```

### Company details

<table>
<tr>
<th colspan="2"><strong>Company details</strong></th>
</tr>
<tr>
<td><strong>Insert tag</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>{{company::name}}</td>
<td>Displays the <b><u>company</u></b> name</td>
</tr>
<tr>
<td>{{company::street}}</td>
<td>Displays the <b><u>street</u></b></td>
</tr>
<tr>
<td>{{company::postal}}</td>
<td>Displays the <b><u>postal</u></b></td>
</tr>
<tr>
<td>{{company::city}}</td>
<td>Displays the <b><u>city</u></b></td>
</tr>
<tr>
<td>{{company::state}}</td>
<td>Displays the <b><u>state</u></b></td>
</tr>
<tr>
<td>{{company::country}}</td>
<td>Displays the <b><u>country</u></b></td>
</tr>
<tr>
<td>{{company::phone}}</td>
<td>Displays <b><u>Phone Number 1</u></b></td>
</tr>
<tr>
<td>{{company::phone2}}</td>
<td>Displays <b><u>Phone Number 2</u></b></td>
</tr>
<tr>
<td>{{company::fax}}</td>
<td>Displays the <b><u>Fax Number</u></b></td>
</tr>
<tr>
<td>{{company::email}}</td>
<td>Displays <b><u>E-mail address 1</u></b></td>
</tr>
<tr>
<td>{{company::email2}}</td>
<td>Displays <b><u>E-mail address 2</u></b></td>
</tr>
<tr>
<td>{{company::info}}</td>
<td>Displays <b><u>Info 1</u></b></td>
</tr>
<tr>
<td>{{company::info2}}</td>
<td>Displays <b><u>Info 2</u></b></td>
</tr>
</table>

### Additional

<table>
<tr>
<th colspan="2"><strong>Additional insert-tags</strong></th>
</tr>
<tr>
<td><strong>Insert tag</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>{{company::tel}}</td>
<td>Creates a phone link from <i>Phone1</i>
<pre>
&lt;a href="tel:01234567890"&gt;0123 / 45 67 890&lt;/a&gt;
</pre>
</td>
</tr>
<tr>
<td>{{company::tel2}}</td>
<td>Creates a phone link from <i>Phone2</i>
<pre>
&lt;a href="tel:01234567890"&gt;0123 / 45 67 890&lt;/a&gt;
</pre>
</td>
</tr>
<tr>
<td>{{company::mailto}}</td>
<td>Creates a mailto link from <i>E-Mail address 1</i>
<pre>
&lt;a href="mailto:info@oveleon.de"&gt;info@oveleon.de&lt;/a&gt;
</pre>
</td>
</tr>
<tr>
<td>{{company::mailto2}}</td>
<td>Creates a mailto link from <i>E-Mail address 2</i>
<pre>
&lt;a href="mailto:info@oveleon.de"&gt;info@oveleon.de&lt;/a&gt;
</pre>
</td>
</tr>
<tr>
<td>{{company::address}}</td>
<td>Displays the full address: <b>Street, Postal City</b></td>
</tr>
<tr>
<td>{{company::countrycode}}</td>
<td>Displays the ISO 639-1 country code from <i>Country</i></td>
</tr>
</table>

## Front end modules

### Logo (Company)
Displays the saved company logo.

The image for the logo-module is set up within the system or root page settings.

### Social media list (Company)
Displays the company social media.

The social media list is set up within the system or root page settings.

#### Adding custom social media
The social media platforms within the select box are generated from the file:

> tl_company_socials.xlf
You are able to add new social-media by creating a translation file and uploading them on your server as shown below:

**Contao root files**

![Admin View: Adding new socials](https://www.oveleon.de/share/github-assets/contao-company-bundle/backend/filesNewSocials.jpg)

**Company Settings**

![Admin View: Socials](https://www.oveleon.de/share/github-assets/contao-company-bundle/backend/newSocials.jpg)

## Support
> We **only provide support** for **bugs, and feature requests**; please only post issues about these two topics.
>
> If you need help implementing Contao Glossary Bundle or you are just starting out with Contao/CSS/JavaScript or HTML, please contact us on our [website](https://www.oveleon.de/kontakt.html#kontaktformular),
> visit the [Contao Community](https://community.contao.org/) or the [Contao Slack](https://join.slack.com/t/contao/shared_invite/enQtNjUzMjY4MDU0ODM3LWVjYWMzODVkZjM5NjdlNDRiZjk2OTI3OWVkMmQ1YjA0MTQ3YTljMjFjODkwYTllN2NkMDcxMThiNzMzZjZlOGU),
> you will be able to find more help there.
>
> This will help us to keep the issues related to this plugin and solve them faster.
## Sponsoring

If you find this plugin useful, please consider [sponsoring us](https://github.com/sponsors/oveleon) to help contribute to our time invested and to further development of this and other open source projects. Thank you for your support! - [Oveleon](https://www.oveleon.de).
22 changes: 15 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,35 @@
"name":"oveleon/contao-company-bundle",
"type":"contao-bundle",
"description":"Company integration for Contao 4 Open Source CMS",
"keywords":["contao","company-bundle"],
"keywords":["contao","company-bundle", "insert-tags"],
"homepage":"https://www.oveleon.de/company.html",
"license":"MIT",
"authors":[
{
"name":"Oveleon",
"homepage":"https://oveleon.de/",
"role":"Developer"
},
{
"name": "Fabian Ekert",
"homepage": "https://github.com/eki89",
"role":"Developer"
},
{
"name": "Sebastian Zoglowek",
"homepage": "https://github.com/zoglo",
"role":"Developer"
}
],
"require":{
"php":"^7.1",
"contao/core-bundle":"^4.4",
"menatwork/contao-multicolumnwizard-bundle": "^3.4"
"php": "^7.4 || ^8.0",
"contao/core-bundle":"^4.9"
},
"require-dev": {
"contao/manager-plugin": "^2.0"
"contao/manager-plugin": "^2.3.1"
},
"conflict": {
"contao/core": "*",
"contao/core-bundle": "4.4.1",
"contao/manager-plugin": "<2.0 || >=3.0"
},
"autoload":{
Expand All @@ -41,7 +49,7 @@
},
"extra":{
"branch-alias": {
"dev-master": "1.2.x-dev"
"dev-master": "1.3.x-dev"
},
"contao-manager-plugin": "Oveleon\\ContaoCompanyBundle\\ContaoManager\\Plugin"
}
Expand Down
10 changes: 7 additions & 3 deletions src/ContaoCompanyBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
declare(strict_types=1);

/*
* This file is part of Oveleon company bundle.
* This file is part of Oveleon Company Bundle.
*
* (c) https://www.oveleon.de/
* @package contao-company-bundle
* @license MIT
* @author Fabian Ekert <https://github.com/eki89>
* @author Sebastian Zoglowek <https://github.com/zoglo>
* @copyright Oveleon <https://www.oveleon.de/>
*/

namespace Oveleon\ContaoCompanyBundle;
Expand All @@ -14,4 +18,4 @@

class ContaoCompanyBundle extends Bundle
{
}
}
Loading

0 comments on commit cad2af8

Please sign in to comment.