How to disable powermail javascript files and js libraries including validation? - typo3

I want to disable jquery and javascript come from powermail 2.x
Any Ideas, Please help.

In TYPO3 6.2 and above you can remove each unwanted item of PowerMail's JS and CSS files separately. Use all or some lines of the following TypoScript in your TS-Setup:
#
# TS SETUP:
#
page.includeJSFooterlibs {
# prevent PowerMail from loading jQuery itself
powermailJQuery >
# prevent PowerMail from loading additional JS files
powermailJQueryUi >
powermailJQueryUiDatepicker >
powermailJQueryFormValidationLanguage >
powermailJQueryFormValidation >
powermailJQueryTabs >
}
page.includeJSFooter {
powermailForm >
}
page.includeCSS {
# prevent PowerMail from loading CSS files
powermailJQueryUiTheme >
powermailJQueryUiDatepicker >
}

if you want to disable javascript file in powermail try this in the Constants
plugin.tx_powermail {
settings {
javascript {
addJQueryFromGoogle = 0
addAdditionalJavaScript = 0
powermailJQuery >
}
}
}
if you want to disable js validation try this constant
plugin.tx_powermail.settings.setup.validation.client = 0

Related

How to get viewhelper f:widget.autocomplete working in TYPO3 8.7

I want to use the viewhelper f:widget.autocomplete to implement an autocomplete feature for a search in a little extension in TYPO3 8.7.
The Documentation for TYPO3 8.7. says nothing about it: https://docs.typo3.org/m/typo3/guide-extbasefluid/8.7/en-us/Fluid/ViewHelper/Widget/Autocomplete.html
I tried it as discribed in the Documentation for TYPO3 9.5. https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Widget/Autocomplete.html
I have included the JS- and CSS-Assets and use the viewhelper in the filter-form of my extension:
<input type="text" id="search" name="pluginname[search]" />
<f:widget.autocomplete for="search" objects="{myobject}" searchProperty="name" />
This integrates a JS-Snippet from sysext/fluid and makes an ajax call, if I put something in the text field.:
http://host/index.php?id=1&type=7076&fluid-widget-id=305d544b2a96a8e5a73db7e93c083586&action=autocomplete&term=myterm
But the response to this call contents the hole page and not only the result of a datatabase query according to my searchterm.
Now my question:
What have I to do, to get the autocomplete feature working?
Do I need an extra autocomplete action in my controller?
Or ist there an extra setup for the pageType needed?
Currently the pageType 7076 is configured by the Fluid-Sysextension:
fluidAjaxWidgetResponse = PAGE
fluidAjaxWidgetResponse {
# todo: make page type configurable
typeNum = 7076
headerData >
config {
no_cache = 1
disableAllHeaderCode = 1
additionalHeaders.10.header = Content-Type: text/plain
additionalHeaders.10.replace = 1
debug = 0
}
10 = USER_INT
10 {
userFunc = TYPO3\CMS\Fluid\Core\Widget\Bootstrap->run
}
}
config.tx_extbase {
mvc {
requestHandlers {
TYPO3\CMS\Fluid\Core\Widget\WidgetRequestHandler = TYPO3\CMS\Fluid\Core\Widget\WidgetRequestHandler
}
}
}

Override a Fluid Template from another extension

I'm working on a TYPO3 webpage for a magazine. Therefore I'm using the extension "news" or "tx_news".
Everything works fine, except that I'm confused how and where to override the given fluidtemplates from the news extension. For the webpage I'm using an own extension to keep all the backend layouts and fluid templates stored, I would like to include an own fluidtemplate for the News as well inside my extension, so the changes I make won't get overriden when I update the news extension of course.
I've tried just copy pasting the fluid templates from the news into my extension with the hope that they get overriden, since my extension has the highest priority in the backend. Also I found on the documentation that I should add the following lines into my TS setup:
plugin.tx_news {
view {
templateRootPaths >
templateRootPaths {
0 = EXT:news/Resources/Private/Templates/
1 = fileadmin/templates/ext/news/Templates/
}
partialRootPaths >
partialRootPaths {
0 = EXT:news/Resources/Private/Partials/
1 = fileadmin/templates/ext/news/Partials/
}
layoutRootPaths >
layoutRootPaths {
0 = EXT:news/Resources/Private/Layouts/
1 = fileadmin/templates/ext/news/Layouts/
}
}
}
I have added those lines at the bottom in the setup.txt of my own extension with customized paths of course and it didn't work either.
I appreciate all the help.
You missed to declare the pathes to your version of the templates.
you have two ways:
use the constants ext:news provides you and inserts automatically in the TS setup
add some lines direct to the plugin configuration.
As you use an page extension for all configuration you would avoid the TS constant editor or use it only to identify the names of the constants.
// Path constants from ext:news:
plugin.tx_news {
view {
layoutRootPath = EXT:yourextension/Resources/Private/News/Layouts/
partialRootPath = EXT:yourextension/Resources/Private/News/Partials/
templateRootPath = EXT:yourextension/Resources/Private/News/Templates/
}
}
Anyway you should end up with a TS like this (inspect with TSOB):
plugin.tx_news {
view {
templateRootPaths {
0 = EXT:news/Resources/Private/Templates/
1 = EXT:yourextension/Resources/Private/News/Templates/
}
partialRootPaths {
0 = EXT:news/Resources/Private/Partials/
1 = EXT:yourextension/Resources/Private/News/Partials/
}
layoutRootPaths {
0 = EXT:news/Resources/Private/Layouts/
1 = EXT:yourextension/Resources/Private/News/Layouts/
}
}
}
If you use method 2 you could use higher values to give your templates higher priority - in case multiple extensions and template replacements are active.
This configures the pathes for the layouts, partials and templates you are overriding:
Resources
+- Private
+- News
+- Layouts
+- Partials
+- Templates
in your extension.
Don't use the TS from your question (even if it comes from the original manual.)
It deletes the predefined pathes. (Lines 3,8,13). This might fail after an update where the internal pathes have changed.
Copy only templates from EXT:news in your extension which you
want to change. Your example TypoScript works as fallback and templates missed in 1 are searched in 0.
Overwrite only TypoScript that you want to change.
Then use TypoScript Object Browser and check the TypoScript setup for
plugin.tx_news.view...
If you don't see right paths the order of TypoScript loading must be
changed.

