Message Boards

Alloy Editor & Web Content

Nikita Laitinen, modified 3 Years ago.

Alloy Editor & Web Content

Junior Member Posts: 44 Join Date: 12/18/19 Recent Posts

Hi!

Is that possible to upload a web content portlet inside the alloy editor's body?
I would like to be able to write a blog post and insert web content portlets in any place of the blog.

I know one approach. It looks like: do ajax request to API from the editor in editing mode, get web content, publish a blog post. The problem is If the web content is changed the published blog post will save the old version of the web content

Any ideas, recommendations, please?

I use Liferay 7.0

Thanks!

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Alloy Editor & Web Content (Answer)

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

Hi,

You need to have a Custom EditorContributor for Blogs , you can refer below for that

https://help.liferay.com/hc/en-us/articles/360017882652-Modifying-an-Editor-s-Configuration 

Also you can refer below BaseMentionsEditorConfigContributor ,which shows the list of user in similar way you can list down webcontent and on selection palce  the content in editor

 

You can refer below source code

https://github.com/liferay/liferay-portal/blob/7.0.x/modules/apps/collaboration/mentions/mentions-web/src/main/java/com/liferay/mentions/web/internal/editor/configuration/BaseMentionsEditorConfigContributor.java

 

Lee Jordan, modified 2 Years ago.

RE: Alloy Editor & Web Content

Expert Posts: 449 Join Date: 5/26/15 Recent Posts

Configure the editor is the wrong way for that ...
Ask Liferay: "Hey Liferay; Can we get editor configurations in the Control Panel"?

You need to figure out how to allow iFrames in Blogs, I think it's an AntiSammy thing in Blogs. I think the best way to do it is create a widget page that would be hidden from navigation and not deleted. Add the web content to that page. In the ellipsis menu choose Configuration and then the "Sharing Tab".

You should get an iFrame from the Sharing Tab

Something like

iframe frameborder="0" height="100%" src="sdsadasd.com/widget/web/site/overview/-/com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_iHIjvwa7qcFi" width="100%" /iframe

You can then use this web content in a blog post without having to change the alloy editor configuration. Nobody should need to configure this editor with a customization, it's too hard.