Port Islander
Port Islander

Reputation: 63

TYPO3 TCA/Flexform Link Wizard: How to display page name in the backend?

I created a custom content element using a fluid template for the frontend and a flexform xml file for the backend. The element has a link input field that makes use of the link wizard as explained in this question:

How can i make a Link input Field in TCA

This works fine, but when I select a page from the page tree in the wizard, the input field displays the page ID (for example a "4"). If I use the same (?) wizard within content elements that vanilla TYPO3 provides (for example the "shortcut" page type), the backend shows the name of the page in the link input field, not the ID. Is there an easy way to bring that functionality to my own element?

Remark: In my case, I don't use the PHP array writing style, but the XML one. So what would be 'config' => array(...) in the PHP array is ... in my XML Flexform.

Upvotes: 0

Views: 2260

Answers (1)

biesior
biesior

Reputation: 55798

This is standard behavior, see for an example Link field under the Header it also uses uid of the page, reason is simple: it allows to choose a page, but also external URL, email address or file reference - therefore it doesn't use page's title but its uid.

Second sample - shortcut to page definitely allows you to store only pages records, so it can render its title on the list - but doesn't allow you to mix different kinds of links.

If your ext will store always one type of link (ie. references to pages) you can use TCA field of type Group as showed in documentation

 'storage_pid' => array(
         'exclude' => 1,
         'label' => 'LLL:EXT:lang/locallang_tca.xlf:storage_pid',
         'config' => array(
                 'type' => 'group',
                 'internal_type' => 'db',
                 'allowed' => 'pages',
                 'size' => '1',
                 'maxitems' => '1',
                 'minitems' => '0',
                 'show_thumbs' => '1',
                 'wizards' => array(
                         'suggest' => array(
                                 'type' => 'suggest'
                         )
                 )
         )
 ),

Upvotes: 2

Related Questions