Mask and issues - typo3

Regarding the mask, in backend mask have default configurations such as below:
general.json => typo3conf/mask.json
frontend.content => fileadmin/templates/content/
frontend.layouts => fileadmin/templates/content/Layouts/
frontend.partials => fileadmin/templates/content/Partials/
backend.backend => fileadmin/templates/backend/
backend.layouts_backend => fileadmin/templates/backend/Layouts/
backend.partials_backend => fileadmin/templates/backend/Partials/
backend.preview => fileadmin/templates/preview/
While installing our theme extension, we need to change the above mask configuration option values like below:
general.json => typo3conf/ext/<extension_key>/mask.json
frontend.content => fileadmin/<extension_key>/templates/content/
frontend.layouts => fileadmin/<extension_key>/templates/content/Layouts/
frontend.partials => fileadmin/<extension_key>/templates/content/Partials/
backend.backend => fileadmin/<extension_key>/templates/backend/
backend.layouts_backend => fileadmin/<extension_key>/templates/backend/Layouts/
backend.partials_backend => fileadmin/<extension_key>/templates/backend/Partials/
backend.preview => fileadmin/<extension_key>/templates/preview/
We tried like below, but its not working:
plugin.tx_mask.general.json = EXT:user_ss4u/mask.json
module.tx_mask.general.json = EXT:user_ss4u/mask.json

It seems like you try to override the settings via typoscript, which is -
as far as i know - not possible.
The settings you want to change are saved in typo3conf/LocalConfiguration.php
in ['EXT']['extConf']['mask'] so there are two (okay, one with two ways) possibilities to change them:
1.1 via Extension Manager
Open the module "Extension" in the TYPO3 Backend and search for the mask Extension.
Click on the configure icon at the end of the row.
Now you should be able to change the settings.
Changes are stored in typo3conf/LocalConfiguration.php
1.2 via Mask itself
Open the module "Mask" in the TYPO3 Backend.
Click on the configure icon to change to the Configuration Tab.
Now you should be able to change the settings.
Changes are stored in typo3conf/LocalConfiguration.php
2. via PHP
You can add the following snippet to a file like the ext_localconf.php in typo3conf/ext/<extension_key> or in typo3conf/AdditionalConfiguration.php
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mask'] = serialize([
'json' => 'typo3conf/ext/<extension_key>/mask.json',
'content' => 'fileadmin/<extension_key>/templates/content/',
'layouts' => 'fileadmin/<extension_key>/templates/content/Layouts/',
'partials' => 'fileadmin/<extension_key>/templates/content/Partials/',
'backend' => 'fileadmin/<extension_key>/templates/backend/',
'layouts_backend' => 'fileadmin/<extension_key>/templates/backend/Layouts/',
'partials_backend' => 'fileadmin/<extension_key>/templates/backend/Partials/',
'preview' => 'fileadmin/<extension_key>/templates/preview/',
]);

Related

How to add custom action button in suiteCRM module sub panel list?

I need some suggestion in my suite CRM module integration.
I have a sub-panel in one of my modules and required to add one more edit button to redirect to a custom form to take some input from the user for each row separately.
Below is a sample image of my sub-panel list view.
In the above image on click of the edit button of a row, there is a remove button, I want to add one more custom button after remove and need to redirect from there to my new form.
I have checked some of forums and blogs but didn't found the solution.
To add a button you will need to modify the metadata of that sub-panel. In metadata, you will see the following code for the Edit and Remove buttons:
'edit_button' =>
array (
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'module' => 'Contacts',
'width' => '5%',
'default' => true,
),
'remove_button' =>
array (
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Contacts',
'width' => '5%',
'default' => true,
),
You can add your new button using same array syntax. As you can see that every button use specific widget class(defined as widget_class) therefore you will need to add new widget_class class for that. You can find existing widget classes in this folder: include/generic/SugarWidgets.
Cheers!

TCA Icon overlay in typo3 backend

