-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make luya\cms\Menu throw 404 instead of adding _currentAppendix #51
Comments
Hi @pivans thanks for the report, seems to be a bug. Of course it should throw a 404. |
I just did a little research on this issue. The "problem" is that you may have a module on this page, which can have urls. So i could make an option to configure "strict parsing". For example this page has a module: https://demo.luya.io/en/article A click on the article detail allows you to stay on the same page: https://demo.luya.io/en/articles/2/its-just-a-module - therefore all "sub paths" are like wildcard which are allowed. |
Where should this option appear? Its a config in cms module? For example: 'cms' => [
'class' => 'luya\cms\frontend\Module',
'strictUrlParsing' => true,
] |
Yes, that would be nice. |
I was just thinking about this again, maybe its bad to configure this in configs, maybe a block should have an flag which can be triggered if NOT strict url parsing is required, for example the module block would implement: public function requireUrlWildcard()
{
return true;
} (all other block which does not need this kind of wildcard urls would return false) If this is the case (return true), the strict url parsing is automatically disabled for this page. |
That is, using the requireUrlWildcard method it will be possible to override more flexibly: not only for the luya\cms\frontend\Module, but also for other modules? Do I understand correctly? |
I was more thinking about blocks. Because the module block is the only situation where "url wildcard" behavior is required. |
@nadar do you talk about the cms block ? Or do you talk about a module class (http://i.prntscr.com/ViSlIWLyTUmkebHvbl9ntg.png) ? |
Yes CMS Blocks. Because CMS Blocks are the only situation which need url wildcards but only when the luya cms module block integrates modules.https://github.com/luyadev/luya-module-cms/blob/master/src/frontend/blocks/ModuleBlock.php |
I think it will be good. I would like to try this solution. |
This is also a problem for cms redirects - in order to make a redirect from an existing subpage node this is not possible. example: /de/foobar <= this page exists now its not possible to make a redirect trough redirects table from |
URL Wildcard paths are now only valid if the parent page is a module or strict parsing is disabled. Therfore this is a breaking change. When a page contains the module block (not a page which is a module) and the module block can create and follow urls the strict parsing option must disabled in the nav item setting panel. |
On a request like "/demo-content/disjo" I suppose to get 404, instead of "demo-content" page.
https://demo.luya.io/en/demo-content/disjo
How can I configure this?
The text was updated successfully, but these errors were encountered: