Files
odoo_source/addons/website
Arthur Detroux (ard)andqsm-odoo 84f6010fc1 [FIX] mass_mailing, *: fix options conflicts between modules
*: web_editor, website

Prior to this commit, the template structure for declaring the snippet
options used in a specific context (website, mass_mailing, ...) made it
hard to easily modify SnippetOptions defined in web_editor.

Indeed, the structure was as below
```xml
<template>
    <t t-call="web_editor.snippet_options" />
    ... Additional Options ...
</template>
```
If someone wanted to alter the behaviour of an option from web_editor
for their module, they had 2 solutions

- To extract that option inside another template, extend that template
inside their own module, remove its call from web_editor and instead
call manually the option inside each module (preferred method)

- To impact the web_editor template directly with an extension instead
of a new primary template or override JS options using include or
replacing an option inside the registry.

The second solution was often used but created extra code to make sure
that other modules were not impacted... and it was often not properly
done. For example:

- [1] and [2] introduced javascript code inside the web_editor options
  and isolating it by checking if they are in fact, inside mass_mailing.

- [3] adds code in mass_mailing mentioning JS classes of website, and
  actually broke parallax for website (after [5]).

- [4] broke the image transform option for website (after [5]).

- [6] added some shapes for mass mailing images but ended up adding them
  for the website builder too.

- [7] created different images options for mass_mailing... but ended up
  impacting website options too. Half of those can actually either be
  put in web_editor to improve everything or just in mass_mailing to not
  break the website.

- ...

This commit tries to fix everything "the right way" in master (and will
be backported for the recent 16.0). Other stable fixes will need to be
made to restore the website options in a stable way.

To fix that, this commit changes the structure to
```xml
<template inherit_id="web_editor.snippet_options" primary="True">
    <xpath ...>
        ... Change existing options ...
    </xpath>
    <xpath expr="." position="inside">
        ... Additional options ...
    </xpath>
</template>
```
This allows each module to modify the existing web_editor templates
without impacting it and each other. They can even change the JS
behaviour by using an XPath to replace the data-js of an option, and
changing it to their own extended version of the JS option.

[1]: https://github.com/odoo/odoo/commit/f296992317e96562c66bd7ad59a5080d6c551ed5#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R134-R138
[2]: https://github.com/odoo/odoo/commit/cd403480f90cf7103651f3be818a14b06d3c73ca#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R175
[3]: https://github.com/odoo/odoo/commit/e9237ae8004502a3071e8ceb132d9dac11fe00b3#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R372
[4]: https://github.com/odoo/odoo/commit/ff422df49201be6ed7baa11ef3deb5b9a41042a7
[5]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[6]: https://github.com/odoo/odoo/commit/24a4c7f897d4db6bdf0f3cbfc91a3ce7351241a2
[7]: https://github.com/odoo/odoo/commit/d0c2d8e9a1436a8eaf263797c790329f81d7615b

closes odoo/odoo#99850

Related: odoo/design-themes#597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-10-04 17:01:17 +02:00
..
…
2022-09-30 09:31:52 +02:00
…

Odoo Website Builder

Get an awesome and free website, easily customizable with the Odoo website builder.

Create enterprise grade website with our super easy builder. Use finely designed building blocks and edit everything inline.

Benefit from out-of-the-box business features; e-Commerce, events, blogs, jobs announces, customer references, call-to-actions, etc.

Edit Anything Inline

Create beautiful websites with no technical knowledge. Odoo's unique 'edit inline' approach makes website creation surprisingly easy. No more complex backend; just click anywhere to change any content.

"Want to change the price of a product? or put it in bold? Want to change a blog title?" Just click and change. What you see is what you get. Really.

Awesome. Astonishingly Beautiful.

Odoo's building blocks allow to design modern websites that are not possible with traditional WYSIWYG page editors.

Whether it's for products descriptions, blogs or static pages, you don't need to be a professional designer to create clean contents. Just drag and drop and customize predefined building blocks.

Enterprise-Ready, out-of-the-box

Activate ready-to-use enterprise features in just a click; e-commerce, call-to-actions, jobs announces, events, customer references, blogs, etc.

Traditional eCommerce and CMS have poorly designed backends as it's not their core focus. With the Odoo integration, you benefit from the best management software to follow-up on your orders, your jobs applicants, your leads, etc.

A Great Mobile Experience

Get a mobile friendly website thanks to our responsive design based on bootstrap. All your pages adapt automatically to the screen size. (mobile phones, tablets, desktop) You don't have to worry about mobile contents, it works by default.

SEO tools at your finger tips

The Promote tool suggests keywords according to Google most searched terms. Search Engine Optimization tools are ready to use, with no configuration required.

Google Analytics tracks your shopping cart events by default. Sitemap and structured content are created automatically for Google indexation.

Multi-Languages Made Easy

Get your website translated in multiple languages with no effort. Odoo proposes and propagates translations automatically across pages, following what you edit on the master page.

Designer-Friendly Templates

Templates are awesome and easy to design. You don't need to develop to create new pages, themes or building blocks. We use a clean HTML structure, a bootstrap CSS.

Customize every page on the fly with the integrated template editor. Distribute your work easily as an Odoo module.

Fluid Grid Layouting

Design perfect pages by drag and dropping building blocks. Move and scale them to fit the layout you are looking for.

Building blocks are based on a responsive, mobile friendly fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases.

Professional Themes

Design a custom theme or reuse pre-defined themes to customize the look and feel of your website.

Test new color scheme easily; you can change your theme at any time in just a click.

Integrated With Odoo Apps

e-Commerce

Promote products, sell online, optimize visitors' shopping experience.

Blogs

Write news, attract new visitors, build customer loyalty.

Online Events

Schedule, organize, promote or sell events online; conferences, trainings, webinars, etc.