Custom templates
Custom templates can be defined via TypoScript as usual.
# Plugin configuration
plugin.tx_fpsocial {
view {
templateRootPaths {
0 = {$plugin.tx_fpsocial.view.templateRootPath}
1 = EXT:fpsocial_extended/Resources/Private/Templates
}
partialRootPaths {
0 = {$plugin.tx_fpsocial.view.partialRootPath}
1 = EXT:fpsocial_extended/Resources/Private/Partials
}
layoutRootPaths {
0 = {$plugin.tx_fpsocial.view.layoutRootPath}
1 = EXT:fpsocial_extended/Resources/Private/Layouts
}
}
}
Outputting information about the social network
In the partials used to render a post (e. g. Post/,
Post/, Post/ as well as their components under
Post/), the associated account is available as the variable
{account} alongside the post ({post}). This object can be used to
output information about the social network – for example in the footer of a
post (Post/).
The following properties are available on {account}:
| Property | Description |
|---|---|
{account. | Display name of the network, e. g. Facebook, Instagram,
Youtube, Wordpress, Bluesky or Linked. |
{account. | Internal identifier of the network. |
{account. | Font Awesome icon class of the network, e. g. fa-.
Usually used together with the base class fab. |
{account. | Label of the account stored in the backend (e. g. the displayed name of the profile). |
{account. | Identifier of the channel or profile (e. g. the username). |
{account. | Full URL to the profile or channel in the respective network. |
{account. | Ready-made HTML link (<a> tag) to the profile. Since HTML is
returned here, the output must be rendered with <f:. |
{account. | Name of the network-specific partial folder. In the default templates it is also output as a CSS class on the post. |
Example
The following example shows how the footer of a post can be extended with the
name of the network, its icon and a link to the profile (analogous to the
bundled partial Post/):
<div class="socialhint">
<i class="fab fa-fw {account.icon}"></i>
<span>via {account.description}</span>
<f:format.raw>{account.channelLink}</f:format.raw>
</div>
If you would like to build the link yourself instead of using the ready-made
{account., you can access the individual properties:
<a href="{account.channelUri}" target="_blank">@{account.label}</a>