I use TYPO3 v8.7
Can I delete an FE-User like this or is there more to it?
$GLOBALS['TYPO3_DB']->exec_DELETEquery(
'fe_users',
'uid = '.$user["uid"]
);
Related
I've extended TYPO3 9.5.x with news extension 7.2.x with some custom properties.
I used the manual I found here.
In general, everything works, but somehow the custom properties I created seem to be blank at the frontend. After clearing the cache, everything works again, but after some time the same issue appears again.
What am I doing wrong? Maybe it has something to do that I'm working with TYPO3 9.5.x and the manual is written for TYPO3 7.6.x?
Thanks for your help!
move your TCA modifying code (from ext_tables) to /typo3conf/ext/yourEXT/Configuration/TCA/Overrides/tx_news_domain_model_news.php
something like this:
defined('TYPO3_MODE') or die();
( function( &$tca) {
$tempColumns = array(
'NEW_FIELD' => array(
'exclude' => 0,
'label' => 'LLL:EXT:yourEXT/Resources/Private/Language/locallang_be.xlf:tx_newsextend_domain_model_news.NEW_FIELD',
'config' => array(
'type' => 'check',
'default' => 0
),
),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'tx_news_domain_model_news',
$tempColumns
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes("tx_news_domain_model_news", 'NEW_FIELD', '', 'after:title');
})( $GLOBALS['TCA']['tx_news_domain_model_news']);
I've tried to add some message in typo3 backend, but without success.
I know for Flash messages but I just can't make it work.
How can I make it work?
I did this in one of my extensions and here is the snippet:
$messageQueue = GeneralUtility::makeInstance(
FlashMessageQueue::class,
'core.template.flashMessages'
);
$messageQueue->addMessage(
new FlashMessage(
'text',
'title',
FlashMessage::OK,
true
)
);
Most important is the attribute 'core.template.flashMessages' when instantiiating the FlashMessageQueue.
I'm trying to deactivate cHash in my extension ... the link for the show action looks like this:
/?tx_abc_abc[record]=1&tx_abc_abc[action]=show&tx_abc_abc[controller]=Abc&cHash=10c78febea3ae5dsdf535fb36ca6d08
In ext_localconf.php I tried to deactivate cHash like this:
ext_localconf.php
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Vendor.' . $_EXTKEY,
'Abc',
array(
'Abc' => 'list,show',
),
// non-cacheable actions
array(
'Abc' => 'list,show',
)
);
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_abc_abc[record],tx_abc_abc[action],tx_abc_abc[controller]';
It's not working though. What am I missing?
You need to deactivate the cHash when building the links in your template. If you are using the ViewHelper <f:link.action>, then you need to set the attribute noCacheHash="1".
For TYPO3 9 and 10
All we need to do is configure the parameter from which you don't want
your chash to be calculated
For example, your link is like this
<f:link.action action="detail"
additionalParams="{
tx_plugin_action:{
param1:1, param2:2, param3: 3
},
param4: 4
}">Link Text</f:link.action>
Then you have to exclude all the parameters in Localconfiguration.php
'FE' => [
'cacheHash' => [
'excludedParameters' => [
'tx_plugin_action[param1]',
'tx_plugin_action[param2]',
'tx_plugin_action[param3]',
'param4',
],
],
]
Additionally: Remember that if any of the parameter is not
included here then it will calculate and generate chash
Note: Here We don't need to set noCacheHash="1" explicitely in viewhelper
I am trying to add a new checkbox field 'showinhome' to the table 'tx_news_domain_model_media' same to the field 'showinpreview' here is my TCA Configuration in Configuration/TCA/Overrides/tx_news_domain_model_media.php
$temporaryColumns = [
'showinhome' => [
'exclude' => 1,
'label' => 'Show in Home',
'config' => [
'type' => 'check',
'default' => 0,
],
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'tx_news_domain_model_media',
$temporaryColumns
);
$GLOBALS['TCA']['tx_news_domain_model_media']['ctrl']['label_alt'] .= ', showinhome';
$GLOBALS['TCA']['tx_news_domain_model_media']['interface']['showRecordFieldList'] .= ', showinhome';
$GLOBALS['TCA']['tx_news_domain_model_media']['palettes']['newsPalette']['showitem'] .= 'showinhome,';
The field is not displayed, can someone help me please?
You have mixed up some stuff here.
First: tx_news can use either the own media model or the native FAL relations. I personally always use the native FAL relation.
If you want to add this field to the media table, then there is no newsPalette there. You can use the below code to add the new field:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_news_domain_model_media', $temporaryColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tx_news_domain_model_media', implode(',', array_keys($temporaryColumns)));
If you using the normal FAL relation then the showinpreview field is added to the sys_file_reference table's TCA configuration and not to the tx_news_domain_model_media table.
If you want to add this field to the file, then you need to add it to the sys_file_reference field the same way tx_news does it (I guess that you already copied the code from it's override file)
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $temporaryColumns);
// add special news palette
$GLOBALS['TCA']['sys_file_reference']['palettes']['newsPalette']['showitem'] .= ', showinhome';
Last but not least: you have to specify tx_news as a dependency in your extension, otherwise TYPO3 does not know that your extension has to be loaded after tx_news. If you change the dependency after you installed your extension you probably need to uninstall and install it again in the extension manager.
I have a plugin http://typo3.org/extensions/repository/view/aw_consume
I'm using it as a content element it's working
When I try to assign to a subpart in my typoscript nothing shows up
LOGOUT < plugin.tx_awconsume.widgets.menu
this plugin was created with the extension_builder extension installed on TYPO3 6.1.4
update 3
plugin.tx_awconsume {
view {
templateRootPath = {$plugin.tx_awconsume.view.templateRootPath}
partialRootPath = {$plugin.tx_awconsume.view.partialRootPath}
layoutRootPath = {$plugin.tx_awconsume.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_awconsume.persistence.storagePid}
}
features {
# uncomment the following line to enable the new Property Mapper.
# rewrittenPropertyMapper = 1
}
widgets {
menu = USER
menu {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = FeAwConsume
extensionName = AwConsume
controller = ConsumerItem
action = list
vendorName = Alexweb
}
}
}
ext_tables.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'FeAwConsume',
'fe_awconsume'
);
ext_localconf.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Alexweb.' . $_EXTKEY,
'FeAwConsume',
array(
'ConsumerItem' => 'list, show, new, create, delete',
),
// non-cacheable actions
array(
'ConsumerItem' => 'create, delete',
)
);
I have updated the code snippets according to #lorenz answer but im still getting no output
I have also pushed the latest version in TER 0.1.5
update 4
I did manage to get the expected output only after adding
plugin.tx_awconsume.widgets {
menu = USER
menu {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = FeAwConsume
extensionName = AwConsume
controller = ConsumerItem
action = list
vendorName = Alexweb
}
}
To the template typoscript file from \typo3conf\ext\aw_consume\Configuration\TypoScript\setup.txt
Where it was originally placed by the extension_builder extension however I got a feeling that this is not really a good idea
If you have a close look at your ext_localconf.php, you will notice that you use a vendor name. The vendor name should start with Uppercase so your ext_localconf.php should read:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Alexweb.' . $_EXTKEY,
'MyPlugin',
array(
'ConsumerItem' => 'list, show, new, create, delete',
),
array(
'ConsumerItem' => 'create, delete',
)
);
Your ext_tables.php should look like this:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'MyPlugin',
'Speaking name of my plugin'
);
The TypoScript object of your plugin should include the vendor name (the property is vendorName, not vendor):
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = MyPlugin
extensionName = AwConsume
vendorName = Alexweb
controller = ConsumerItem
action = list
Keep in mind that your classes also must include the vendor name/make use of the correct namespace:
namespace Alexweb\AwConsume\Controller;
class ConsumerItemController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
}
Then you should be fine.
The extension name is the UpperCamelCase variant of your extension key, so if your extension key is "aw_consume", your extension name is "AwConsume". This name is used in the classes
The plugin name is the name of a particular plugin that is part of your extension. Since there can be many plugins in an extension, you should choose a fitting name for it. The plugin name should also be UpperCamelCase. You can have multiple plugins for the same controllers, therefore the plugin doesn't have to be named like the controller.
See also http://forge.typo3.org/projects/typo3v4-mvc/wiki/FAQ#What-is-the-Extension-Name