List all "incoming" internal links / references to a TYPO3 element - typo3

I need to get a list of elements linking to a specific TYPO3 page or element (all IDs oder pages, that link or refer to a this element). I thought this was at the Info module, but I can't find it.
I have spent hours finding this info on the web and even in my oldschool TYPO3 manual book... nothing, but I know that I once had this list.
Thanks a lot in advance! (version is TYPO3 4.6, I am preparing an upgrade right now)

You could search your database manually to find such links. I will start to give you a list where you could search for.
Find tt_content headers which link to a page, element or any url:
SELECT * FROM tt_content WHERE header_link NOT LIKE '' AND deleted = 0;
In RTE fields, you could manually check.
Go to backend modul 'Configuration', choose '$TCA (Tabel configuration array)' and search for 'RTE'.
Then you schould get all RTE fields, which could have links set to any TYPO3 pages or elements.
Like fx: tt_content.bodytext.config.wizards.RTE...
These fields you could search for any links vis MySQL
SELECT * FROM tt_content WHERE bodytext LIKE '%<link%' OR bodytext LIKE '%<LINK%' AND deleted = 0;
Maybe someone can add more default fields not listed above.

I think you have seen the references of a record normaly seen in the list module.
If you hover your mouse over the count you get a list of origins.
That list is not always up to date and the usability of the origins differs from version to version. Sometimes you can use the origins as direct link to edit the origin record.
Maybe you had an extension which enhances the usage.
In gerneral: if records are used with TYPO3 (TCA group fields which build relations to other records with uid-lists, or mm-records) this is also stored as refrence.
As links are also relations they are not always stored as referenes, espeacially if the link is inside a textfield.

Related

TYPO3 find tt_content from pages

