How to change editor of K2 Joomla 'extra fields'? - joomla

Is it possible to change the editor used when inputting data in 'extra fields' in the K2 content component for Joomla?
When pasting large swathes of content from MS Word, clicking 'Save', then re-opening the article, the data is gone.

No, it is not possible to change the editor. And why do you want to change the editor? What is that you are trying to input?

It is possible, just not through configuration parameters. I edited the 'extraFields' view (admin -> components -> com_k2 -> views -> extraField -> view.html.php) and added a Javascript include to load a different editor.

Related

how to open Spotfire web player in first page?

is there a way to open spotfire web player in first page always.
My web player link is opening analysis in different pages not on the home page.
Much appreciated
thanks
Create one Document Property "OnOpenAnalysis" with DateTime:-
Write ironpyton script to that document property
ScriptName
Write below line in Script
Document.ActivePageReference = Document.Pages[0]
Add DataFunction using Open R,
use below code
input <- systime()
assign output as document property and select document property "OnOpenAnalysis"
you are done.
Make sure that when you save your analysis, you save it showing the first page.
Then modify so that state isn't kept per user. Go to Edit -> Document Properties -> Library tab, and uncheck "Remember personalized view for each Web Player user":

CKEditor format tags and a custom <small> tag

Is there a way to add a tag to the format dropdown that would wrap the text in <small></small> tags?
Editing config.js as follows causes a runtime error:
config.format_tags = 'small;p;h1;h2;h3;pre';
probably because <small> is not block level?
The reason of the runtime error is, that js can not find CKEDITOR.config.format_small.
You have to do two things:
Search for CKEDITOR.config.format_h6 in ckeditor.js and add CKEDITOR.config.format_small={element:"small"};. Then the error is gone, but you can not see the entry yet.
open the languagefile you want (e.g. en.js) and add "tag_small":"small text".
now CKEditor supports the small tag.
This works for me, I hope it works for you too.
If I want to add a custom section tag to format tags, this work for me:
1. Go to config.js, add
config.format_tags = 'h1;h2;h3;h4;h5;h6;section';
config.format_section = { element : 'section' };
2. Then open the languagefile you want (e.g. en.js) -> lang/en.js
search for "tag_pre":"Formatted", and add "tag_section":"Section".
If you're looking to wrap text in a certain tag, you can also achieve this with the Style dropdown as well.
First, configure your editor to allow styles at /admin/config/content/formats/manage/full_html. Replace full_html with whatever editor version you want to modify
Drag the Styles button to the active toolbar if it isn't already there
Add items to "Styles Dropdown" tab under CKEditor plugin settings
Each option takes the form css_selector | Human Visible Name so in your case, you'd add small.my_element_class | Super Special Small or something similar.
Instructions abbreviated from this post: https://www.axelerant.com/resources/team-blog/drupal-8-custom-styles-in-ckeditor

Cannot add inline image/picture to a Rich Text control

I have a Rich Text control bound to a Body field in my Domino Document data source ... all is good for formatting text , :) emoticons and the usual stuff. The problem is when I try to paste or upload an inline image I get the following error shown in the inline image (hmmmm, works here) ...
Most likely a mis-understanding of the steps:
Select the file
Click on upload image (<-- that one gets lost on lots of users)
Click OK
For a more advanced user experience:
Use the RichText Editor Evolution from OpenNTF. That makes your life much easier.

Entering custom HTML-code in EZ Publish's TinyMCE will not work

