first of all sry for my bad English. I’m from Germany and started working with Neos since a few weeks.
At the Moment I’m working on a Onepage-Site for a good Friend.
Now I want to render a Navigation with different Icons for each Navigation-Point. The Problem is that I have no idea how to do that. I tried to add the Media-Viewhelper but I just get an Error.
The media viewhelper is for a Typo3.Media asset instance. If you want to render an icon which is placed in your Resources/Public folder use the uri viewhelper.
First thanks for the fast answer. This is for a fixed Icon but i want to set the Icon as an image in the backend in the settings from the Page. Is this possible?
When you look into the Package there is a Section-Element and for every Section i am rendering an Navigation-Point. So I want to set the Icon in the Settings of the Section-Element and load it in the Navigation.
If I try to use the Image in the Template I get this Error:
Catchable Fatal Error: Argument 1 passed to TYPO3\Media\Domain\Service\AssetService_Original::getThumbnailUriAndSizeForAsset() must implement interface TYPO3\Media\Domain\Model\AssetInterface, null given,…
Now I got only one question left. Neos is rendering a lot of Tag’s in the Frontend which I don’t need. To keep the code clean I want to remove them. I found one Solution for Neos 1.x but not for 2.x. Can someone help me with this Problem?
Hey @DavidLang,
it depends on the tags. Basicaly you can do that. Just check the core prototypes and it’s attributes and @processor stuff. You can override those and fit them to your needs
Hey, I found the “ContentElementWrappingService” Class. I’m still learning php but is it right that here the Neos-Tags like “neos-contentcollection” are generated? If this true, is it enough to extend this class with something like: “Just do it when you are in the Backend”?
Thanks for the Answer, this will remove the Classes from the Wraps of the ContentElements and ContentCollections but I still got the Wraps for Example:
<div><--Want to remove this Wrap
<div>
<p>
Text Text Text
</p>
</div>
</div>
and I want to remove the DIV-Wraps completely but just in the Frontend. Is this possible for the ContentElements?
EDIT:
Don’t know if this is right or not but it is working for the ContentCollection:
prototype(TYPO3.Neos:ContentCollection) >
prototype(TYPO3.Neos:ContentCollection) < prototype(TYPO3.Neos:ContentCollectionRenderer){
@context.node = ${Neos.Node.nearestContentCollection(node, this.nodePath)}
content = TYPO3.Neos:ContentCollectionRenderer
# We have to define contentElementWrapping, because we do not inherit from TYPO3.Neos:Content
@process.contentElementWrapping = TYPO3.Neos:ContentElementWrapping
@cache {
mode = 'cached'
entryIdentifier {
collection = ${node}
}
entryTags {
1 = ${'DescendantOf_' + node.identifier}
2 = ${'Node_' + node.identifier}
}
maximumLifetime = ${q(node).context({'invisibleContentShown': true}).children().cacheLifetime()}
}
@exceptionHandler = 'TYPO3\\Neos\\TypoScript\\ExceptionHandlers\\NodeWrappingHandler'
}