Liferay WYSIWYG editor copy from Word - liferay

I saw Liferay's WYSIWYG editor has option to copy content from Word. But I notice that the formating (especially headings) don't match and the images are not copied. Is it a known issue?
Does Liferay support integration with any WYSIWYG editor in which I can copy content from word as is without losing the formatting and images?

It is a known issue that will be fixed in Liferay 7.0.0 M1 - see https://issues.liferay.com/browse/LPS-29493 .
Liferay uses CK Editor, which can copy the Word content including styles. CK Editor needs to be configured to preserve the styles. The options are:
pasteFromWordRemoveFontStyles - http://docs.ckeditor.com/#%21/api/CKEDITOR.config-cfg-pasteFromWordRemoveFontStyles
pasteFromWordRemoveStyles - http://docs.ckeditor.com/#%21/api/CKEDITOR.config-cfg-pasteFromWordRemoveStyles
To preserve the styles in Liferay 6.2, you need to create a JSP hook and customize the configuration of the editor.
To test the functionality without the hook, you can open any web content article and modify the configuration of the current CK Editor instance. Run the following commands in JavaScript console of your browser:
CKEDITOR.instances['_15_articleContent'].config.pasteFromWordRemoveStyles = false;
CKEDITOR.instances['_15_articleContent'].config.pasteFromWordRemoveFontStyles = false;
Pay attention to the HTML source of the copied document - there will be a lot of inlined styles. It may now be exactly what you want. You may need some additional processing to clean up the document. That would mean another hook.

Related

How can I stop Generate Customization Script from deleting/ignoring my added ASPX code?

It seems that sometimes, not always, when I add code to an ASPX page via Customization Project -> Screens -> -> Actions -> Edit ASPX and click Generate Customization Scripts, it deletes what I added. What I'm adding doesn't contain any errors as I write it in VS and then copy and paste it into the editor. This sometimes work and sometimes does not. When it does not work, I cannot make changes no matter what I do.
Is there a way to prevent Generate Customization Scripts from deleting the code I add?
Is there a way to edit and see changes to ASPX files after publishing via Visual Studio instead of using the browser editor?
Are you testing your changes directly in the aspx page that you are customization to an existing screen?
I assume this is the case and I have found when I go and look at the generate script changes to the page it already includes my changes because I added them to the page and this process simply loads the same contents. Because its already there my guess is this is why the "changes" are ignored.
Here is what I do and maybe it will help you:
Save the standard aspx screen (before changes) somewhere to revert back later.
Make/test your changes to the aspx page
Save the modified aspx screen changes somewhere
Restore the original aspx screen (saved from step 1)
Go to your customization and paste in your changes to the screen > edit aspx
Click Generate Customization Script
Now your changes should be in place and saved.
This doesn't apply if you are writing your own aspx as this is included as a file in your customization project. This is in reference to modifying an existing aspx file from Acumatica or another customization.
The Generate Customization Scripts button does a very strict validation which will sometime remove valid markup. There isn't much you can do about this.
If you are modifying custom screens, you can modify the .aspx file directly from the {WebsitePath}\CstPublished and {WebsitePath}\Pages folders.
Modifications done to files in CstPublished will be reflected instantly after refreshing the web page.
Modifications done to files from the Pages folder will updated the customization project, as you should get a conflict pop-up in the Project Editor screen.
My preferred workflow is to modify CstPublished files, test in the screen and if it works, I copy paste my change to the Pages folder.

Crafter CMS - Is there a way to link to another CMS document in RTE?