Powermail ext doesn't include css files needed for date picker

TYPO3 7.6.15
Powermail 3.18.0
The date picker field does not open the popup calendar. I have narrowed down the cause being because the necessary CSS files are not being included for this feature. Is there an error in my setup? How do I have them included automatically?
This is what I have in my TS Setup:
plugin.tx_powermail {
view {
templateRootPaths >
templateRootPaths {
0 = {$plugin.tx_powermail.view.templateRootPath}
1 = fileadmin/template/mysite/powermail/Templates/
}
partialRootPaths >
partialRootPaths {
0 = {$plugin.tx_powermail.view.partialRootPath}
1 = fileadmin/template/mysite/powermail/Partials/
}
layoutRootPaths >
layoutRootPaths {
0 = {$plugin.tx_powermail.view.layoutRootPath}
1 = fileadmin/template/mysite/powermail/Layouts/
}
}
_LOCAL_LANG.default {
datepicker_format_date = d/m/Y
datepicker_format_time = H:i
datepicker_format_datetime = d/m/Y H:i
}
}
The only way I have found to make it work correctly is by manually adding it like this:
page.includeCSS {
file4 = EXT:powermail/Resources/Public/Css/Basic.css
}
in the Documentation ist a hint:
https://docs.typo3.org/typo3cms/extensions/powermail/ForAdministrators/Installation/Index.html#addbootstrapclassesandcsstopowermail
you should
add the static template Add classes and CSS based on bootstrap (powermail)
There the css is included
You need to tell powermail to load the JavaScript libraries by setting a constant in your TypoScript template:
plugin.tx_powermail.settings.javascript.addAdditionalJavaScript = 1
See https://docs.typo3.org/typo3cms/extensions/powermail/Faq/Index.html#datetimepickernotworking for more information.
Adding the static template file would result in a TypoScript like
plugin.tx_powermail.settings.BasicCss
=EXT:powermail/Resources/Public/Css/Basic.css
this should load everything.
The datepicker styles are originally located in https://github.com/einpraegsam/powermail/blob/develop/Resources/Private/Sass/_DatePicker.scss

TYPO3 Custom Menu Element

I am trying to create a custom menu element by using this in the Page TSConfig:
TCEFORM.tt_content {
menu_type.addItems.101 = My Menu
}
And this in Setup:
temp.my_menu = HMENU
temp.my_menu {
special = list
special.value.field = pages
1 = TMENU
1 {
wrap = <ul> | </ul>
NO = 1
NO.wrapItemAndSub = <li>|</li>
}
}
tt_content.menu.20.101 < temp.my_menu
But I get 'Oops, an error occurred!' where the menu should be.
It will render fine if I remove the Fluid includes in the template but then all the other content elements give errors.
Is there any way to have a typoscript menu element at the same time as fluid styled content?
Or if I really have to, how do I add a custom fluid menu template?
You need to move the line with the copy operation down to the bottom, otherwise the configuration is not copied, because it is not there yet.
The exception happens, because there is no rendering definition for the menu (because you never copied the configuration).
To see the real error instead of the exception, switch to the development preset in the install tool oder add the following line to your TS setup:
config.contentObjectExceptionHandler = 0
I noticed this :
TCEFORM.tt_content {
menu_type.addItems.101 = My Menu
}
as far as I know should be this :
TCEFORM.tt_content.menu_type {
types {
menu{
addItems {
101 = My Menu
}
}
}
}
I had to 'tweak' the special menus (typo3 7.6) and this worked:
Add special menu and add class="active" in TYPO3

Prevent TinyMCE from removing span elements

