writing html & js code in rich text editor in hippo, so the code functionality will reflect on site - hippocms

iam new in hippo cms. Is there any way to write html or java script code in rich text editor in hippo cms. so the functionality of any code (html or js) should reflect on pages of site.
function onclick(){
alert('hello');
}
This code should be add in rich text editor and on button click hello should be show on page.
Thanks in advance.

by default js will be removed from rich text fields. While the behavior can be disabled, generally speaking it is not recommended. This requires your editors to know not only JS/Html but also the interactions with your existing templates. It also allows attack vectors from inside your content, though for this they need access to the cms.
https://www.onehippo.org/library/concepts/document-types/html-fields/html-cleaning.html

Related

Customize Shopware 6 invoice PDF

I'll change the template of the invoice pdf template in shopware 6.
The template self seems to be stored in the database in the table "document".
The pdf is generated by php.
Anyone knows, how to get a complete own customized template ?
The configuration in the backend is not enough.
Thank you.
I wrote an example Theme some time ago, that is extending the basic template: https://github.com/mnaczenski/SwagDocumentTemplate
The core template is located here:https://github.com/shopware/platform/blob/trunk/src/Core/Framework/Resources/views/documents/base.html.twig
So you can overwrite the file in your own theme like described in the documentation by extending the twig file and placing it in the right folder: https://developer.shopware.com/docs/guides/plugins/themes/theme-base-guide
Extend in Twig: {% sw_extends '#Framework/documents/base.html.twig' %}
Folder structure: /src/Resources/views/documents/base.html.twig
Generated PDFs are stored in the database due to German law, they can't be changed after generation. But new generated PDFs are based on the template.
The easiest way to customize your invoice templates is to use the WYSIWYG Document Editor. You can either customize an existing document or create a completely new document. Using one of the predefined document templates provides a good starting point for you to apply your customizations. But you can also start with a blank page.
With the visual editor, you can easily add new elements and variables and see your changes in the live preview. This will save you a lot of time in comparison to going back and forth hundreds of times between making adjustments in your Twig Files and generating new PDFs for testing.
Here is a YouTube Video, which shows you how easy and fast you can edit all your documents: https://youtu.be/fGBMDmVMPvA
I am the developer, which created the WYSIWYG Document Editor Shopware 6 App. Feel free to ask me any questions about the App. I am happy to help you.

Where is the shopify editable html?

In a traditional website I would simply open the 'contact' page and add the line then upload. But i'm having difficulty understand the multiple components of shopify's theme, sections, snippets.
So my question is if I want to add a simple text line say in the homepage, where would I add this html?
It depends entirely on the theme you are using. A lot of modern themes have draggable sections which can be accessed via Themes - Customize.
If your theme doesn't have this functionality, or any functionality to add text to the homepage, I'd be surprised. But if you need to edit it by editing the code directly you can access the pages via Themes - Actions - Edit Code. The homepage will usually have a name of index.liquid.
Rather than just adding your text in there, though, I recommend you learn how to add snippets and sections to your website. It makes future edits much easier and doesn't take long at all to learn.
The beginner's guide to building shopify themes with sections
Shopify: Theme Sections

Sitecore experience editor interface for scripts

we are moving from content editor to experience/page editor as our primary editor interface and one of the fields we deal with is a raw multiline field for dropping custom script into the pages by editors. Eg campaign management, google tag manager or similar
Currently if I render a SC:fieldrenderer via webforms the script tags are becoming part of the dom on render.
What is the best approach to tackle this type of interface requirement via experience editor in SC7 webforms - it looks like sitecore isnt outputting to an input tag in order to supress and contain the code and is instead outputting to a span which is then flowing into the dom.
Thanks for any direction

CSS automatically disappearing from Content Editor web part

I'm adding some css in content editor web part on my aspx page and css applies well but as soon as I stop editing page css disappears. When I open the web part again I can see empty
<style> </style>
tag. Any idea ?
This page has custom web part and even if I add some inline css to the web part it applies when page loads but disappear when page finish loading..
I'm trying this on Firefox.
Content editor web part does not let you embed style and script elements directly in the page.
Instead, content editor web part lets you link to a css or js source stored in a sharepoint library.
Alternatively, use SharePoint Designer (if installed in your company) to inline style and script.

How to dynamically associate html content through Onet.xml in Content Editor WebPart?

We are using SharePoint Foundation 2010
We have a custom site definition where in Onet.xml we have placed a Content Editor Web Part on a Custom ASPX page having encoded html content in it just like how it is described in this article.
Issue with this approach is that following this approach makes the HTML content static and can not be dynamically changed for each user.
Is there a way i can make Onet.xml refer an HTML file from a SharePoint folder e.g. Layouts, so that when content gets changed in the HTML file, it gets reflected for each user on their custom page ?
Got it, I think I will be using Page Viewer Web Part instead of Content Editor Web Part which would make my life simpler. I would add an html file path from say Layouts folder and refer it in my Page Viewer Web Part. This way my content would remain dynamic.