webman
webman

Reputation: 1203

TYPO3 tx_news use same database field for custom extension

I'm building a proper extension for the management of real estate, I would like to use the added "Image Metadata" field "Show in list view" as the extension tx_news does.

I can build this option in exactly as tx_news does but in case the site instalation uses both extensions, does this cause a conflict ? ( I'd use the same field name showinpreview )

Should I use a different field name to avoid trouble?

( I plan to use this feature in the exact same fashion, so I can easily share the use of the field in the "sys_file_reference" table ... if there was no other conflict there could be the case that an image was used in both extensions and the selection would be determined by one of the two extensions for both or do I misunderstand something here... )

anybody did experiments with this and can avoid me the trouble ?

Upvotes: 1

Views: 122

Answers (2)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

You can use the same field as there also is a field which identifies the table the record belongs to.
Be sure to stay in sync with tx_news. either by a dependency, which might be a great overhead if you don't use tx_news otherwise, or with the same declaration as in tx_news, this can conflict if tx_news changes declaration unnoticed.

You have to declare your own access which will be independent as you use other namespace and context.

Upvotes: 1

Georg Ringer
Georg Ringer

Reputation: 7939

I never had this use case but both ways are possible. - use the same field: less code needed but your extension depends on news - new field: also fine

Upvotes: 1

Related Questions