|
Hi, I'm currently upgrading some old bolt 3.7 websites and i have an issue, i don't understand.
Which seems correct according to the 5.1 docs ?
I don't understand what's wrong here ? I thought of the space in the category name ? but it was made like that and i can't change it now, or it will break the links between articles and categories ? Thanks for your advices |
Replies: 4 comments 4 replies
|
There probably is a previous exception which has some more details on what is actually going wrong. |
|
ok, made a walkthru with chatgpt, in case it can help.. Everything seems fine, but {% setcontent pages = "pages/latest/5" %} or {% setcontent pages = "articles/latest/5" %} gives just NULL whenever the articles / pages are in the DB. |
|
ok i found the source of the problem, i think.. the page called here is a template which is not linked to any content in the DB. So in my routing.yml, i've got this because we had to keep old urls for SEO, and we used this in bolt 3.7 like this I think that's the issue here.. But i don't see how to correct that ! This works in my index.twig : but not in the "page" defined in my routing |
|
ok, it was the routing part the issue. now with this
and this in the template {% setcontent pages = 'articles' where { categories: 'droit-immobilier' } %} no more errors, and results found ! Not sure to understand why it was not working before, as my routing config was really.. close ? identical ? and i had tried the slug instead of the name before.. but.. Anyway, happy |
ok, it was the routing part the issue.
now with this
oldpages: path: /page/{slugOrId} defaults: _controller: Bolt\Controller\Frontend\TemplateController::template templateName: /pages/default.twigand this in the template
{% setcontent pages = 'articles' where { categories: 'droit-immobilier' } %}
no more errors, and results found !
Not sure to understand why it was not working before, as my routing config was really.. close ? identical ? and i had tried the slug instead of the name before.. but.. Anyway, happy