networkteam / Networkteam.Neos.Shariff

Integrate Shariff, social buttons with privacy into Neos CMS
GNU General Public License v2.0
7 stars 13 forks source link

add a div block outside the shariff block #10

Closed stefkey closed 5 years ago

stefkey commented 8 years ago

Hi,

how can i add an div block around the shariff div? I found no template for your plugin.

When I put the Shariff-PlugIn in the neos backend then it create this frontendcode: <div class="shariff" data-backend-url="null" data-services="["twitter.......

But I need a <div> before: <div><div class="shariff".....

How can I do that?

ger4003 commented 8 years ago

For now you have to render the shariff nodeType in another nodeTypes template. Create a nodeType i.e. Your.Site:ShariffContainer with Typoscript and HTML template:

NodeTypes.ShariffContainer.yaml (Configuration/NodeTypes.ShariffContainer.yaml)

'Your.Site:ShariffContainer':
  superTypes:
    'TYPO3.Neos:Content': true
  ui:
    label: 'Shariff container'
    icon: 'icon-share'

Root.ts2 or ShariffContainer.ts2

prototype(Your.Site:ShariffContainer) {
        shariffTag = Networkteam.Neos.Shariff:Shariff
}

Make sure ShariffContainer.ts2 gets included in your sites Root.ts2 by either

include: NodeTypes/ShariffContainer.ts2

or

include: NodeTypes/*.ts2

ShariffContainer.html (Resources/Private/Templates/NodeTypes/ShariffContainer.html)

<div>
    {shariffTag -> f:format.raw()}
</div>

Now you can add ShariffContainer in Neos backend.