multiple category-UIDs for selection (category-tree)? - categories

is it possible to specify multiple entry points in the category tree for example tx_news-dataset? Or can it only be restricted by one uid? (rootUid)
TCEFORM.tx_news_domain_model_news.categories.config.treeConfig.rootUid = 25
Maybe there is another solution like PAGE_TSCONFIG_IDLIST for categories?
Or can you e.g. limit the PID for the category-records so that only those from a special folder are displayed?

For own data records it should work with the specification of PAGE_TSCONFIG_IDLIST and the UIDs of the folder with category data records.
TCEFORM.tx_news_domain_model_news.categories.PAGE_TSCONFIG_IDLIST = 89,99
tx_news has an extension setting in which you have to specify how the categories should behave, in my case Category restriction -> Page TS-Config
default is: No restriction

Related

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.

How to Display Attribute Group Name in Product Tab Magento 2.1.3

I created an attribute set and attribute groups with attributes in it. In the admin panel the attributes are listed in groups, like i created them. But on the front productpage all the attributes are listed together, without displaying the attribute group name first.
I would like to display the Attribute Group Name on the product page (more information tab), before the attributes in this group. How do i do that?
There is no way to do this by default in Magento 2.
There are a few ways I can think of to acheive this. Perhaps best would be to extend the getAdditionalData() method in /Block/Product/View/Attributes.php so that it adds the attribute group name (or id) to the returned array.
You would then need to create a local copy of Magento_Catalog/templates/product/view/attributes.phtml and iterate the array returned by the modified getAdditionalData() method sorting it according to the group name and then output the data with group name headings.
I'd be interested to hear of other or best practice approaches to this type of relatively simple extended functionality in Magento 2.

n-n relationships for multiple content types

I'm working on a project based on Laravel 5.3 and Backpack CRUD. My project has about 8 different content types (news, page, portfolio, events, team, video, gallery, jobs).
I need to be able to add tags to every content type (n-n), and every content type has its own specific tags, so tags are NOT shared between the content types.
If I want to use the select_multiple or select2_multiple field type, I would need 8 tables for the content itself, 8 pivot tables, and 8 tables for the tags(!).
Obviously I would like to have just one table for the tags, but if I use the select_multiple or select2_multiple field type, I get all tags in the edit-form of every content type.
So, my question is: Is there an elegant way to filter the results of the select_multiple or select2_multiple field type?
I have created a simple schema with two content types:
http://dbdesigner.net/designer/schema/60412
In this example I want to be able to filter the tag list on content_type_id, when I'm editing the content of news or page. So I just want to see the news tags in the news-edit form, and just the page tags, in the page-edit form.
Or maybe I should just use the select_multiple field type as intended, and accept the 8 tag tables(?)
Any help or advice would be greatly appreciated.
I think a clean way would be to:
create different models for each tag use, so NewsTag, PageTag, PortfolioTag etc. that would only extend the Tag model and use a global scope to filter the results after content_type_id;
use backpack select2_multiple fields with NewsTag, PageTag, PortfolioTag etc; anything you set on the Tag model will be used (including the table attribute, mutators, accessors, etc);
Cheers!

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';

Sorting Entry Fields in Movable Type 5 CMS

My CMS is currently Movable Type 5.04. The attached screenshot is how I check in Compose Screen of MT CMS.
And it appears in the new entry create page with the following order.
- Location 5
- Job Description 5
- Bio 5
- Job Title 5
I would like to change the order into following.
- Job Title 5
- Location 5
- Job Description 5
- Bio 5
Is there any way to do so? I have checked in the cfg_entry.tmpl file and the above Entry fields were not there as there were custom fields. Could you please help me sort them like above?
the order of the fields are stored into the permission table, in 'permission_entry_prefs' field. (and there is a matching field for the page)
the row with blog_id 0 is the user defaults, and each blog's raw will override the default for this blog.
and the format is very simple: comma delimited list. you should find there something like "title,text,tags,assets". just reorder them for your liking.
If the user will toggle on and off fields, I'm not sure if the original order will return or not. if it does, then a simple plugin can solve it in more permanent way.
I remember doing this by recreating the custom fields in the wanted order (MT pulls them from the DB in a specific order, sorted by ID IIRC). If you have existing data, then you need to delete the fields definitions (not the data) then recreate them in the order you want changing just their numerical ID (not anything else).
I'm traveling and busy at the moment so can't dig into details. But study how CF are defined in the DB and how to simply reorder them by ID.