0
votes

I have problem with changing template for eventnews month view. I already copy the template EXT:eventnews/Resources/Private/Templates/Month.html into the same directory where the files like List.html or Detail.html are saved. But on site I have error like this:

Sorry, the requested view was not found.

The technical reason is: No template was found. View could not be resolved for action "month" in class "GeorgRinger\News\Controller\NewsController".

But when I paste TypoScript with default template:

plugin.tx_news {
   view {
      templateRootPaths {
             0 = {$plugin.tx_news.view.templateRootPath}
             1 = EXT:eventnews/Resources/Private/Templates/
      }
   }
}

everything works fine...

Where is the problem?

Here is my configuration:

  • TYPO3 7.6.16
  • tx_news 6.0.0
  • eventnews 2.0.1
  • PHP: 7.0.7
4
As far as I can see the file is in EXT:eventnews/Resources/Private/Templates/News/Month.html Be sure to replicate this exact structure. Where did you copy that? What is the value of the constant $plugin.tx_news.view.templateRootPath?Riccardo De Contardi
the constant value is: templateRootPath = fileadmin/new-site/ext/news/Templates/Adrian

4 Answers

0
votes

If you want to overwrite the Template EXT:eventnews/Resources/Private/Templates/Month.html, you have to copy the file into a separate location (e.g. into an own extension) and add an additional path to templateRootPaths with a higher number than the existing paths:

plugin.tx_news {
   view {
      templateRootPaths {
             20 = EXT:mycustomext/Resources/Private/Templates/
      }
   }
}

That way typo3 is going to look into that location first, before testing the others.

Overwriting 0 and 1 might cause issues if you don't overwrite all templates.

0
votes

As Riccardo De Contardi advised, I have reproduced the exact extension structure in my "ext" directory and then overwritten the TS template.

plugin.tx_news {
  view {
      templateRootPaths {
         0 = {$plugin.tx_news.view.templateRootPath}
         1 = fileadmin/ext/eventnews/Resources/Private/Templates/
      }
   }
}

Now everything works fine.

0
votes

if you have set the constant:

plugin.tx_news.view.templateRootPath = fileadmin/new-site/ext/news/Templates/

I would expect that if you put the file in:

fileadmin/new-site/ext/news/Templates/News/Month.html

Everything should work out of the box. Does this work?

0
votes

Updated

add below typoscript in setup for change eventnew template .

plugin.tx_news {
   view {
      templateRootPaths.1 = fileadmin/eventnews/Templates/
   }
}

And After paste on this path( fileadmin/eventnews/Templates/ ) template file.