Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Alloy Editor & Web Content
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!
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
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.
Powered by Liferay™