Skip to content

Commit

Permalink
[Bugfix] Added {{company::countrycode}} and fixed `{{company::count…
Browse files Browse the repository at this point in the history
…ry}}` to display the full countryname
  • Loading branch information
zoglo committed Jul 12, 2021
1 parent d4f342f commit b1f5077
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ All company details can be called anywhere by the following insert tags:
- `{{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::countryname}}`: Outputs the full name of the company country
- `{{company::countrycode}}`: Outputs the country code
4 changes: 3 additions & 1 deletion src/EventListener/InsertTagsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private function replaceCompanyInsertTags($insertTag, $field)
}

return implode(', ', $arrAddress);
case 'countryname':
case 'country':
$value = Company::get('country');

if (empty($value))
Expand All @@ -157,6 +157,8 @@ private function replaceCompanyInsertTags($insertTag, $field)
$strCountry = $GLOBALS['TL_LANG']['CNT'][$value];

return $strCountry;
case 'countrycode':
return Company::get('country');
}

return Company::get($field);
Expand Down

0 comments on commit b1f5077

Please sign in to comment.