Here is the problem demonstration
You can try it here: http://fiddle.tinymce.com/SLcaab
This is TinyMCE default configuration
less all the plugins
with extended_valid_elements: "span"
1 - Open the Html Source Editor
2 - Paste this html into the Html Source Editor:
<p><span>Hello</span></p>
<p>Google 1</p>
<p>Google 2</p>
3 - Click update in the Html Source Editor to paste the html in the editor
4 - Remember there is a span around 'Hello'.
5 - Place your cursor just before Google 2 and press backspace (the two links should merge inside the same paragraph element).
6 - Look at the resulting html using the Html Source Editor.
Result (problem): No more span in the html document even though we added 'span' to the extended_valid_elements in the TinyMCE settings.
Note: I removed all the plugins to make sure the problem is at the core of TinyMCE.
Edit 1 - I also tried: valid_children : "+p[span]" - still does not work
Edit 2: Only reproduced on WebKit (OK on Firefox and IE)
Insert extended_valid_elements : 'span' into tinymce.init:
tinymce.init({
selector: 'textarea.tinymce',
extended_valid_elements: 'span',
//other options
});
I have the same problem and I find solutions. Tiny MCE deleted SPAN tag without any attribute. Try us span with class or another attribute for example:
<h3><span class="emptyClass">text</span></h3>
In TinyMCE 4+ this method good work.
Tinymce remove span tag without any attribute. We can use span with any attribute so that it is not removed.
e.g <span class="my-class">Mahen</span>
Try this for 3.5.8:
Replace cleanupStylesWhenDeleting in tiny_mce_src.js (line 1121) with this::
function cleanupStylesWhenDeleting() {
function removeMergedFormatSpans(isDelete) {
var rng, blockElm, wrapperElm, bookmark, container, offset, elm;
function isAtStartOrEndOfElm() {
if (container.nodeType == 3) {
if (isDelete && offset == container.length) {
return true;
}
if (!isDelete && offset === 0) {
return true;
}
}
}
rng = selection.getRng();
var tmpRng = [rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset];
if (!rng.collapsed) {
isDelete = true;
}
container = rng[(isDelete ? 'start' : 'end') + 'Container'];
offset = rng[(isDelete ? 'start' : 'end') + 'Offset'];
if (container.nodeType == 3) {
blockElm = dom.getParent(rng.startContainer, dom.isBlock);
// On delete clone the root span of the next block element
if (isDelete) {
blockElm = dom.getNext(blockElm, dom.isBlock);
}
if (blockElm && (isAtStartOrEndOfElm() || !rng.collapsed)) {
// Wrap children of block in a EM and let WebKit stick is
// runtime styles junk into that EM
wrapperElm = dom.create('em', {'id': '__mceDel'});
each(tinymce.grep(blockElm.childNodes), function(node) {
wrapperElm.appendChild(node);
});
blockElm.appendChild(wrapperElm);
}
}
// Do the backspace/delete action
rng = dom.createRng();
rng.setStart(tmpRng[0], tmpRng[1]);
rng.setEnd(tmpRng[2], tmpRng[3]);
selection.setRng(rng);
editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);
// Remove temp wrapper element
if (wrapperElm) {
bookmark = selection.getBookmark();
while (elm = dom.get('__mceDel')) {
dom.remove(elm, true);
}
selection.moveToBookmark(bookmark);
}
}
editor.onKeyDown.add(function(editor, e) {
var isDelete;
isDelete = e.keyCode == DELETE;
if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
e.preventDefault();
removeMergedFormatSpans(isDelete);
}
});
editor.addCommand('Delete', function() {removeMergedFormatSpans();});
};
put an external link to tiny_mce_src.js in your html below the tiny_mce.js
It's possible to use the work around by writing it as a JavaScript script which prevents WYSIWIG from stripping empty tags. Here my issue was with including Font Awesome icons which use empty <i> or <span> tags.
<script>document.write('<i class="fa fa-facebook"></i>');</script>
In the Tinymce plugin parameters enable:
Use Joomla Text Filter.
Be sure your user group have set "No filtered" Option in global config > text filters.
Came across this question and was not happy with all the provided answers.
We do need to update wordpress at some point so changing core files is not an option. Adding attributes to elements just to fix a tinyMCE behaviour also doesn't seem to be the right thing.
With the following hook in the functions.php file tinyMCE will no longer remove empty <span></span> tags.
function tinyMCEoptions($options) {
// $options is the existing array of options for TinyMCE
// We simply add a new array element where the name is the name
// of the TinyMCE configuration setting. The value of the array
// object is the value to be used in the TinyMCE config.
$options['extended_valid_elements'] = 'span';
return $options;
}
add_filter('tiny_mce_before_init', 'tinyMCEoptions');
I was having same issue. empty SPAN tags are being removed. The solution i found is
verify_html: false,
Are you running the newest version of TinyMCE? I had the opposite problem - new versions of TinyMCE would add in unwanted span elements. Downgrading to v3.2.7 fixed the issue for me, that might also work for you if you are willing to use an old version.
Similar bugs have been reported, see the following link for bugs filtered on "span" element:
http://www.tinymce.com/develop/bugtracker_bugs.php#!order=desc&column=number&filter=span&status=open,verified&type=bug