typo3typo3-8.7.x

Typo3: No template was found. View could not be resolved for action "list"


When I click on my module on the left I get this error message:

Sorry, the requested view was not found.

The technical reason is:

No template was found. View could not be resolved for action "list" in class "TYPO3\ShopExtension\Controller\ShopBackendController".

I have seen similar questions being asked here and I have tried all of their solutions, without success. For example:

TYPO3: No template was found. View could not be resolved for action

I set the root paths for the templates, partials and layouts, in the constants.ts file in configuration directory as follows:

module.tx_shopextension {
        view {
        templateRootPath = EXT:shop_extension/Resources/Private/Backend/Templates/

        partialRootPath = EXT:shop_extension/Resources/Private/Backend/Partials/

        layoutRootPath = EXT:shop_extension/Resources/Private/Backend/Layouts/
     }
        persistence {
            # cat=module.tx_shopextension//a; type=string; label=Default storage PID
            storagePid =
        }
    }

And use them in setup.ts like this:

# Module configuration
module.tx_shopextension {
    view {
        templateRootPath = {$module.tx_shopextension.view.templateRootPath}
        partialRootPath = {$module.tx_shopextension.view.partialRootPath}
        layoutRootPath = {$module.tx_shopextension.view.layoutRootPath}
    }
  persistence {
    storagePid = {$module.tx_shopextension.persistence.storagePid}
  }
} 

The templates are stored in:

Resources/Private/Backend/Templates/

(same structur for Partials and Layouts)

In the Resources/Private/Backend/Templates/ directory is a directory ShopBackend corresponding to the ShopBackendController, containing the List.html file.

I can't figure out why the error keeps popping up.


Solution

  • The problem is, you're using the old way for defining rootpath. Please use the rootpath as array, like

     module.tx_shopextension.view.templateRootPaths.10 = EXT/shop_extension/Resources/Private/Backend/Templates/