I need to be able to link to another document on the site in the rich text editor by browsing and selecting it without manually typing in a URL to the document. Is this possible with Crafter?
I looked through the documentation about the RTE configuration plugins, and it looked like maybe the insert-component or insert-linkBrowse plugins would do it, but I made an attempt to configure them and add an item in the RTE editor controls, but it had no effect. I couldn't find any documentation specifically about those plugins, so everything I did was just a (wrong) guess.
There is nothing out-of-the-box that addresses this use-case. Options:
Build your model such that it has a repeating group of item pickers after the RTE and then followed by another RTE if need be (this means it won't be inside the RTE), which would make things more structured and arguably cleaner
Build it as a customization (it'll be a TinyMCE plugin)
Wait for the feature to be built by Crafter CMS: https://github.com/craftercms/craftercms/issues/1412

Sitecore 8: Sharing Layout among different languages

I have a slight problem here and a doubt. I have created a page which has three components added in three different placeholders. This page was created for English version. I need this page and the components to get added in German version of the page as well.
I read a few articles that illustrate the use of layout deltas and "Final layout" feature of Sitecore 8 but got a little confused over this matter.
Article1
Also, I have checked the __Renderings setting in /sitecore/templates/System/Templates/Sections/Layout and the Shared field is checked. Still the layout is not shared.
Am i missing any settings ? Do I need to every time create both versions i.e. repeat the layout steps for German versions as well ?
All suggestions welcomed.
If you are using Sitecore 8.0 and adding the component via the Experience Editor then you will need to add the components to each language variation of the Item, i.e. once for English and once for German. This is because the components are stored against the Final Layout field when added through the Experience Editor and the field is language specific.
The only option you have is to add the components to the Shared Layout manually by selecting the Presentation > Details from the tabs.
If you need to add the same components to all language variations at the same time then I suggest you upgrade to Sitecore 8.1 which will enable you to do that via Edit all versions option in the ribbon:
Edit: As of Sitecore 8.1 update-1, the Shared Layout can be edited using the "Layout Switcher" under the Presentation tab:

Modx rich text input field for template variable

I'm new to modx Rev and I am trying to set the input field for a template variable so that it uses my chosen richtext editor. If I set the input field as rich text I just get a 1 line text field. If I set the editor as Textarea then thats all I get a text area field - there is no option in the drop down under input options for "html" as some tutorials suggest. Have I not enabled something? I am a bit lost being new to the app.
I had the same problem. My solution
Go to Package Management and search for TinyMCE.
Download it. Then click Install.
Set the Input for my Template Variable to RichText
Click on Resource then Template Variables and now I see the TinyMCE editor
Which rich text editor have you installed?
Is Rich Text enabled for the resource you are editing, if not then I think a different editor will be used.
Try downloading TinyMCE instead through package management, and use that one instead. Might wanna uninstall ACE to make sure it doesn't interfere somewhere.

Displaying code snippets in Sharepoint wiki

Is there a way to get SharePoint to display code snippets in a pre-formatted way?
Currently if you insert any code, it just looks exactly like the rest of the text. Anything would be better than nothing.
I found hilite.me which produces html styled code which you can insert into a sharpoint wiki.
It supports a number of languages and styles and is an online app.
No because MOSS's wiki is just a new page with the word "wiki" attached to the link.
Even though this is an old question, I have yet another solution that possibly didn't exist at the time the question was asked:
You can create a GitHub Gist and use the embed code for the Gist on the SharePoint wiki page. This is especially useful if you are already using Gist, want to share the code snippet in multiple places aside from the wiki, and/or want to keep a history of the code snippet separate from the rest of the wiki page.
To use an embed code without the script tags being stripped, go to Insert > Embed Code in the ribbon when editing the page:
This solution assumes that you are using an IDE that already formats the code for you.
Some of the other answers would be better if you have a raw text file.
While editing a Sharepoint Wiki page:
Copy code from IDE to new MS Word doc
Highlight all in MS Word: Ctrl+A
Copy again inside MS Word
Switch to wiki page, Paste
Continue editing wiki or save
Works fine with Eclipse as IDE. Might be able to paste straight from VS to SharePoint.
If you have code snippets you will reuse in multiple pages, Use a similar copy/paste technique to save or upload htm files into a SharePoint document library and then insert a "Page Viewer Web Part" to view the htm inside a different page.
Not that I'm aware of if you're specifically using the Wiki feature. Your wiki entries are stored like rows in a table as far as I know. If you're not using the wiki you can use the syntax highlighter tool. It's all javascript. http://code.google.com/p/syntaxhighlighter/
For several weeks we are using Telerik Rad Editor
One of the tools is "Format Code Block"
You may see it here : http://demos.telerik.com/aspnet-ajax/Editor/Examples/Default/DefaultCS.aspx
If you install the RadEditor for MOSS .. we will get this amazing tool in Wiki pages too.
So this is not a great answer but for us it was better then the default. You can write your wiki in a tool like Windows Live writer (WLW). WLW has an add in for a code formatter. If you write your wiki page via WLW with the code formatter you can then go to the Wiki page and select "edit HTML source." You can then copy from WLW to the wiki page and get good styling.
Best way I have found is to use tohtml.com
You can cut and paste your code into it and it will generate html that you can past into your sharepoint wiki
you can use prisimjs to show code snippets. When you add prisimjs and css you can use like this;
p { color: red }
if you want easier solution to use prisimjs, you can check this:
http://yasingokhanyuksel.blogspot.com.tr/2017/07/sharepoint-code-syntax-highlighting.html
If you want this for modern pages, there is the Source code content webpart from Qualitem.
https://spfxhub.com/packages/qualitem-source-code-content-web-part
Disclaimer: I am a co-developer.

Resources