I’m working on an extension where I synchronise some data to another database and I wanted to show this in the backend using a TCA icon overlay. Sadly I could not find out how to do this. I thought about using ‘ctrl’=>‘typeicon_classes’ (using the state field of my table to choose an icon), this works for the default (non synchronised element) but I cannot figure out how to set an overlay. Any idea on how to do this?
My TCA configuration looks like this:
'ctrl' => [
...
'typeicon_column' => 'state',
'typeicon_classes' => [
'new' => 'mimetypes-x-content-login',
'synced' => 'mimetypes-x-content-login-overlay-approved',
]
],
The "synced" part does not work as expected. What I would expect is to either add the overlay at the end of the icon or by adding it with a whitespace but both did not work.
Any help is appreciated.
PS: I really just need this in the TYPO3 backend, the obvious solution for frontend is to use fluid or PHP but I don't think this suits the TYPO3 Backend list.
You need to register your icon files.
Given your icon files are named content_login.svg and content_login_overlay_approved.svg located in directory /Resources/Public/Icons/ you can register these in ext_localconf.php as following:
if (TYPO3_MODE === 'BE') {
$icons = [
'mimetypes-x-content-login' => 'content_login.svg',
'mimetypes-x-content-login-overlay-approved' => 'content_login_overlay_approved.svg',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
foreach ($icons as $identifier => $path) {
$iconRegistry->registerIcon(
$identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:YOUREXTENSIONNANME/Resources/Public/Icons/' . $path]
);
}
}
Adapt yourextensionname

How to add custom wizards in typo3 7 TCA?

When I try to add the wizard named wizard_geo_selector in TCA ,there arised an error "module not registered".Please tell me how to register the wizard properly in the TCA.?
In TYPO3 Version 7.6 new wizards are added like this:
Inside your extension create the directory Configuration/Backend/
In the new directory create a file Routes.php, it will be found automatically, no mentioning in ext_localconf.php or ext_tables.php is required. If you still need Ajax you can add the file AjaxRoutes.php in the same folder.
Content for Routes.php:
return array(
'my_wizard_element' => array(
'path' => '/wizard/tx_geoselecotor/geo_selector_wizard',
'target' => \Path\To\your\class\WizardGeoSelector::class . '::WizardAction'
),
);
Content for AjaxRoutes.php
<?php
/**
* Definitions for routes provided by EXT:backend
* Contains all AJAX-based routes for entry points
*
* Currently the "access" property is only used so no token creation + validation is made
* but will be extended further.
*/
return array('my_ajax_element' => array(
'path' => 'tx_geoselecotor/my_ajax_route',
'target' => \Path\To\your\class\MyAjaxController::class .'::myAjaxFunction'
));
If you're unsure about the notation you can compare with existing entries in the Global Variables in the Backend:
Navigate to System -> Configuration -> Backend Routes
The route of the paths is handled different, for Ajax it's always "ajax" prepended, so you've never to add it to the path, else it's twice in the route. For the common route there is no change concerning the defined string.
Now the wizard can be used and even it never has to be defined in ext_tables.php it has to be mentioned there from any table-field in the configuration-area (module[name]):
'table_field_for_wizard' => array(
'label' => 'LLL:EXT:my_extension/Resources/Private/Language/locallang.xml:table_name.tx_myextension_wizard',
'config' => array (
'type' => 'user',
'userFunc' => 'Path/to/class/without/wizard->renderForm',
'wizards' => array(
'my_wizard' => array(
'type' => 'popup',
'title' => 'MyTitle',
'JSopenParams' => 'height=700,width=780,status=0,menubar=0,scrollbars=1',
'icon' => 'EXT:' . $_EXTKEY . '/Resources/Public/img/link_popup.gif',
'module' => array(
'name' => 'my_wizard_element',
'urlParameters' => array(
'mode' => 'wizard',
'ajax' => '0',
'any' => '... parameters you need'
),
),
),
'_VALIGN' => 'middle',
'_PADDING' => '4',
),
# Optional
#'softref'=>'something',
),
),
In the userFunc Path/to/class/without/wizard->renderForm you've to create a button which is linking to the wizard and onClick the wizard will open with the route you defined in Routes.php and the optional urlParameters.
Currently I never found this whole item explained in the core-documentation.
Edit:
Details about routing can be found here: Routing
The rendering process can be found here: Rendering / NodeFactory
You should probably read also the outer context of the linked paragraph.
Edit 2:
An example extension can be found here, some things never work 100% but the wizard is working. The extension is for TYPO3 Version 7:
https://github.com/DavidBruchmann/imagemap_wizard
Ricky's answer doesn't really work anymore, since addModulePath ist deprecated since version 7.
Also, just registering the module like this still give's you said error.
The only thing that keeps the wizard going again is this:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('wizard','pbsurvey_answers',"",\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'wizard/');
But when you add this, the module appears as a new point in your TYPO3 backend.
IN TCA add the wizard like follows:
'module' => array(
'name' => 'wizard_geo_selector',
),
In ext_tables.php register the wizard.
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
'wizard_geo_selector',
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Wizards/Yourwizardname/'
);
Keep in mind this is deprecated since Typo3 7 and removed in Typo3 8.So you can use this method upto Typo3 7.For Typo3 8 do use the method specified by David below.

"Theme Customizer" - different background image for different category

I'm trying to make setting in theme customizer which will allow me to choose different background image to different category. I have two settings working separately, but i don't know how to combine them to work together and it seems like there was no problem like this before.
In theme customizer it looks like
> this <.
How make it work together?
EDIT:
I was trying in many ways to acomplish this, but only thing that worked as i wanted was creating a section for each category and add background image there, like this:
$wp_customize->add_section( 'background_section_cat_a', array(
'title' => __( 'Category: cat_a', 'twentythirteen-child'),
'description' => 'Options prepared to change background settings', 'twentythirteen-child',
'priority' => 160,
'panel' => 'background_panel',
));
$wp_customize->add_setting( 'background_image_cat_a', array(
'default' => 'abc.jpg',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'background_image_cat_a', array(
'label' => __( 'Select background image', 'twentythirteen-child' ),
'section' => 'background_section_cat_a',
'settings' => 'background_image_cat_a',
)));
and use this setting:
body.category-cat-a {
background-image: url(<?php echo get_theme_mod('background_image_cat_a'); ?>);}
But when I add new category, I have to enter my theme customizer options and add it there, and it is very time time consuming.
There is another way:
1. Add custom field with image to your Category taxonomy
2. call your image in category.php page.

Customizing SugarCRM 6.5 theme

I am new to SugarCRM 6.5 CE.
I have been trying to make custom theme by copying the already available themes and changing the name of folder.
The theme is now available in the drop down but any changes I am making to its CSS is not taking place.
Thanks in advance.
Here is my themedef file
$themedef = array(
'name' => "Test",
'description' => "Default theme from Sugar 5",
'version' => array(
'regex_matches' => array('6\.*.*'),
),
'group_tabs' => true,
'parentTheme' => "Test",
);
You have to set the parent theme like this:
'parentTheme' => "Sugar5", // this is the standard theme you want to overwrite.