Lost content with Plone Mosaic

I use plone mosaic on a clean Plone 5.08 installation.

I create a document, change the view to mosaic layout.

After switching to edit mode for this mosaic page and selecting a layout the following warning occurs:

WARNING plone.protect error parsing dom, failure to add csrf token to response for url http://www.myserver.com/++contentlayout++default/basic.html

Then I add a rich text tile and the following info occurs:

INFO ZPublisher.Conflict ConflictError at /VirtualHostBase/http/www.myserver.com:80/myPlone/VirtualHostRoot/testfolder/testpage/@@edit/@@z3cform_validate_field: database conflict error (oid 0x86a4d0, class plone.app.drafts.draft.Draft) (1 conflicts (0 unresolved) since startup at Wed Mar 7 17:43:50 2018)

This happens for each tile.

But I can edit the page with all the mosaic stuff.

After saving and reopening for edit the content is partially or fully lost.

The versions that I use are:

plone.tiles = 1.8.3
plone.subrequest = 1.8.1
plone.app.tiles = 3.0.3
plone.app.standardtiles = 2.2.0
plone.app.blocks = 4.1.1
plone.app.drafts = 1.1.2
plone.app.mosaic = 2.0rc8
plone.formwidget.multifile = 2.0
plone.jsonserializer = 0.9.5

Does anyone know how to fix this, are these known errors, what should I do?

Any suggestion is appreciated.

I had something that could be related (Rich)Text tile breaks Mosaic Layout - #2 by datakurre :

Do you lose your content after save ? (or is it missing on edit ?)

In my case, it had something to do with the rich text tile (so I use one that I made myself)

SO: try to make a tile WITH rich text tile and another without and see if there is any difference.

Just for the record, in case someone else faces this.
With this version pinning Mosaic works fine in Plone 5.08:

plone.tiles = 2.0.0b3
plone.subrequest = 1.8.1
plone.app.tiles = 3.0.3
plone.app.standardtiles = 2.2.0
plone.app.blocks = 4.1.1
plone.app.drafts = 1.1.2
plone.app.mosaic = 2.0rc8
plone.formwidget.multifile = 2.0
plone.jsonserializer = 0.9.5

Where did you find those pins? These ones are shown on the Github repo:

The pins you can find in the www don't work, they throw errors and produce garbage code.

So I tried different pinnings on my own, and this works fine now with clean code.

Take a look at the official Plone Docs:

https://training.plone.org/5/ttw/mosaic.html

This is heavily outdated!

Wow, thanks. That's weird... Could you please file an issue here https://github.com/plone/plone.app.mosaic/issues and include your pins?

Thanks for the tip @joplono I intend to test mosaic under 5.1 as soon as possible and this could be real helpful if it does not work correctly.

Done!

image

2 Likes
1 Like

Thank you @tkimnguyen, that's very kind of you :slight_smile:

Now I'm curious where I got mine... I have a Linode running Plone 5.0.8 and here's what I have:

plone.app.mosaic = 2.0.0rc4
plone.tiles = 1.8.1
plone.subrequest = 1.8
plone.app.tiles = 3.0.1
plone.app.standardtiles = 2.0.0
plone.app.blocks = 4.0.0
plone.app.drafts = 1.1.1
plone.app.mosaic = 2.0.0rc4

The latest plone.app.mosaic is 2.0rc8

I think mosaic is very useful.
You can build quite complex sites with a few mouseclicks.

I also recommend the mosaic addon tile collective.tiles.sliders (I use Version 0.4).

I hope there will be much more mosaic addon tiles in the near future.

Did you see my 'multi theme'-approach: https://community.plone.org/t/plone-multitheme/ ?

You can see the fragment-tiles at:

http://xweb14d.plana.dk:8081/Plone/fragments

login info is at: Plone multitheme

Wow! That looks great!

Is this a complete theme or is it an addon used with mosaic?

And Is this just a preview or available in pypi?

When I add collective.multitheme in my buildout it cannot find a distribution.

… it became quite a lonely project so it is not released on pypi yet.

That said: it works perfectly OK, but …

  1. There are a few (two, I think) fragments that are not working (the upload fragment, the 'fullpage-fragment', and maybe one more

2). A few things lacks CSS (good layout). These are basically 'admin screens' etc.

You find it here:

If 'the community wants', I could release a '0.1' version.

PS: There is a 'control panel where you can modify the theme'. You can also change colors on some of the themes by using LESS variables and 'rebuild it'

I vote for release!

So if I get you right I could install your product without losing my actual design.

But I must admit I've never installed an addon other than via buildout / pypi , so I have no idea what to do with github. :frowning:

No, this is a theme, so you current design will change.
It will look like the demo page, or one of the alternatives you can see in the control panel:

http://xweb14d.plana.dk:8081/Plone/@@medialog_controlpanel

( for some of the themes the colors can be changed at: http://xweb14d.plana.dk:8081/Plone/@@resourceregistry-controlpanel )

Note: the Custom colors in the control panel is not working (I can not figure out how to use them)

That said, it is possible to copy the fragments to your own theme, you just need to copy/edit some CSS etc ( this you will have to figure out yourself, as 'there is a lot of stuff going on, probably best is to just copy css from the demo site

Hm - as I will lose my actual design this seems not useful to me.

Maybe I could figure it out, regarding your last paragraph.

I've just looked into your files in your theming-controlpanel.

Assuming that I want to use the accordion: I've found the accordian_block.pt and accordian_block.xml and the accordian.css.
But now I am totally lost as I have no idea how to integrate these files to my theme/site.

Anyway, you did a great job @espenmn!
I think Plone needs more of these UI elements just to impress the plebs who only want to use Plone and have no ambition to become a developer, - speaking of myself of course.

In this regard the way collective.tiles.sliders integrates in Plone (as stated above) fits more into my usecase.

1 Like

What you need to do is:

  1. Install collective.themefragments tile (add it in buildout, install it the usual way)
  2. Add a folder to your theme ( name it fragments) and add the files to that folder (PS: you might have to copy some of the JS for some of the 'fancy' tiles
  3. Disable / enable your theme (or restart Plone)
  4. edit the CSS ( since it uses variables that your site has not defined).

You could extract the css files from the demo site and just edit the colors if you have to.

Yes and no.
I agree with you as far as there are not too many 'tiles' and too many add ons (which might break your site when you upgrade in the future).
The idea of doing it this way is:

  1. Add as many tiles as possible to the theme
  2. Then the user customizes the theme (or copy them to another theme) and remove what he/she does not need (so the UI do not get cluttered).
  3. Edit the tiles to fit your needs (add another field, change css class, reorder fields etc)
  4. Rename the tiles if you want ( in the manifest file).

By looking and copying from whatever is already in the theme, basically everyone should be able to make a 'tile' TTW (through the web), without any 'programming'.

yes I used to think it was not possible to install directly from github, but it is, buildout has many tricks, try something like

collective.multitheme = git https://github.com/collective/collective.multitheme.git rev=tags/2.0.7

in the case of collective.multitheme drop the 'rev' part since there is no release this far, the 'master' branch will be collected by default