Closed mciszczon closed 6 years ago
As I understand this, that part of code shouldn't even run as I have got pages for the content-viewer plugin created.
Are you sure that you can negate site()->index()->findBy('intendedTemplate', 'content-viewer')
? Because I changed the if
to:
if(!site()->findBy('intendedTemplate', 'content-viewer')) {
And multilang works fine.
Uh-oh, that's strange. The reason why I have site()->index()
is because findBy()
only searches the root level otherwise. Unfortunately, I don't have time to look into this right now, but I'll put it near the top of my priority list.
So, I just released a hotfix for this problem by using your code. However, this change does mean that the content-viewer page must be in the root level of the content folder. This is probably not a big problem, as that is where the plugin stores it by default, but it would be nice to allow people to move it into another directory of they so desire without breaking the plugin.
Hence, I'll leave this issue open for now.
I may play a little bit with the original code to see what was happening. Maybe I'll find the reason for this. Will let you know if I do.
Gonna go ahead and close this issue, as no-one has said that having the content file for the plugin anywhere besides the root content folder is something important to them.
While developing a site I installed many plugins and additional fields and so on. At some point I noticed my multilang site was not working properly.
Changing language was not working. I could change the language, the page was redirected (
example.com/en
), all the language variables were changed (for example$site->language()
is changed correctly) and it was fine, but snippets fetching pages' content still fetched the default language content.I finally found out it was caused by your plugin, this part:
Not really sure how this affects multilang config, but it surely does. Just commenting this part and it works again.