How to configure TinyMCE to add more info about widget magento 2 - widget

How can I add more info about magento 2 widget in TinyMCE, like title, or another field? Now only widget type is visible, but I want to concatenate widget type with widget title, or if is possible on hover widget type in TinyMCE, show widget title.

I found the solution. The widgets are encoded in
lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js:125
I can change from here the information that appears on the editor.

Related

How to add HTML attributes in generated widget from Victoire

I would like to add an "onclick" attribute in buttons widget generated by Victoire CMS, in order to track click events by GoogleAnalytics. How can I do it ?
Cheers
So I suppose you're talking about a Widget Button here.
It's not planned to allow users to add as many attribute as they want on this widget. However you have multiple solutions.
1 - Use a Render Widget (recommended)
Replace your Button Widget with a Render Widget and call a route from on of your application Controller. You can add as many parameters as you want : in your case it can be useful to change the Google Analytics event name depending on the button you create.
2 - Themes (quickest)
Each Widget view can be overridden by using a custom Theme. For example, here you can create the file app/Resources/VictoireWidgetButtonBundle/views/showGoogleAnalytics.html.twig.
Copy the code from the original view vendor/victoire/button-widget/Victoire/Widget/ButtonBundle/Resources/views/show.html.twig and change it as you want.
Then you just have to edit your Widget in Style mode and select the theme you just added. If your theme doesn't appear here, clear your cache or check that the path is corresponding to the path described above.
However, this method add a new available Theme for all your buttons and it can cause errors if your client try to apply this Theme in another Button. That's why we recommend the first solution.
3 - Use an HTML Widget (quick & dirty)
HTML Widget allow you to add your custom HTML code.
U can use this:
<button onclick="myFunction()">Click me</button>
myFunction() is a function in javascript which will be done when you click on a button.
Every attribute can be added by setAttribute("attribute", "value");

Reusable HTML Blocks in Sitecore

I'm looking for a way to create a reusable HTML widget for a website run on Sitecore 8. My original idea was to create a data template that basically consisted of a single Rich Textbox. The idea is that you could drop any number of instances of these widgets on a placeholder and it would render out the HTML from each instance of the widget on the page and in the correct placeholder.
Example:
A content item called /products/my-product is based off of "Product" data template
It consists of some fields on the Product template (maybe product name, price)
I'd like the ability for the content editor to quickly drop one or more instances of the HTML widget on the page (say, in the right rail or in a different placeholder on the sublayout. I know I could just throw a "notes" field on the product template, but I'd like to make it more dynamic so that they can add several instances of this HTML widget and place them anywhere they desire.
I quickly realized that because we need the ability for multiple instances of this widget, a data template was not enough because each instance of the widget would needs its own data to populate on the front. Thus, my idea was to allow the content editor to add HTML widgets as a child of the current item (so each item would have its own instance data). I don't think this will work because I don't know of a way to have these children tell the parent page which placeholder to put them in, so laying them out is a problem.
I also thought about somehow setting the placeholder name as a parameter or field on the data template for the HTML widget, but I couldn't figure out how to get Sitecore to dynamically add them to a placeholder when it glues everything together.
Is there a way to achieve what I'm trying to do? Seems like a reusable HTML (or other kind of widget, for that matter) would be a fairly common need. I feel like there's an easy Sitecore way to handle this that I'm missing and overcomplicating the solution.
From what I understand, you're looking for Datasource field of a component.
Basically you:
Create a data template which contains fields necessary for your component
Create a set of items using that templates
Allow authors to select one of them as the Datasource for your component.
It's built in Sitecore functionality.
Check blog post http://firebreaksice.com/using-the-datasource-field-with-sitecore-sublayouts/ or google for Sitecore datasource.
Other links:
http://www.nonlinearcreations.com/Digital/how-we-think/articles/2014/03/4-patterns-Sitecore-component-development.aspx
http://www.nonlinearcreations.com/Digital/how-we-think/articles/2015/04/Sitecore-templates.aspx
EDIT:
Read about Datasource Location field (defining the repository of datasources location) here: http://www.sitecore.net/learn/blogs/technical-blogs/getting-to-know-sitecore/posts/2011/01/handling-presentation-component-settings.aspx
Read about Datasources and MVC here: http://jockstothecore.com/sitecore-mvc-item-maze/

With orchard CMS, Is it possible to add a widget to a zone in the admin?

Is it possible to add a widget to a zone in the admin? So you see the widget while administering. (As the admin theme uses zones too)
If not is it possible to do something similar?
Not currently, not exactly. If you look at the TheTree module, it does add UI elements to the admin, but not exactly a widget.

Sencha Touch: One view with different content each time

I am very beginner on Sencha touch and need some help.
I have implemented a list and a view which contains one image, some text and a video. I want to use the same view but with different content with respect to which item in list is clicked. For example if the first item is clicked then show the view with image1, text1, and video1, if the second is clicked then the view with image2, text2 video2 and so on...
My thought is to create a json which contains all the content (image1, text1, video1 and image2, ...). My issue is how can I implement this? How can I retrieve the data and show different content in the same view? Is there any tutorial?
You should look at Xtemplate, it takes a template which defines how data is structured in HTML form and the data(json obj) which is rendered using templates. In you case you should create details view on list itemtap event and show it after using setData. If another item in list is tapped hide/destroy the details view and show/create details view and setData which is related to that particular list item(record). Alternatively you can use Navigation view

Add subtitle to tab in tableView using appcelerator titanium

i have a table view containing multiple tabs, on this tabs i want to add picutre, title and a description lets say as a subtitle. Im new in the appcelerator environment and i have no idea how to add a subtitle, didn't find anything on google, thanks alot..heres my code
var data = [
{leftImage:'images/squiggle.png',title:'Puppy', hasChild:true,test:'/picture_events.js'},
{leftImage:'images/squiggle.png',title:'Fish', hasChild:true,test:'/picture_events.js'}
];
what is the property i can add that let me add a subtitle on the tab ??
to do this you have to create a more complex row.
See this section of the appcelerator wiki
http://wiki.appcelerator.org/display/guides/Using+TableViews#UsingTableViews-Improvingthedataandviewlayout