I'm using TYPO3 10.4.14
I believe, that I understood the relationship of pages and tt_content. But I have not figured out, how to get the tt_content elements and the order from the table pages.
From tt_content it is easy to get the page, but not from pages to tt_content.
What I finally want to do, is to mark a page (additional column), for display the beginning of the page in an overview.
For that I need the content elements of a page!
Edit:
I want to do t with database query.
One possible way would to use the uid of pages and go to the tt_content and search there for the pid. But this is a long winded way.
How is TYPO3 it doing, when display the pages?
you have multiple ways to render any output (typical HTML):
typoscript
PHP
FLUID
(in the end all is PHP, but regarding what you are programming or configuring)
If you want to render some regular content of the current page you will use the defined typoscript styles.content.get (with modifications), which is a TypoScript CONTENT object. This will do a query to get those tt_content records which belong to the current page in the default (or other) column. This results in a query like SELECT * FROM tt_content WHERE pid = current_page_uid AND column = 0 (and some additional conditions regarding visibility (hidden, starttime, endtime, workspace, ...)
This could be assigned to a FLUID variable or requested by a viewhelper (f:cObject).
If you want to get content from another than the current page you need to do a similar request and use another page uid. Either you build your own CONTENT object and use it like the default content. Or you build an own viewhelper in PHP which you can use in FLUID. You can modify the query by reducing the number of records you consider, you also can modify the rendering regarding which fields will be shown in what HTML markup.
Depending on the package you use it may contain already specialized viewhelper which gets you the content of other pages and/or other columns.
I think you want to build teasers for other pages with the content of that pages.
Consider to use a special field in the pages record which contains a clean summary for the page content. Not each page has relevant or recognizable information in the first paragraph.
It's the same as for search engines: if you provide search engines with a summary, that will be shown at the search results and the searcher can better decide if this page is relevant for him.

TYPO3 Extension ke_search, results from news and tt_content

I try to config extension ke_search. I created Indexer Configuration for tx_news, pages and tt_content.
For Page Indexer, in area "Content element types which should be indexed" I wrote "text,textmedia,textpic,bullets,table,html,header,uploads,tx_news,news,gridelements_pi1"
When I Start Indexer I get result for indexing for page, news and content. So I think thats all good.
But when I search any word from news or tt_content, in the fornt-end, I have no result. If I search page - I have result.
Ensure you set pid in "Record storage page of search data" in News indexing record. It seems to 4 news was indexed successful, so this may be a reason it doesn't find it later.
You don't have to set "tx_news,news," in Page indexing. These content types doesn't contain anything valuable to index, it's only plugin instance, so it will index things like header of that plugin element. But no news records, for that you use your News indexing config.
Check backend module Faceted search -> droplist option Indexed content. Select your Search Storage and investigate what's indexed for Type: news, does the field Abstract / Content contains anything? Are the pids correct?

Display only local categories or tree view in TYPO3 news creation

I have a TYPO3 v7.6.18 multi-site system with tt_news plugin for news.
Each site has its own news section with different categories like:
I would like to be able to choose from these categories, when creating a news item, but in the Categories&Relations (I have hidden the Relations tab, since I don't use it), I get the whole list of categories from almost all the projects (probably all, there is just a limit on how many it shows):
How can I set it to show only the categories for current page (or least a tree view, where I can see, where the categories belong to), because currently it's impossible to tell, what category belongs to which project (since the names overlap).
You can use TCA overrides to customize the foreign_table_where configuration option of the categories field in the tx_news_domain_model_news table:
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['categories']['config']['foreign_table_where'] = ' AND sys_category.pid = ###CURRENT_PID###' . $GLOBALS['TCA']['tx_news_domain_model_news']['columns']['categories']['config']['foreign_table_where'];
Notice that you need to prepend your additional constraint because the existing constraint ends with a ORDER BY.

Manual sorting of sys_category

On my TYPO3 7 site, i'm not able to choose an order to the categories of a page or a news (plugin tx_news). I can only choose what categories that page or news have, using the checkboxes to select them.
Is there any configuration for that?
Alternatively, I may override these fields with my own TCA, but have no ideas on how to get a sorting tree of categories. Any hint?
On my sites running previous TYPO3 versions with tt_news plugin, its category tree allows to change the sorting after selecting the categories.
I coudn't find anything about it on the "select" documentation (https://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html). Looks like MM relations doesn't support sorting.
Does anyone knows how to get it?
Make sure you have the "extended view" checked at the end of the page. You can then sort the sys_category-entries using the up/down arrows.
If you need to sort your categories per item and not globally then a default MM relation will not work as it doesn't support sorting. You're on the right track. Override or extend the TCA, don't specify a MM relation and don't use the tree view rendering. Use a standard select like you would select pages. This should store the values as a comma-list string in the database and so represent the sorting like you would see it the backend.

TYPO3 tt_content structure: t3_origuid vs l18n_parent

I had to import a few posts from one TYPO3 site into another, which lead into some exploring of the DB structure. A specific question arose:
In localised content elements (tt_content entries with sys_language_uid = 1), the fields t3_origuid and l18n_parent are redundantly filled. l18n_parent is required for the backend localisation view to work.
Do they always have the same value? Or is there a use case where the values of the fields can differ?
l10n_parent / l18n_parent
The field configured in TCA as transOrigPointerField (usually l10n_parent or l18n_parent) is used for localization.
It always contains an id of the record in the default language (even if the record was translated from a record in non-default language), see https://docs.typo3.org/typo3cms/TCAReference/singlehtml/#transorigpointerfield
t3_origuid
The field configured in TCA as origUid (usually t3_origuid) is filled when record is copied or translated, and contains an id of the source record, see https://docs.typo3.org/typo3cms/TCAReference/singlehtml/#origuid
The fields will have the same value in some cases (e.g. translating a record from default language), but in other will have different value. E.g. when copying a record on the same page t3_origuid will be different than the l10n_parent.
To allow localization it is required to have transOrigPointerField (l10n_parent). Having origUid (t3_origuid) field is not hard requirement but a good practice as as some additional features may require it to work. Especially in newer versions of TYPO3. For example the Translation Wizard is currently using t3_origuid field.
l10n_source (since TYPO3 8.6)
Since TYPO3 8.6 a new database field l10n_source for tt_content table has been introduced together with a new TCA ctrl configuration translationSource. The translationSource field contains an uid of the record used as a translation source, no matter whether the record was translated in the free or connected mode.
see more in the documentation on l10n_source field
Those fields can have different values.
t3_origuid is a generic field pointing to a record from which the current one was derived in some way. For example by copying or localizing it. Here is some documentation for it.
The field l18n_parent is reserved for localization purposes.
Just as a addition to Jost's post:
To determine which field you should use check the value of:
$TCA['tx_yourtable']['ctrl']['transOrigPointerField']
ie. for tt_content it's:
$TCA['tt_content']['ctrl']['transOrigPointerField'] = 'l18n_parent';