1

I'm trying to use a custom view helper inside a fluid template. I followed the official docs.

I can't get it to work though. I always get the error

The ViewHelper "blog:gravatar>" could not be resolved. Based on your spelling, the system would load the class "MyVendor\ExtKey\ViewHelpers\GravatarViewHelper", however this class does not exist.

I set the namespace in the view helper like this: namespace MyVendor\ExtKey\ViewHelpers; and include it in the fluid template like this: {namespace blog=MyVendor\ExtKey\ViewHelpers} I already tried different paths for the namespace like:

ExtKey\Classes\ViewHelpers

thats were the view helper is located in the file structure. Or even the absolute path.

The file structure looks like this:

extkey--Classes--ViewHelpers--GravatarViewHelper.php

extkey--Resources--Private--Templates--Page--fluidtemplate.html

Is there anything i have to do beforehand, which is not written in the docs?

1 Answer 1

2

The problem was the vendor name "MyVendor" this name can't be freely chosen like i read somewhere in the docs.

I created the extension with the sitepackagebuilder and the vendor name has to be whatever you entered for Company name.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.