DieSchittigs / contao-content-api-bundle

Contao JSON-API
MIT License
41 stars 9 forks source link

Problem with /api/page?url=xxxx.html where templates are enabled #18

Open Steffen-MLR opened 4 years ago

Steffen-MLR commented 4 years ago

hi,

i am trying to use your api, I installed it an the /api/sitemap does work.

When I try to browse to my.site.com/api/page?url=xxxx.html, I just get "an error occured" from contao. Log shows the following: app.CRITICAL: An exception occurred. {"exception":"[object] (Exception(code: 0): Could not find template \"rsce_tao_centered_wrapper_start\" at (...)/vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateLoader.php:153)"} []

So, what I thought, maybe the "rsce_tao_centered_wrapper_start"-Template is someway defect, so I uninstalled it and tried again.

this Time I got: app.CRITICAL: An exception occurred. {"exception":"[object] (Exception(code: 0): Could not find template \"rsce_tao_boxes\" at (...)/vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateLoader.php:153)"} []

This is the same error, with a different template. I cant remove all my Templates, I need them for the Website.

This got me thinking, is it possible to tell the api, that it should let all modules load before trying to get the content of the site? Is this a known error or do I just user the api in a wrong way?

What I want to achive is, to get the Content of the site xxxx.html as json via the api. Lokking forward for your reactions, stay safe!

lautschrift commented 4 years ago

I got the same error. I could fix it, in my case, by inserting my templates into the Contao-Template root directory.