Automatically clear cache of the parent page - typo3

In TYPO3 how could I automatically clear the cache of the parent page, when one of its children pages' content is edited?
Let's imagine this page tree:
+ Root
|-+ A
|-+ AA
|-+ AB
I would like the cache of page 'A' automatically cleared, when the content (tt_content table) of page 'AB' is edited. Without using explicit page ids.
As far as documented the Page TSConfig setting
TCEMAIN.clearCacheCmd
only takes a list of explicit page ids, or the keywords "all", "pages", or cache tags
(see https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TceMain.html#clearcachecmd)
None of them lets you generically select the parent of the current page.
How could this be accomplished?

Related

TYPO3: what is the field "access_group" for?

I don't know what is the field "access_group int(11) DEFAULT 0 NOT NULL" for? First I thought it's for restriction by user_group, but there is an field "fe_group varchar(100) DEFAULT '' NOT NULL" for it. You can find the field also at the documentation Preparing the database , but I couldn't find a description for it, only for "fe_group".
access_group is the be_user group.
In TYPO3 you have an access-system similar to the unix-rights, where you can grnat access to pages (and records in the page).
There is a menu entry System->Access where you select a page and can set values for multiple levels recursive:
You can set Owner and Group and the granted rights which are assigned for
Owner, Group, Everybody
the rights are coded bitwise (other order than displayed):
1 (2^0) Show page: Show/Copy page and content.
2 (2^4) Edit content: Change/Add/Delete/Move content.
3 (2^1) Edit page: Change page eg. change pagetitle etc.
4 (2^2) Delete page: Delete/Move page and content.
5 (2^3) New pages: Create new pages under this page.
These values can be set with TCEMAIN in the page TSconfig, so all pages in a sub tree might get the same rights.
Example:
TCEMAIN.permissions {
userid = 43
groupid = 5
user = 31
group = 19
everybody = 1
}
Each page will get the user with the uid 43 as owner,
the group will be the group with the uid 5,
the owner has every right,
the group can show page, edit page, edit content but can not delete page or create new pages below
every one else can see the page
Alternatively you can set the rights by keywords:
TCEMAIN.permissions {
userid = 43
groupid = 5
user = show, edit, delete, new, editcontent
group = show, edit, editcontent
everybody = show
}
comment from Rudy Gnodde, which I agree:
This is only used for pages, not in custom tables for extensions. It's probably a mistake in this documentation. It should be fe_group I think (which is mentioned in this documentation, but not in the code example which contains access_group).
As TYPO3 manuals can be edited by everyone (there is a button Edit me on GitHub in the upper right corner), I have proposed a correction.

wrong content elements in translation of tx_news

TYPO3 8.7, tx_news 7.2 or 7.3.1.
I use tx_news with attached content elements. In default language all work fine, but when i translate the news article i get a single wrong content element in the list of translated content elements, always on first place.
In steps:
- translating news article
- alle depending content elements are correctly translated
- on first place there is a foreign - translated - content element which does not belong to the news but to a total different page in the tree.
- when i translate the next news article the same content element ist now connected to the new translation - and so on.
- when i click on "Synchronize with default language" the wrong content element is deleted! (Which is wrong and should not happen, of course!)
In the database the wrong content element gets for every translation a new entry in the field "tx_news_related_news. It shuffles from news article to news article ... In the end i get an element which is connected with the news entry which was translated last.
When i delete this content element (or click on "Synchronize with default language" which results in the same) a new false content element is used and begin to shuffle from article to article.
Any ideas what`s going on? Or how to fix it?
Peter

indexed_search Multidomain (TYPO3 9 LTS)

There is a multidomain setup (domains next to each other on the same level), each domain has their own search page and configuration. I've tried...
plugin.tx_indexedsearch.settings.rootPidList = 3
...to get the search results limited to the domains pagetree only. But as soon as using rootPidList, there are no results at all any more. Then i've tried...
plugin.tx_indexedsearch.settings.defaultOptions.sections = rl1_3
...and this seems to work correctly to limit the results to the pagetree (below page id 3).
So what is "rootPidList" ment to be used for?
According to the comment in the code (typo3/sysext/indexed_search/Classes/Controller/SearchController.php, Line 232):
Setting the list of root PIDs for the search. Notice, these page IDs MUST have a TypoScript template with root flag on them!
Basically this list is used to select on the "rl0" field and page ids are registered as "rl0" only if a TypoScript template record with root flag is there.
This happens AFTER the use of $this->searchRootPageIdList above because the above will then fetch the menu for the CURRENT site - regardless of this kind of searching here. Thus a general search will lookup in the WHOLE database while a specific section search will take the current sections.
In a multi domain setup we have set rootPidList to the overall root page (in this case id=457).
defaultOptions.sections is set like this:
defaultOptions.sections=rl{$customer_theme.search.level}_{$customer_theme.root}
{$customer_theme.search.level} is set to 1 or 2 depending on the availability of more than one language per country.
{$customer_theme.root} is the root page (marked by the root page flag).
e.g. for Indonesia (english) we use level = 2 and root = 12947.

TYPO3: Dynamically redirect to parent page with typoscript

I'm in the process of building a website using TYPO3 6.2.
I have the following page structure:
- Page Root (id=0)
- Page A (id=1, alias=pagea)
- Content 1 (id=3, alias=content1)
- Detail 1 (id=5, alias=detail1)
- Detail 2 (id=6, alias=detail2)
- Content 2 (id=4, alias=content2)
- Detail 3 (id=7, alias=detail3)
- Page B (id=2, alias=pageb)
- Content 3 (id=4, alias=content3)
I am using realURL, so in order to access page with id = 5, the following URL would be valid: web.site/pagea/content1/detail1
Pages in the second level (eg Page A) inherit the content of its children (eg Content 1, Content 2). So the "Content X" pages should not be individually browseable and instead redirect to their parent (Page X), with the alias as a hashtag. So if one were to open web.site/pagea/content1/, it should redirect to web.site/pagea/#content1
I tried accessing the DB and build my individual redirect URL in the redirect-header, but it doesnt replace the {} queries
[treeLevel = 2]
config >
config.additionalHeaders = HTTP/1.0 301 Permanent Redirect | Location: https://web.site/{levelfield:-2, alias}#{page:alias}
[end]
Anyone got a solution to this?
P.S. Setting the Contnet-pages as a shortcut does not work for me, as it looses the hashtag and requires it to be set for each "Content #"-Page
The data type of config.additionalHeaders is string so trying to access the DB or working with constants inside config.additionalHeaders can't work, unfortunately.
You might find a solution on another layer:
Try to build a regexp in your .htaccess which identifies urls with more than two path segments and rewrite/redirect it to the top-level with an anchor.
As you want to have the same links in your website you might need to use the same replacement as last stdWrap on page generation so every 'normal' deep link is replaced first hand and urls with multiple path segemnts are not known to the world (google) at all.

TYPO3: Get rootline level with page ID in fluid - maybe in viewhelper

i want to get the rootline level from an page with the ID X.
For example: Page2.1 with the ID 233 -> rootline level = 4.
From this point, i want to get the page id from the parent page in the rootlevel 2.
The reason:
I have a multilanguage webpage with many childpages - like this example:
[root]
|- Umbrella Brand-1
|-country1
|-page1[200] -> relation to page1[400]
|-page2[201]
|-page2.1[203] -> relation to page 2.1[233]
|-page3[202]
|-country2
|-page1[230]
|-page2[231]
|-page2.1[233]
|-page3[232]
|- Umbrella Brand-2
|-country1
|-page1[400]
|-page2[401]
|-page2.1[403]
|-page3[402]
|-country2
|-page1[430]
|-page2[231]
|-page2.1[233]
|-page3[232]
I want to build relation between pages in diffrent countrys, maybe it's a about page. With this relations, i build an country select menu. Here is the background, that by an countrychange the same page open, from where i come. For example: page1[200] -country change->page1[400].
I hope that anyone know what i mean.
Sorry for this bad english.
the TSFE will give you the pagelevel, but I sill dont see how this will work.
If your pages are out of sync, you will loose your link.
Don't understand why you would like to build separate 'sites' for each brand? Only reason would be that they have completely separated content, templates etc.
You could use the languages as country / brand selection. nobody said that the swebsite languages need to be used for languages.
for ex: brand1 / country1 would have lang uid 1
This way you can add all your content on 1 site.
If you need different styling / templates, settings then all can be set by the sys_lang_uid.