Plone multitheme

I have made some fragments, most of which you can see here: http://xweb14d.plana.dk:8081/Plone/fragments

With new fragments, it works like this.

  1. You add a file.pt with your text to the 'fragments' folder

For example:

my_fragment.pt

<section class="my_first_fragment">
    <h1>This is cool</h1>
    <p>some more stuff etc</p>
</section>

Now you can place this fragment on a page (after you have set the view to 'mosaic' view)

Of course, we dont always want the title to be 'This is cool', so we add a file:
my_fragment.xml to the same folder.
This file is a normal text file (just duplicate one already there)

my_fragments.xml would then look something like this:

(there are more lines that you need, but it doesn't matter so I keep them here for later reference)¨

<model xmlns:form="http://namespaces.plone.org/supermodel/form"
  xmlns:i18n="http://xml.zope.org/namespaces/i18n"
  xmlns:indexer="http://namespaces.plone.org/supermodel/indexer"
  xmlns:lingua="http://namespaces.plone.org/supermodel/lingua"
  xmlns:marshal="http://namespaces.plone.org/supermodel/marshal"
  xmlns:security="http://namespaces.plone.org/supermodel/security"
  xmlns:users="http://namespaces.plone.org/supermodel/users"
  xmlns="http://namespaces.plone.org/supermodel/schema">
<schema>
  <field name="title" type="zope.schema.TextLine">
    <required>True</required>
    <title>Title</title>
  </field>
</schema>
</model>

After you have restartet plone (or enabled / disabled the theme) you can now add a fragment and it will ask you to add a 'title'.

You can now change one line in my_fragment.pt to:

<h1>${view/data/title}</h1>

Now you can add tiles with configurable title.

... then do the same for the other fields

Suggestion: play around with the other fragments already present to see how it works.

jsc@Lenovo-G505:~/Plone/zinstance$ bin/buildout
Develop: '/home/jsc/Plone/zinstance/src/collective.multitheme'
Traceback (most recent call last):
File "/tmp/tmp__xjPr", line 14, in
exec(compile(f.read(), '/home/jsc/Plone/zinstance/src/collective.multitheme', 'exec'))
TypeError: compile() expected string without null bytes
While:
Installing.
Processing develop directory '/home/jsc/Plone/zinstance/src/collective.multitheme'.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/jsc/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1992, in main
getattr(buildout, command)(args)
File "/home/jsc/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 528, in install
installed_develop_eggs = self._develop()
File "/home/jsc/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 770, in _develop
zc.buildout.easy_install.develop(setup, dest)
File "/home/jsc/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 1020, in develop
call_subprocess(args)
File "/home/jsc/Plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 160, in call_subprocess
% repr(args)[1:-1])
Exception: Failed to run command:
'/home/jsc/Plone/zinstance/bin/python2.7', '/tmp/tmp__xjPr', '-q', 'develop', '-mN', '-d', '/home/jsc/Plone/zinstance/develop-eggs/tmpPSEIWDbuild'

It is showing this error

Can you check if it has something to do with this:

If you still have problems with, be sure to read this (the part about 'installation'):

If you still are having trouble, go to: https://plone.org and click on the 'chat button' bottom right, and probably someone at the plone dicussion channel can help.

I was not able to figure out so I asked in the discussion forum. Hope to get an answer soon.
Meanwhile, should we continue discussing issues over here or a gitter channel will be better.
Your suggestions @espenmn

I could not find you ..... can you try to download it again, and make sure you have all 'rights to content in that folder' (maybe owner changed when you downloaded it.

I tried downloading again but still issue persists aand what did you mean by above statement.

I have no idea what the error actually means, but make sure that the folder collective.multitheme and its content has the same permissions as the 'src' folder.

When you unzip a file, the owner etc is the user unzipping it, and maybe the buildout / plone user does not have the permissions to read / write in the folder.

permissions are same for both folders but still it gives this error
Can you tag someone who may know about this error so that he/she may help

Can you try to remove multi theme from the buildout and see if everything works ok.
If yes, can you try to download another package from Github.com/collecive and add that to buildout the same way, and see if that works.

(maybe this error has nothing to do with multi theme, but with your setup)

Also: Please ask on the forum (and hang around for a while, people dont answer straight away)

I tried removing collective.multitheme and it worked fine,
then i installed collective.easyform and Products.EasyLetter, it gave the same error again.

After some searching i found this


It gave the same error as mine. Maybe it is related. Can you have a look at it

I think it is something wrong with your setup, can you try the discussion channel.

Added another fragment (block):

http://xweb14d.plana.dk:8081/Plone/fragments/info-block

Here's a recipe for doing a fullwidth toggle that doesn't cause side scrolling (an issue I had with other fullwidth implementations).

A full width row only makes sense and looks ok when you don't have portlets available on a page, so please take this into account :wink:

Good catch. I've added a note to the gist.

Actually, portlets do not 'look correct on most themes anyway (because the (CSS) grid does not 'add up').
So if you need portals, you probably have to edit something anyway (?)… at least f you use columns

Is there a way to 'skip the mosaic part of the class'.

I want

 .grid-row-fullwidth

not

.mosaic-grid-row-fullwidth

(because then I can use already declared css)

For example, adding class 'container' to the row would take care of making the width the same as the 'not fullwidth content'

I think that all of this is a bit of a workaround.
The ideal way to do this is to use .container-fluid, this is the ¨proper way" to use bootstrap to get a fullwidth row.
The issue I'm coming across is that barceloneta and barceloneta based themes make liberal use of .container.

Unless I'm misunderstanding how bootstrap works, the ideal scenario would involve using .container and .container-fluid as they were designed. This would require some tweaks to barceloneta.

In the meantime, I think you could get away with using just .grid-row-fullwidth but I have not tested this.

I think this is similar to your approach:

The TB's CSS class .container-fluid is made for exactly this usecase, but:

  • .container-fluid and .container need to be next to each other, not contained
  • a .container-fluid can never break out of the boundaries of a .container
  • a .container-fluid should be used inside a .container to create a nested grid

So, to break out of a .container and get a full width row, you have to use one of the many hacks available.

As you can see in https://github.com/it-spirit/plonetheme.barcelonetang/blob/master/src/plonetheme/barcelonetang/theme/_less/theme.less#L160, the theme only creates a full-width row when there is no portlet defined. But that required some extra classes on the main column to work: https://github.com/it-spirit/plonetheme.barcelonetang/blob/master/src/plonetheme/barcelonetang/theme/rules/content.xml#L10-L15 (see the additional col-md-* classes).

Why can you not just add this to the add-on (in profiles and css )?

Plone Foundation Code of Conduct