Typo3 best practices - general variables - typo3

What is the best way to allow backend users to edit variables?
For example, I have a TYPO3 that sends out various e-Mail notifications and I want the backend users to be able to globally change the recipients. I started with template constants, until I found out, that backend users cannot edit the "template" module.
So what would be the best way to achieve this? I'm using Typo3 8.7.7

I would create a configuration record which can be edited by the backend users.

one way would be to include one file from fileadmin/ into the constants definition of typoscript. This file editors could change. But that could be a security risk, as the editors could define any constants.
the next option would be to define additional fields to the pages record, where these values could be set by any editor. In typoscript you access the field (maybe with slide = -1, so the value needs to be set just once)
another option: add these fields to a (special?) CE (ContentElement).
last option: use std CEs (e.g.HTML-content) at special pages or columns and use the content field (bodytext). (HTML-content has the advantage that the bodytext field is stored unmodified.)
Cleanest and leanest option would be option two (additional fields to table 'pages'). Option three and four are possible with pure typoscript, but you need to use CONTENT or RECORD object. If you use fix uids: remember that your editors might delete the CE and add a new CE with the same content (but another uid)
Addition:
As #Thomas-Löffler in his answer said:
you also can add a new kind of record/table, where an editor can insert or change the global values. Handling is like pages or tt_content. you can differ if your records are global (pid = 0, or special storage page) or dependent on page tree (rootpath), so you can have differnt values for different page subtrees.

I like Thomas‘ answer for providing a dedicated place to store the configuration option instead of putting it e.g. to pages because your configuration option is not bound to a page context.
Nonetheless for me personally it feels a bit odd to create a dedicated table for it. A table that would never hold more than one record.
That leads me to the conclusion that a key-value storage would be the right thing to use. Fortunately, TYPO3 ships System Registry. The only downside is that there‘s no interface for it so you‘d have to come up with your own forms to fill it. That‘s much easier if you go with Thomas‘ solution…

A clean and easy way is setting up a backend module with a form to set the email addresses.
Then you can grant the access right to a specific group or user and they are ready to go.

Related

Tag group for multiple sites in kentico?

I wanted to know how I can use a tag group for multiple site in Kentico 10 ? Is it possible or there are workarounds ?
Well you can not have the same tag group for 2 or more sites. There is no "global" tag group. Table CMS_TagGroup has the information about all the groups for all sites, and Kentico module is called Taxonomy. You have to experiment here, there is a field called TagGroupIsAdHoc by default is always false. You may try to set to true (i.e. it means a group is shared), but in this case you need to useal module -> make a change -> seal the module.
Here is the condition that you need to change:
These are just some ideas, you need to dig deeper... Essentially what you looking for is custom functionality and not available out the box. Changing system modules is not recommended (might complicate the future upgrades), so you do it at your own risk

Can we add a comment column next to the Change column in Audit View of EA?

Is there a provision to store user entered comment during modification to the “Model” which can be shown in the “Audit View” along with “Original” and “CHANGE” columns of EA.
Can we add a comment column next to the Change column in Audit View of EA, where user entered comment can be stored. Please suggest the EA API to do the same.
You can not easily do that. You might modify the underlying database and add columns to existing tables (or even add your private tables). But that would break XMI export as these columns would not be ex-/imported and you're on your own to maintain this. An alternative is to use tagged values in general cases. But here I doubt it's feasible. So probably your own table with foreign key referring the audit would be the choice. However, it merely sound like you're trying to re-build a check-in mechanism. FWIW: in practice I found this mechanism counter-productive as people tend to comment either nothing or trivialities. So that it hinders more than it helps.
You can not modify the standard dialogs (e.g. fo the shown audit view). That means you have to write an add-in to create your own dialog.
The table that contains the audit is t_snapshot.

Migration of tx_news from one TYPO3 to another

I want to migrate existing news from one instance to another one incl. relations to FAL and content elements.
What is the best practise? I tried T3D Export, but it needs too much memory. Is this the only solution or do you have better ones?
1st you can try to export smaller chunks.
2nd you can do the export by hand. But then you must know which records are involved and what files are involved. And you must handle uid-collisions!
Starting with a simple query for your news-records.
Then you need all related records: FAL, tt_content, categories
Depending on your tt_content records you might need further related records - typical: FAL
Then you need to identify all the files.
Before you import all the records: make sure the used uids are unused in your target installation. oherwise you need to modify your uids (e.g.: you can add a constant value of 10000 to all your uids)

Mail Merge with multiple child records

I have a mail merge template, which includes a bunch of information about the entity that it is associated with in CRM. However, I'm needing a way to add all of the child records from my main entity in to the mail merge template as well.
Is there a way to have a sub record set inside a template?
The easiest solution might be Invantive Composition by inserting a <invantive:foreach>...</invantive:foreach> or through insert building block in the ribbon (note that I work there, but there is also a free version). Alternative solution I've used in the past are programming it completely (using RTF generation outside of Word or VBA or VSTO in Word). But this is quite hard to get right for tables. When the amount of sub records is somewhat limited, you might use PIVOT (see this for example) to change it all into one big record and insert the fields in your document. In the document you may need to hide all placeholders for the sub records not present in a specific instance.

Typo3 group Records by a DB field

Im using a Page (type Folder) to show all records with this pid. Is it possible group these records somehow? Theres a field in my DB called "vid", which contains the uid of some other records. I want the records in my folder to be grouped by this uid. Any suggestions? (Using Typo3 4.6.3)
Ok, then the simple answer is No. Grouping is not possible with the default backend list view module. You can sort, and search/filter there, but not more. You may write a custom backend module that does the trick for you.
What I could also imagine is to use the export function in the list module (there is a button somewhere) and then do the grouping with your favorite spreadsheet tool (like excel). Depending on how often you need this feature that may be a simple workaround that does not require and additional coding.