I've added the "html"-button to TinyMCE on an EZ Publish site so that the users can write custom html into the xmlblock-field. But html-code with div-, img- and other tags get stripped when the user saves. If I use the ''-tag I assume that the html-code inside will be rendered as viewable html-code on the web page, instead of actual html-content.
How can I enable html-editing in the ezoe?
This is what I'm trying:
Click the html-button in TinyMCE.
Write html-code:
<div style="text-align:left; width:496px; margin-left:auto; margin-right:auto;">
<img id="Image-Maps_fottoey" src="some url.jpg" width="496" height="249" alt="" />
</div>
Click "Publish". When viewing the page it has no trace of the html-code from step 2.
I've tried to add the following to my override content.ini.append.php:
[literal]
AvailableClasses[]
AvailableClasses[]=html
as per http://acidre.com/blog/ez-publish-saisir-du-contenu-directement-en-html/ but that doesn't help.
Update:
It works now with the changes that I made to content.ini.append.php. This change adds "html" as a literal option and gives you a new icon in the editor, which Nicolas pointed me to (looks like a sheet of paper and is on icon row 2, first section before the Omega-icon.
When you add the html-source in the purple edit field, the editor will create links if it discovers that you've pasted inn urls. These links are blue in the editor. You must break these links with the "Break link"-icon to the far right on icon row 1. There should be no blue hyperlinks in the editor when you save. If you've managed this, the published page should display your custom html nicely :)
The usual way of enabling literal HTML in eZ Online Editor (based on TinyMCE) in eZ Publish is to uncomment the
AvailableClasses[]=html
configuration directive in an override of content.ini. A bit more of information here : http://share.ez.no/forums/setup-design/custom-tag-stop-while-running/comment64177.
Then, the literal tag should be available to editors through the literal button in TinyMCE (this button looks like a text sheet). The dropdown proposed in the pop-up menu shows 'html'.
Allowing raw html requires a few editorial guidelines and full trust in editors, but i am sure you are aware of this.
Cheers,
Nicolas

Magento - adding a new field to the product options in admin

I'd like to add a new tab to the 'catalog->manage products->product information' page in the admin. Underneath the 'images' tab, I'd like to add a new tab for video, with a simple text input for adding a video url, which I can then grab for the frontend.
Anyone any ideas where the files are that I need to edit? I've been looking for the last couple hours with no joy. I found the list of current options in Mage_Catalog_Model_Resource_Eav_Mysql4_Setup but can't figure out how to add to them...
Seems it gets some from Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs. If I copy one of the tab sections here and change the title to Video, I can get it to display in the tabs on the left. But how do I then add the options for it?
What you are trying to do, from the sounds of it, is to create a custom field and add it to your catalog data. The good news is that you don't need to muck around in the PHP for that.
Head to Catalog -> Attributes -> Manage Attributes and create a new attribute for yourself called "Video URL" (or something to that effect). This will probably be a text field, and you may want to hide it from comparison on the frontend of the site (select "No" for all those boxes at the bottom of the form).
Once you've created an attribute, you will need to add it to an attribute set. If all your products are of one "type", and if you didn't create any other attribute sets, this should be only one step. Head to Catalog -> Attributes -> Manage Attribute Sets and create a "New Group" called "Video" and drag your new video url attribute into it. Save the attribute set and you should now have your new tab.
The only complication from what I read in your post could be positioning it underneath the images tab. Magento adds several tabs statically (the long way, in the PHP) and doesn't generally obey ordering of the tab groups. Consider the time tradeoff.
Hope that helps. Thanks,
Joe
Per your other comments, for the URLs a simple attribute would work but files would tend to be more difficult. To add a custom tab, as you said, you can edit (or in the case of a plugin, override) Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs::_prepareLayout and add your tab. You'll need to add a block or template to display your tab contents.
After that, you'll need to store the data somewhere. Looking in Adminhtml/controllers/ProductController, you should be able to hook into the catalog_product_prepare_save event to get data from $event->getRequest() and push it onto the product or save another entity as necessary.
I'm not sure how well file saving semantics would work on a product, so you may want to do your own data storage in the extension and then provide something like a getVideoForProduct method to retrieve it.
Then the only thing left to do is modify the catalog/product/view.phtml template file to include your thumbs and create a controller in your extension to provide a modal w/ the video (or do it in JS).
I know that's a bit of a general answer, but it's the rough path you would need to take for tabs. Let me know if any specific part of that is unclear.
Thanks,
Joe

Resources