not able to register two plugins of touch-ui rte dialog - aem

I am using the steps given in the URL to make a color-picker rte plugin
http://experience-aem.blogspot.in/2015/01/aem-6-sp1-touchui-richtext-editor-color-picker-plugin.html
and at the same time I am making another custom rte plugin to do some text modulation.
But only one of them is working using rte.coralui2 as categories.
and both icons are coming at the same location.
If I disable one js then another is working.
I have registered the plugin with different name and I have also used different variables.
I am not able to make the rte plugin button at different location.
Please suggest the possible solution.

it's possible you are overlaying rather than extending the rte.coralui2 category. I suspect your custom clientLibs are competing with each other and only one is available.

It seems like you are using the same steps provided in the blogpost for creating both the plugins and while doing that, you are using the below code twice with different icons :
if(items.indexOf(ExperienceAEM.TCP_UI_SETTING) == -1){
items.splice(3, 0, ExperienceAEM.TCP_UI_SETTING);
}
So, maybe, the icons are being added at the same place and only one of them is shown.
You should create ExperienceAEM.CuiToolbarBuilder Class only once and add both icons inside that class

Related

How to add custom javascript in Laravel-Backpack

Is there any way to add custom javascript?
I want to add custom javascript to some of the pages but it seems i am not able to.
Each default Backpack operation has its own CSS and JS file, in:
public/vendor/backpack/crud/css
public/vendor/backpack/crud/js
If you don't find one there, you can create one, and Backpack will pick it up in that operation's view (e.g. create.css or list.js).
Read more: https://backpackforlaravel.com/docs/3.5/crud-how-to#customize-css-and-js-for-default-crud-operations

TYPO3: Difference between Plugin and Custom Content Element?

I have to implement a media download feature. The backend user should be able to upload a media file, set the title, description, release date and so on... The result should then be visible and the file available for download in the frontend.
I am not sure what is the best way to achieve this: Plugin or Custom content element ?
Whats the main difference between the two and what would be the best solution for my task ?
Plugins are used for more complex rendering of records with different views (for example a list and a detail view of records stored somewhere in a storage folder). A custom content element (CE) should be preferred if all relevant data is stored in the record.
For your case, a Content Element seems to be the right solution. This kind of custom content elements can also be easily created with helpful extensions like "mask" which may takes you 10 minutes to create a custom CE.
https://typo3.org/extensions/repository/view/mask
If I understood you properly.
You can define plugin as type of "list_type", or as "CType" (if you need to code specific function, which is hard or unable to achieve using eg. Fluid contents) or even as another menu type defined as "menu_type".
These all types can be the same way made plugin, this separation for types are basically only for making it appear in different selectors. So:
your plugin defined as menu_type is to be selected in "Special Menus" content type in "Menu type" selector,
defined as list_type (so called) is to be selected in "Insert Plugin" content in "Selected plugin" selector,
defined as CType is totally new content type.
But they work the same way and this is easily to be switched using parameter in ext_tables plugin register call:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin( ['Label', $_EXTKEY.'_myPluginSuffix'], 'CType');
1) You can use the "File Link" content element and adapt its TypoScript (tt_content.uploads.20.renderObj) to your needs.
2) You can use the file_list extension and adapt its Fluid templates to your needs

Update Link Plugin in RTE Touch UI

I am looking for overriding the features of Link plugin in RTE, Touch UI. Basic feature I want to override root path, that by default is "/content/mysite/en" to "/content".
Its always points to "Website" . I want to select document from DAM
Other is I want to disable the auto-select feature of modify-link option.
Do someone have the idea to achieve this in TOUCH UI. In Classic i can do via changing LinkDialog.js but in Touch UI which will the file I need to change.
Thanks
You are looking for Links plugin in RTE for touch UI. There is a inplace editing plugin for specific purpose
And enabling/disabling features is as simple as what plugins are we adding under the edit config. Hope this helps.
You are probably looking for the links plugin, you can find it here: /libs/cq/ui/rte/core/plugins/LinkPlugin.js editing that is not recommended, you might want to create a new plugin that overrides this one and add the root directory you want.

Is it possible to create your own drag and drop Mailchimp template?

