Skip to content

Commit

Permalink
[FEATURE] Add Instagram profile URL (#229)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Kott <benjamin.kott@outlook.com>
  • Loading branch information
derhansen and benjaminkott authored Nov 17, 2021
1 parent cb2c710 commit 00feddf
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 10 deletions.
23 changes: 23 additions & 0 deletions Classes/Domain/Model/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ class Author extends AbstractEntity
*/
protected $xing = '';

/**
* @var string
*/
protected $instagram = '';

/**
* @var string
*/
Expand Down Expand Up @@ -318,6 +323,24 @@ public function setXing(string $xing): self
return $this;
}

/**
* @return string
*/
public function getInstagram(): ?string
{
return $this->instagram;
}

/**
* @param string $instagram
* @return Author
*/
public function setInstagram(string $instagram): self
{
$this->instagram = $instagram;
return $this;
}

/**
* @return string
*/
Expand Down
1 change: 1 addition & 0 deletions Configuration/DataHandler/BlogSetupRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
'website' => 'https://typo3.com/',
'email' => 'noreply@typo3.com',
'twitter' => 'typo3',
'instagram' => 'https://www.instagram.com/typo3_official/',
];

// Comment
Expand Down
10 changes: 10 additions & 0 deletions Configuration/TCA/tx_blog_domain_model_author.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@
],
'l10n_mode' => 'exclude',
],
'instagram' => [
'label' => $ll . 'tx_blog_domain_model_author.instagram',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => '',
],
'l10n_mode' => 'exclude',
],
'profile' => [
'label' => $ll . 'tx_blog_domain_model_author.profile',
'config' => [
Expand Down Expand Up @@ -292,6 +301,7 @@
twitter,
linkedin,
xing,
instagram,
profile,
--div--;' . $ll . 'tx_blog_domain_model_author.tab_blog,
posts,
Expand Down
13 changes: 8 additions & 5 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,22 @@
</trans-unit>

<!-- Author -->
<trans-unit id="author.aboutTheAuthor" xml:space="preserve">
<trans-unit id="author.aboutTheAuthor" xml:space="preserve">
<source>About the Author</source>
</trans-unit>
<trans-unit id="author.social.website" xml:space="preserve">
<trans-unit id="author.social.website" xml:space="preserve">
<source>Website</source>
</trans-unit>
<trans-unit id="author.social.twitter" xml:space="preserve">
<trans-unit id="author.social.twitter" xml:space="preserve">
<source>Twitter</source>
</trans-unit>
<trans-unit id="author.social.linkedin" xml:space="preserve">
<trans-unit id="author.social.instagram" xml:space="preserve">
<source>Instagram</source>
</trans-unit>
<trans-unit id="author.social.linkedin" xml:space="preserve">
<source>LinkedIn</source>
</trans-unit>
<trans-unit id="author.social.xing" xml:space="preserve">
<trans-unit id="author.social.xing" xml:space="preserve">
<source>Xing</source>
</trans-unit>
<trans-unit id="author.more.posts" xml:space="preserve">
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@
<trans-unit id="tx_blog_domain_model_author.xing" xml:space="preserve">
<source>XING profile URL</source>
</trans-unit>
<trans-unit id="tx_blog_domain_model_author.instagram" xml:space="preserve">
<source>Instagram profile URL</source>
</trans-unit>
<trans-unit id="tx_blog_domain_model_author.profile" xml:space="preserve">
<source>Author profile URL (used for schema.org markup)</source>
</trans-unit>
Expand Down
13 changes: 8 additions & 5 deletions Resources/Private/Partials/General/SocialIcons.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<f:section name="LinkedIn">
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M464 0H48C21.6 0 0 21.6 0 48v416c0 26.4 21.6 48 48 48h416c26.4 0 48-21.6 48-48V48c0-26.4-21.6-48-48-48zM192 416h-64V192h64v224zm-32-256c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm256 256h-64V288c0-17.7-14.3-32-32-32s-32 14.3-32 32v128h-64V192h64v39.7c13.2-18.1 33.4-39.7 56-39.7 39.8 0 72 35.8 72 80v144z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M15 2v12c0 .6-.5 1-1 1H2c-.6 0-1-.5-1-1V2c0-.6.5-1 1-1h12c.5 0 1 .5 1 1zM5.1 6.4h-2V13h2.1V6.4zm.2-2.3c0-.7-.5-1.2-1.2-1.2s-1.2.5-1.2 1.2.5 1.2 1.2 1.2c.6 0 1.2-.5 1.2-1.2zm7.6 4.8c0-2-1.3-2.8-2.5-2.8-.8 0-1.6.4-2.1 1.1v-.8H6.4V13h2.1V9.4C8.3 8.7 8.9 8 9.6 8h.1c.7 0 1.1.4 1.1 1.4v3.5h2.1v-4z"/></g></svg>
</f:section>
<f:section name="Rss">
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><circle cx="70.22" cy="441.78" r="70.22"/><path d="M339.38 512h-99.47C239.91 379.5 132.5 272.09 0 272.09v-99.47c187.44 0 339.38 151.94 339.38 339.38z"/><path d="M409.6 512c0-226.22-183.38-409.6-409.6-409.6V0c282.77 0 512 229.23 512 512H409.6z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M2 4c5.514 0 10 4.486 10 10h2C14 7.372 8.628 2 2 2v2z"/><path d="M2 8c3.308 0 6 2.692 6 6h2a8 8 0 0 0-8-8v2zM3.5 14a1.5 1.5 0 0 1 0-3 1.5 1.5 0 0 1 0 3z"/></g></svg>
</f:section>
<f:section name="Twitter">
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M512 97.2c-18.8 8.4-39.1 14-60.3 16.5 21.7-13 38.3-33.6 46.2-58.1-20.3 12-42.8 20.8-66.7 25.5C412 60.7 384.7 48 354.5 48c-58 0-105 47-105 105 0 8.2.9 16.2 2.7 23.9-87.3-4.4-164.7-46.2-216.5-109.8-9 15.5-14.2 33.6-14.2 52.8 0 36.4 18.5 68.6 46.7 87.4-17.2-.5-33.4-5.3-47.6-13.1v1.3c0 50.9 36.2 93.4 84.3 103-8.8 2.4-18.1 3.7-27.7 3.7-6.8 0-13.3-.7-19.8-1.9 13.4 41.7 52.2 72.1 98.1 73-36 28.2-81.2 45-130.5 45-8.5 0-16.8-.5-25.1-1.5C46.6 446.7 101.8 464 161.1 464c193.2 0 298.8-160.1 298.8-298.8 0-4.6-.1-9.1-.3-13.6 20.5-14.8 38.3-33.3 52.4-54.4z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M5.4 13.7c5.3 0 8.2-4.4 8.2-8.2v-.4c.6-.4 1-.9 1.4-1.5-.5.2-1.1.4-1.6.5.6-.4 1-.9 1.3-1.6-.6.3-1.2.6-1.8.7-.5-.6-1.3-.9-2.1-.9-1.6 0-2.9 1.3-2.9 2.9 0 .2 0 .4.1.7-2.5-.2-4.6-1.3-6-3.1-.3.5-.4 1-.4 1.5 0 1 .5 1.9 1.3 2.4-.5 0-.9-.1-1.3-.4 0 1.4 1 2.6 2.3 2.8-.3.1-.5.2-.8.2-.2 0-.4 0-.5-.1.4 1.1 1.4 2 2.7 2-1 .8-2.2 1.2-3.6 1.2H1c1.3.8 2.8 1.3 4.4 1.3"/></g></svg>
</f:section>
<f:section name="Instagram">
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M8 2.261c1.869 0 2.09.007 2.829.041.682.031 1.053.145 1.3.241.327.127.56.279.805.524s.397.478.524.805c.096.247.21.617.241 1.3.033.738.04.959.04 2.828s-.007 2.09-.041 2.829c-.031.682-.145 1.053-.241 1.3-.127.327-.279.56-.524.805a2.168 2.168 0 0 1-.805.524c-.247.096-.617.21-1.3.241-.737.033-.959.04-2.828.04s-2.091-.007-2.829-.041c-.682-.031-1.053-.145-1.3-.241a2.168 2.168 0 0 1-.805-.524 2.168 2.168 0 0 1-.524-.805c-.096-.247-.21-.617-.241-1.3-.033-.738-.04-.959-.04-2.828s.007-2.09.041-2.829c.031-.682.145-1.053.241-1.3.127-.327.279-.56.524-.805.245-.244.478-.396.805-.523.247-.096.617-.21 1.3-.241.738-.034.959-.041 2.828-.041M8 1c-1.901 0-2.139.008-2.886.042-.745.034-1.254.152-1.699.325-.46.179-.851.418-1.24.807-.389.389-.629.78-.807 1.24-.174.446-.292.955-.326 1.7C1.008 5.861 1 6.099 1 8c0 1.901.008 2.139.042 2.886.034.745.152 1.254.325 1.699.179.46.418.851.807 1.24.389.389.78.629 1.24.807.445.173.954.291 1.699.325.748.035.986.043 2.887.043s2.139-.008 2.886-.042c.745-.034 1.254-.152 1.699-.325.46-.179.851-.418 1.24-.807.389-.389.629-.78.807-1.24.173-.445.291-.954.325-1.699.035-.748.043-.986.043-2.887s-.008-2.139-.042-2.886c-.034-.745-.152-1.254-.325-1.699a3.435 3.435 0 0 0-.807-1.24 3.422 3.422 0 0 0-1.24-.807c-.445-.173-.954-.291-1.699-.325C10.139 1.008 9.901 1 8 1z"/><path d="M8 4.405a3.596 3.596 0 1 0 .001 7.191A3.596 3.596 0 0 0 8 4.405zm0 5.928a2.333 2.333 0 1 1 0-4.666 2.333 2.333 0 0 1 0 4.666z"/><circle cx="11.737" cy="4.263" r=".84"/></g></svg>
</f:section>
<f:section name="Website">
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256 256-114.6 256-256S397.4 0 256 0zm221 256c0 19.3-2.5 38.2-7.3 56.5h-88.9c2-18.2 3.1-37.1 3.1-56.5 0-20.1-1.2-39.7-3.4-58.5H469c5.4 18.9 8 38.5 8 58.5zM256 477c-19.7 0-41.8-20.8-59.2-55.6-10.4-20.8-18.7-45.4-24.5-73-.1-.3-.1-.6-.2-.9h167.8c-.1.3-.1.6-.2.9-5.8 27.6-14.1 52.1-24.5 73-17.4 34.8-39.5 55.6-59.2 55.6zm-89.6-164.5c-2.2-18.3-3.4-37.2-3.4-56.5 0-20 1.2-39.5 3.6-58.5h178.8c2.4 19 3.6 38.5 3.6 58.5 0 19.3-1.1 38.2-3.4 56.5H166.4zm-124.1 0C37.5 294.2 35 275.3 35 256c0-20 2.6-39.6 7.8-58.5h88.5c-2.2 18.8-3.4 38.4-3.4 58.5 0 19.4 1.1 38.3 3.1 56.5H42.3zM256 35c19.7 0 41.8 20.8 59.2 55.6 10.3 20.6 18.4 44.7 24.3 71.9h-167c5.8-27.1 14-51.3 24.3-71.9C214.2 55.8 236.3 35 256 35zm156.3 64.7c18.4 18.4 33.1 39.5 44 62.8h-81.1c-9.1-46.3-24.7-86-44.6-114.6 3.9 1.4 7.7 2.9 11.5 4.5 26.2 11.1 49.9 27 70.2 47.3zm-312.6 0c20.3-20.3 44-36.2 70.3-47.3 3.8-1.6 7.6-3.1 11.5-4.5-19.9 28.6-35.6 68.3-44.6 114.6H55.7c10.9-23.3 25.7-44.4 44-62.8zm0 312.6c-18.9-18.9-34-40.7-45-64.8h81.7c9 47.2 24.8 87.6 45 116.6-3.9-1.4-7.7-2.9-11.5-4.5-26.2-11.1-49.9-27-70.2-47.3zm312.6 0c-20.3 20.3-43.9 36.2-70.3 47.4-3.8 1.6-7.6 3.1-11.5 4.5 20.2-29 36-69.4 45-116.6h81.7c-10.9 24-26 45.8-44.9 64.7z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7zm5.2 4h-2.5c-.2-1.1-.6-2.1-1-2.7 1.5.4 2.7 1.4 3.5 2.7zM10 8c0 .7-.1 1.4-.1 2H6.1c0-.6-.1-1.3-.1-2s.1-1.4.1-2h3.7c.1.6.2 1.3.2 2zm-2 6c-.5 0-1.2-1.1-1.7-3h3.3c-.4 1.9-1.1 3-1.6 3zM6.3 5C6.8 3.1 7.5 2 8 2s1.2 1.1 1.7 3H6.3zm0-2.7c-.4.6-.8 1.6-1 2.7H2.8c.8-1.3 2-2.3 3.5-2.7zM2.4 6h2.8C5 6.6 5 7.3 5 8s0 1.4.1 2H2.4C2.1 9.4 2 8.7 2 8s.1-1.4.4-2zm.4 5h2.5c.2 1.1.6 2.1 1 2.7-1.5-.4-2.7-1.4-3.5-2.7zm6.9 2.7c.4-.7.8-1.6 1-2.7h2.5c-.8 1.3-2 2.3-3.5 2.7zm3.9-3.7h-2.8c.2-.6.2-1.3.2-2s0-1.4-.1-2h2.8c.2.6.3 1.3.3 2s-.1 1.4-.4 2z"/></g></svg>
</f:section>
<f:section name="Xing">
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M77.8 101.1c-4.4 0-8.2 1.6-10.1 4.6-1.9 3.2-1.6 7.2.4 11.3l49.9 86.4c.1.2.1.3 0 .4L39.6 342.3c-2 4.1-1.9 8.2 0 11.3 1.9 3 5.2 5 9.6 5H123c11 0 16.4-7.5 20.1-14.3 0 0 76.7-135.7 79.7-141-.3-.5-50.8-88.5-50.8-88.5-3.7-6.5-9.2-13.8-20.6-13.8l-73.6.1zM388 0c-11 0-15.8 6.9-19.8 14.1 0 0-159.1 282-164.3 291.3.3.5 104.9 192.5 104.9 192.5 3.7 6.5 9.3 14.1 20.6 14.1h73.8c4.4 0 7.9-1.7 9.8-4.7 2-3.2 1.9-7.3-.2-11.4l-104-190.3c-.1-.2-.1-.3 0-.5l163.5-289c2-4.1 2.1-8.2.2-11.4-1.9-3-5.4-4.7-9.8-4.7H388z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" aria-hidden="true" role="img" focusable="false"><g fill="currentColor"><path d="M7.084 6.561c-.056.103-.787 1.387-2.19 3.859-.153.259-.337.391-.553.391H2.307c-.241 0-.378-.234-.266-.45l2.156-3.79c.006 0 .006-.003 0-.009L2.826 4.199c-.135-.243.009-.44.265-.44h2.034c.228 0 .416.128.562.381l1.397 2.421zm6.871-5.12L9.456 9.345v.009l2.862 5.205c.121.222.006.441-.266.441h-2.037c-.237 0-.425-.125-.562-.381L6.566 9.354l4.524-7.973c.143-.253.324-.381.546-.381h2.053c.25 0 .384.209.266.441z"/></g></svg>
</f:section>
8 changes: 8 additions & 0 deletions Resources/Private/Partials/Post/Author.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
<span class="postauthor__sociallinklabel"><f:translate key="author.social.twitter" /></span>
</a>
</f:if>
<f:if condition="{author.instagram}">
<a href="{author.instagram}" class="postauthor__sociallink postauthor__sociallink--instagram" target="_blank" itemprop="url">
<span class="postauthor__sociallinkicon postauthor__sociallinkicon--instagram">
<span class="blogicon"><f:render partial="General/SocialIcons" section="Instagram" optional="true" /></span>
</span>
<span class="postauthor__sociallinklabel"><f:translate key="author.social.instagram" /></span>
</a>
</f:if>
<f:if condition="{author.linkedin}">
<a href="{author.linkedin}" class="postauthor__sociallink postauthor__sociallink--linkedin" target="_blank" itemprop="url">
<span class="postauthor__sociallinkicon postauthor__sociallinkicon--linkedin">
Expand Down
1 change: 1 addition & 0 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ CREATE TABLE tx_blog_domain_model_author (
twitter varchar(255) DEFAULT '' NOT NULL,
linkedin varchar(255) DEFAULT '' NOT NULL,
xing varchar(255) DEFAULT '' NOT NULL,
instagram varchar(255) DEFAULT '' NOT NULL,
profile varchar(255) DEFAULT '' NOT NULL,

bio text,
Expand Down

0 comments on commit 00feddf

Please sign in to comment.