-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
[RTM] allow multi root and multi page search #1462
Conversation
|
Do I understand correctly that child pages of the selected ones are searched automatically? The field description does not mention that, maybe that would be useful? Generally, I like the idea, have you tested whether the search result module also generates absolut links to the potential foreign domains? |
Yes, child pages are searched automatically - as it's already the case in the current implementation when you select a reference page. The current field description doesn't mention it either:
However that field is shared with multiple modules, so the description has to be generic. We can choose a more descriptive one here, since it's its own field. Unless we switch to the
Yes :). This already worked anyway (if you set the reference page to a website root of another domain for example). |
|
I'm pro reusing the |
Same here. Also I don't really think it is a problem if you can order pages. Who cares 😄 |
|
Alright, I'll update the PR accordingly :) |
|
PR updated. I had to use a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work!
| { | ||
| switch ($dc->activeRecord->type) | ||
| { | ||
| case 'search': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessarily complex. Why not the following?
if ($dc->activeRecord && $dc->activeRecord->type == 'search')
{
$GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['mandatory'] = false;
unset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['orderField']);
}BTW, is it really necessary to unset the order field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessarily complex.
True, it's unnecessarily complex. I used the same code as in tl_content::setSingleSrcFlags, in case more different changes would be necessary. I'll change it as suggested.
BTW, is it really necessary to unset the order field?
No, it's only for aesthetics 😁
|
Thank you @fritzmg. |
Description ----------- Follow up PR of contao/core-bundle#1462 Commits ------- 3fc8a54 allow multi-root search 0096fa2 use tl_module.pages
Description ----------- Follow up PR of contao/core-bundle#1462 Commits ------- 3fc8a548 allow multi-root search 0096fa21 use tl_module.pages
These changes allow you to expand/limit the search to multiple pages or website roots. This enables you to:
The changes are fairly simple and straight forward. I tagged it as RFC since I am unsure whether the use of a new field called
searchPagesis really necessary. I decided to not use the existingpagesfield, since the sort order does not matter. Though may be I should simply alter the DCA in aload_callback, similar totl_content::setSingleSrcFlags? Then thepagesfield could be reused for this.