I'd like to create a custom drag and drop template so I can increase the design possibilities without losing the functionality. I can't find anything in their documentation.
I was hoping to create something like this, not sure if I'm missing something obvious but I can't find a drag and drop that allows for the different coloured background with columns too.
I could use a block of code but I can't edit the css styles so it wouldn't be responsive for mobile and also not very friendly for those who don't know html.
Rather old question, but to who it might be helpfull:
If you code your own template and upload it to Mailchimp you lose the 'drag & drop' system/UX interface with the different blocks. You are able to create repeatable blocks but then it works with a dropdown list. This is (in my humble opinion) not that user friendly and takes a while before you fully understand how to use the dropdown. I had to explain it to a client earlier today and took a while before they understood it, so I decided to write them a manual for it.
But the design you want to create should be possible to make with a standard MC template. In the 'design' tab you will find settings to control background colors etc.
Still not possible, answer from the Mailchimp support: "At the moment, it's not currently possible to code a drag and drop template completely--one of our drag and drop template layouts will need to be selected, but you can drop in Code blocks to get a little more control over the styling of certain sections."
Though, if it's any help, it is possible to fully custom code your own template, and then add in mailchimps special Template language to the template to open up sections as editable within the campaign builder--or even duplicate certain sections of content. It's not quite the same as the drag drop templates, but adds similar functionality. More info on working with template language can be found here: https://mailchimp.com/help/getting-started-with-mailchimps-template-language/
I know this is an old question, but while searching for this myself I stumbled upon a solution posted here.
Basically it is possible to code your own drag n' drop template, but the solution has not been documented.
Find one of the Mailchimp templates (either one of the basic templates or a custom template from the 'Themes' menu.
Use 'Inspect element' and copy the source code of the iFramed html-email.
Paste in your preferred HTML-editor and modify as intended
Create your own template from the 'Paste in code' mode
If you want custom modules to be added by default, edit using the menu 'Edit design' in the bottom of the screen.
Save and exit :)
I found part of the answer on another topic: [Is it possible to code drag&drop templates for mailchimp?
If you add the following code into your main content div or td it will enable the drag and drop block editor:
mc:container="body_container" mccontainer="body_container"
example:
<div mc:container="body_container" mccontainer="body_container"></div>
This code will add a block editor region to the preheader section:
mc:container="preheader_container" mccontainer="preheader_container"
For the header:
mc:container="header_container" mccontainer="header_container"
For the footer:
mc:container="footer_container" mccontainer="footer_container"
Note: It doesn't seem to matter what you call the mc:container. Creating a new container with a different name worked. Although using just mc:container tag seems to work at first by itself, the mccontainer (no colon) tag is required for it to save properly.
You can create your own drag and drop template you need to add the following into your html coded template where you want the 'drag and drop' feature to exist.
<div id="templateBody" mc:container="container_name" mccontainer="container_name" class="tpl-container">
<div mc:block="3502204" mc:blocktype="text" mcblock="3502204" mcblocktype="text" class="tpl-block"></div>
</div>
This can be repeated in your code multiple times for multiple insertions. I could not find documentation to indicate if the container name or block number needs to be unique, I did make it unique in my template.

What is the best way to enable content authors to add images with captions in Expression Engine

There's a module to do this in Drupal land, but I've been frustrated with the hacks that've been necessary in Wygwam. What is the best way to go about implementing this in such a way that you don't need to totally override the default image handling in ChannelImages/Wygwam?
Assets is a good suggestion, but I believe Devdemon's channel images might be a better fit for the workflow you're suggesting.
http://www.devdemon.com/channel_images/
Clients can add (and see) a caption and more and it's fully integrated with Wygwam and other editors. Devdemon's support is also excellent.
The Assets module from Pixel & Tonic allows you to double-click on the image (or any other file) and add metadata. You then have access to the metadata in your templates.
Check the screenshot: http://pixelandtonic.com/assets
You can also add metadata using the native File Manager. Click the edit icon from the File Manager and you'll see a few fields. You can use the File Entries tag to access it.
http://expressionengine.com/user_guide/modules/file/file_tag.html
I typically use Matrix with one column for the image, one column for the caption, and if a link is needed another column for the link. This of course works best if the image is in a fixed location within your template.
On possible way to accomplish this that I have used is to run some jQuery that looks for images within a certain area, and if they have alt attributes, rewrite the image tag within a tag with a tag inside.
so:
jQuery(document).ready(function() {
$('#page-content > .wrapper img').each(function(){
if($(this).attr('alt') !== undefined && $(this).attr('alt').length > 0){
if(!$(this).parent().hasClass('content-image')){
$(this).replaceWith("<figure class='content-image "+$(this).attr('class')+"'>"+$($('<div></div>').html($(this).clone().attr('class',''))).html()+"<figcaption>"+$(this).attr('alt')+"</figcaption></figure>");
}
}
});
});
will do just that. It's looking within a #page-content div for img tags with alt attributes. And then rewriting it as
<figure><img src='....' .... /><figcaption>This is the text that was in the alt attribute</figcaption></figure>
Soooo, that kinda works. The only caveat is that you had better not use any double-quotes within your alt text, or it will break thangs. Not the cleanest of solutions, but a solution, nonetheless.