Plone multitheme

You could put a notice on a site.
Something like the privacy reminder that you sometimes see on the bottom of the Google home page:

But ins't that something https://pypi.python.org/pypi/collective.messagesviewlet or https://pypi.python.org/pypi/collective.notices is made for?

Looks so. How do I not know about these things :slight_smile: ?

very nice.
It's very helpful if you put up the tile configuration page like you have done on http://xweb14d.plana.dk:8081/Plone/fragments/countdown-fragment

I know (it was the plan to do it for all), it is just that this is taking so much time already....

The theme is (more or less) made up of 3 parts.

  1. (Demo) content and a control panel (so you need to install the theme from the add-on control panel)
  2. Different layouts that can be chosen from the control panel
  3. Fragments ( html snippets with corresponding .py and .xml files (and js & css if needed) )

##important
If you add a new tile or modify the xml or .py file, you will have to disable/enable the theme in the theming control panel (or restart Plone)

##To do
We need more fragments, more layouts and some diazo rules to have different 'navigations'.
The best way to start is probably to make some tiles with layout.

Look at the tile:

Currently, it has no special layout, and no settings.
What we want for this fragment is to be able to change the text (Create awesome etc) , PRE MADE BLOCKS, butten text and link.

This is done by making a info_block.xml file. In the info_block.xml file you add the settings we want (open the other xml files and look at the code and copy)
Then we want to make as many layouts as possible for this fragment, for example

https://mobirise.com/blocks/info-mobirise-4.html

If possible, we try to not have color definitions in the CSS files, but instead add CSS classes, taken from the settings.

The syntax of the settings is:

${view/data/somesetting} 

for the user entered data

and

${view/get_something} 

for

def get_something(self):
     return 'something'

in a py file


To use the variables in the html.pt file, do something like:

You can also choose which css file to load (but try to use CSS classes and put everything in same CSSfile if possible)

The syntax would be:

<link rel="stylesheet" href="++theme++multitheme/css}/${view/data/css_file}.css">

For layouts: you find plenty inspiration at https://mobirise.com/blocks/testimonials-mobirise-4.html

PS: I can make another demo site if you want to work / show you work TTW

@espenmn
(a) How to integrate collective.multitheme in Plone?
(b)I understood that we need to make fragments/blocks with different functionalities (eg. parallax, accordian, etc.). For that we will make different xml files. How to make those xml files?

a) It would be nice if you manage to 'fork' the GitHub repo (which is probably something you need to do sooner or later.

Anyway: you can do you changes etc and send me the files for now. Do it like this:

  1. Go to: https://github.com/collective/collective.multitheme and click the "download" button.

  2. Place the unzipped folder (which will be named collective.multitheme) in /path/to/your/plone/src. (there will be a README.txt file in that folder with: 'Packages in eggs that you develop should go in this directory'

  3. In you buildout.cfg make sure it contains

    eggs =
    Plone
    collective.multitheme

(and some more lines, Pillow etc)

Longer down add one line to the develop section, so it reads:

develop =
    src/collective.multitheme

Now, run bin/buildout and (re)start plone.

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