Feature #53639
Multiple or recursive "Alternative Source Page"
0%
Description
At first let me thank you for this extension. Unfortunataly I cannot use it like it is, because I would have to write several hundred configurations.
Here's the reason:
I have a news-folder with a lot of subfolders, one for each news-editor-group. So I can set the correct userrights and use the mainfolder as a database mount for the parent group of the news-editor-groups.
I have also a bunch of categories, from which each news-editor can only use a specific subset of.
I have 20 websites, accessing the news-mainfolder recursive, making different category selections.
So, if I'd have 20 news-subfolders and 20 websites I would have to create 400 configurations for indexedsearch_ttnews_crawler.
If I could make a choice of multiple "Alternative Source Page(s)". this would be reduced to 20. But I would be enforced to add all 20 news-subfolters in all 20 configurations.
The better way would be to add a recursive-level like it is done in tt_news. I can also imagine to offer both options (like pid_list and recursive in tt_news).
Let me know about your opinion. If you need help, let me know. I would join the project because it's important for me and I think that this feature makes sense.
Greetings
Harald
Updated by Simon Schick about 7 years ago
- Status changed from New to Needs Feedback
- Assignee changed from Simon Schick to Harald Witt
Hi, Harald
Would be nice to get you in here. Feel free to create a diff that includes the changes you need. I can't really get what you mean in detail, but I think I'd get it easier if it's written as code, or if you have a sample on-hand.
What exactly are you trying to make recursive?
Is it impossible for you to do all this using just one news-folder? Maybe I'm to naive here, but I haven't had the case, where I'd need multiple news-folders ...
Updated by Harald Witt about 7 years ago
Hi Simon
sorry for the dalay. I was absent for some time.
No, your surely not naive. You simply didn't need this feature till now. So let me explain again.
1. Multiple news folders
In some cases you need to use multiple news folders, for instance if they should have different access rights. Therefore tt_news has a constant called "pid_list = 1,2,3,...".
2. Recursive folders
To simplify things above you can also create a newsfolder (lets say id=10) with the folders above as subfolders. For this case tt_news offers the the recursive level. Example:
pid_list = 10
recursive = 1
I'd like to introduce these two features in your extension.
I'm not sure how fast it will be. But I'll tell you as soon as possible.
Greetings Harald
Updated by Simon Schick about 7 years ago
Hi, Harald
I won't go the first way. This is a design-choice, made by the core-extension indexed_search. I use a field they added here and I don't want to change that. So, for me, (as long as noone provides a changeset here) this way died out, due to a design-decission from another plugin, I build upon.
The second option would be reasonable, but I am just unsure if this would not slow down the system. What are your thoughts here on that?
Still can't see the limit in restrictions here, when using just a single folder, because you can allow users to manage categories and can deny the listing-view for them. This way, they can just access the news, that are in the categories, they are allowed to edit, and you still have one folder the news are managed in.
Updated by Harald Witt about 7 years ago
Hi Simon,
oh, beware of changing core things. I know that you are using this field and it was not my intension to change anything at this point.
pid_list MUST be an separate database field like "news_categoryselection" is. And then there is a decision to make, which has preference if both are set, "alternative_source_pid" or "pid_list".
The difference is simply the where-clause in the sql-statement. Instead using 'where pid=alternative_source_pid' we then use 'where pid in ('.$pid_list.')'.
So we could do the following (simplyfied):
if (empty($pid_list)) $pid_list = $alternative_source_pid; if (empty($pid_list)) $pid_list = $current_page_id; $GLOBALS['TYPO3_DB']->exec_SELECTquery(... $where='pid in ('.$pid_list.')' ...);
Working with recursive levels won't slow down the system. We just need a database field "news_recursive" where the level is stored.
In addition to the method mentioned above, we have to create the real pid_list from the stored pid_list and the recursive level by calling "pi_getPidList()" (simplyfied):
if (empty($pid_list)) $pid_list = $alternative_source_pid; if (empty($pid_list)) $pid_list = $current_page_id; // this is a member function of the class tslib_pibase $pid_list = $this->pi_getPidList($pid_list,$recursive); $GLOBALS['TYPO3_DB']->exec_SELECTquery(... $where='pid in ('.$pid_list.')' ...);
That's all IMHO.
Greetings
Harald
Updated by Simon Schick about 7 years ago
- Status changed from Needs Feedback to Accepted
- Assignee deleted (
Harald Witt)
The code is a bit more complicated than that. You can actually index a document in two different ways:
- By a cronjob
- On update/create
Not sure if you thought of implementing it for both :)
Feel free to take a look at the code and attach a patch to the issue here. I have to leave this opened to someone to fix it, because I myself run out of time.
Would be glad to add you to the team, just ping me if you're interested in.
Updated by Harald Witt about 7 years ago
Hi Simon,
feel free to add me to the team. We all run out of time but in the next weeks I'll have a deep view in your existing code.
Greetings
Harald