Install an add-on (collective.multitheme)

Hello all,
I've got a problem, I think I'm doing good but I'm sure I missed something...
I try to install the multitheme add-on.
So, I follow the @espenmn tutorial:

  1. I download the multitheme add-on on github https://github.com/collective/collective.multitheme

2)I unzip in the SRC folder

3)I modify the Buildout.cfg file like this:


  1. I save the file

  2. I run this buildout.exe by double clic

6)I launch instance.exe in foreground mode

  1. When I start my website, multitheme doesn't appear in the add-ons...

Can anybody tell me where is/are my mistake(s)? I'm a bit desperate now....
Thanks !

@espenmn told me that I need to modify another buildout.cfg, the one in a ZInstance folder. But I checked and I don't have any zinstance folder...
How is that possible?
I'm on Plone 5.0.8

The installer supports 2 types of installation: a single instance installation and a zeo installation (with potentially multiple instances).

I am using the second installation kind: there the relevant buildout.cfg is in the folder named zeocluster. For the first installation type, it might be called zinstance.

Look at the top level of your Plone installation. At depth one (i.e. in the immediate child folders), you should find a single buildout.cfg. This is the one, you would change.

Hello Dieter,
First of all, thank you for your msg on my post!
I’ve got a question: In the single buildout.cfg file of the top level of my plone installation, there was not so much txt.
I added the whole content of the buildout.cfg file of the multitheme folder in the single buildout.cfg file like this:

# NOTE: This file should be copied into the buildout root directory. It
# should never be checked in to version control so that the environment
# stays the same over time.
_# _
# $ cd path/to/your-buildout
# $ cp profiles/buildout.cfg_tmpl buildout.cfg

[buildout]
index = https://pypi.python.org/simple/
# Once copied to the root, select the environment you are releasing to
# by uncommenting the appropriate line below.
extends =
# profiles/local.cfg
_ profiles/testing.cfg_
# profiles/prod.cfg
# profiles/staging.cfg

extends = http://dist.plone.org/release/5.0.8/versions.cfg
show-picked-versions = true
extensions =
_ mr.developer_

parts =
_ instance_
_ test_
_ code-analysis_
_ createcoverage_
_ releaser_
_ i18ndude_
_ omelette_
_ robot_
_ npm-install_
_ grunt-compile_
develop = eggs/collective.multitheme

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs =
_ Plone_
_ Pillow_
_ collective.multitheme _

[code-analysis]
recipe = plone.recipe.codeanalysis[recommended]
directory = ${buildout:directory}/src/collective
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg.,omelette
flake8-max-complexity = 15
return-status-codes = True

[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage

[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}

[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
defaults = [’-s’, ‘collective.multitheme’, ‘–auto-color’, ‘–auto-progress’]

[robot]
recipe = zc.recipe.egg
eggs =
_ ${test:eggs}_
_ plone.app.robotframework[debug,ride,reload]_

[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser

[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude

[npm-install]
recipe = plone.recipe.command
command = cd ${buildout:directory}; npm install .; cd ${buildout:directory}/src/collective/multitheme/theme; npm install .

[grunt-compile]
recipe = plone.recipe.command
command = cd ${buildout:directory}; grunt compile
update-command = cd ${buildout:directory}; grunt compile

[versions]
# Don’t use a released version of collective.multitheme
collective.multitheme =

PyYAML = 3.12
argh = 0.26.2
args = 0.1.0
check-manifest = 0.35
clint = 0.5.1
colorama = 0.3.7
configparser = 3.5.0
coverage = 3.7.1
createcoverage = 1.5
enum34 = 1.1.6
flake8 = 3.3.0
flake8-blind-except = 0.1.1
flake8-coding = 1.3.0
flake8-debugger = 1.4.0
flake8-deprecated = 1.1
flake8-isort = 2.1.3
flake8-pep3101 = 1.0
flake8-plone-api = 1.2
flake8-plone-hasattr = 0.1
flake8-polyfill = 1.0.1
flake8-print = 2.0.2
flake8-quotes = 0.9.0
flake8-string-format = 0.2.3
flake8-todo = 0.7
i18ndude = 4.0.1
isort = 4.2.5
mccabe = 0.6.1
pathtools = 0.1.2
pkginfo = 1.4.1
plone.recipe.codeanalysis = 2.2
plone.testing = 5.0.0
pycodestyle = 2.3.1
pyflakes = 1.5.0
requests-toolbelt = 0.7.1
robotframework = 3.0
robotframework-ride = 1.5.2.1
robotframework-selenium2library = 1.7.4
robotsuite = 1.7.0
selenium = 2.53.6
setuptools = 24.3.0
testfixtures = 4.13.4
twine = 1.8.1
watchdog = 0.8.3
z3c.jbot = 0.7.2
zc.buildout = 2.5.3
zc.recipe.egg = 2.0.3
zest.releaser = 6.9
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

But when I double click on plonecms/buildout/env/Scripts/buildout.exe and launch instance.exe in foreground, the multitheme add-on doesn’t appear in my add-on list…
Could you help me? I’m blocked for 2 days now on this problem, I need help :frowning:

The develop definition in your buildout.cfg lists source folders representing extensions. Thus, you should likely use src/collective.multitheme (or wherever you have put its sources) rather than eggs/collective.multitheme.

Of course, after a change of buildout.cfg, you rerun buildout.

I'm desperate... I changed the eggs/collective.multitheme by src/collective.multitheme and I ran buildout again but it doesn't work... :frowning:

Here is my actual buildout.cfg:

 NOTE: This file should be copied into the buildout root directory. It
 should never be checked in to version control so that the environment
 stays the same over time.
 
     $ cd path/to/your-buildout
    $ cp profiles/buildout.cfg_tmpl buildout.cfg

[buildout]
index = https://pypi.python.org/simple/
 Once copied to the root, select the environment you are releasing to
 by uncommenting the appropriate line below.
extends =
    profiles/local.cfg
    profiles/testing.cfg
    profiles/prod.cfg
    profiles/staging.cfg

extends = http://dist.plone.org/release/5.0.8/versions.cfg
show-picked-versions = true
extensions =
    mr.developer

parts =
    instance
    test
    code-analysis
    createcoverage
    releaser
    i18ndude
    omelette
    robot
    npm-install
    grunt-compile
develop = src/collective.multitheme


[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs =
    Plone
    Pillow
    collective.multitheme 


[code-analysis]
recipe = plone.recipe.codeanalysis[recommended]
directory = ${buildout:directory}/src/collective
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg.,omelette
flake8-max-complexity = 15
return-status-codes = True


[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage


[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}


[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
defaults = ['-s', 'collective.multitheme', '--auto-color', '--auto-progress']


[robot]
recipe = zc.recipe.egg
eggs =
    ${test:eggs}
    plone.app.robotframework[debug,ride,reload]


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser


[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude


[npm-install]
recipe = plone.recipe.command
command = cd ${buildout:directory}; npm install .; cd ${buildout:directory}/src/collective/multitheme/theme; npm install .

[grunt-compile]
recipe = plone.recipe.command
command = cd ${buildout:directory}; grunt compile
update-command = cd ${buildout:directory}; grunt compile


[versions]
 Don't use a released version of collective.multitheme
collective.multitheme =

PyYAML = 3.12
argh = 0.26.2
args = 0.1.0
check-manifest = 0.35
clint = 0.5.1
colorama = 0.3.7
configparser = 3.5.0
coverage = 3.7.1
createcoverage = 1.5
enum34 = 1.1.6
flake8 = 3.3.0
flake8-blind-except = 0.1.1
flake8-coding = 1.3.0
flake8-debugger = 1.4.0
flake8-deprecated = 1.1
flake8-isort = 2.1.3
flake8-pep3101 = 1.0
flake8-plone-api = 1.2
flake8-plone-hasattr = 0.1
flake8-polyfill = 1.0.1
flake8-print = 2.0.2
flake8-quotes = 0.9.0
flake8-string-format = 0.2.3
flake8-todo = 0.7
i18ndude = 4.0.1
isort = 4.2.5
mccabe = 0.6.1
pathtools = 0.1.2
pkginfo = 1.4.1
plone.recipe.codeanalysis = 2.2
plone.testing = 5.0.0
pycodestyle = 2.3.1
pyflakes = 1.5.0
requests-toolbelt = 0.7.1
robotframework = 3.0
robotframework-ride = 1.5.2.1
robotframework-selenium2library = 1.7.4
robotsuite = 1.7.0
selenium = 2.53.6
setuptools = 24.3.0
testfixtures = 4.13.4
twine = 1.8.1
watchdog = 0.8.3
z3c.jbot = 0.7.2
zc.buildout = 2.5.3
zc.recipe.egg = 2.0.3
zest.releaser = 6.9
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

Here is my 1st level folder:

And the collective.multitheme folder is in the src folder. He's named "collective.multitheme"

!!!! Stupid question alert !!!!! To run the buildout, I just need to double click on C:/plonecms/buildout/env/Scripts/buildout.exe ???
Thanks a lot, I really need this help that's for my graduate thesis..

You likely must also extend the eggs and maybe even the zcml definition in the [buildout] section of your buildout.cfg. The eggs definition determines which eggs (i.e. extensions) are made available to your Plone. Most modern extensions ensure that their ZCML registrations are activated automatically. If an extension has ZCML registrations but does not automatically activates them, the zcml definition allows to do it explicitly.

The eggs extension has the form

eggs += collective.multitheme

(to be put inside the [buildout] section). Eventually similar for the zcml extension.

Hello Dieter,
I added eggs +=collective.multitheme and zcml +=collective multitheme in the [buildout] but it doesn't work...What am I doing wrong...?
Isn't that a problem with the " Once copied to the root, select the environment you are releasing to
# by uncommenting the appropriate line below." part?
I'm really lost...

Antoine, for recent versions of Plone (including 5.x) you should no longer need to add an add-on in the zcml because as Dieter says modern add-ons already do this automatically. I checked and collective.multitheme does this too (as per https://github.com/collective/collective.multitheme/blob/master/setup.py#L70)

I wonder if this part of your problem. Buildout looks for the buildout.cfg file in its current directory. When you double-click on buildout.exe it's possible that it's picking up another buildout.cfg file in the same directory, C:/plonecms/buildout/env/Scripts. Do you have more than one buildout.cfg file? The one you want it to use is in C:/plonecms/buildout

You don't say why you're following his tutorial... (nor where to find his tutorial).

When I look at the instructions that come with collective.multitheme it should be very simple: you add one line to the eggs variable, as per https://github.com/collective/collective.multitheme/blob/master/README.rst#installation then you run buildout

you need to lok at the buildout.cfg in your instance ( or zeo folder. Not the buildout.cfg in collective.multitheme (which is use when you want to 'just work with multitheme'

You do not need the the zcml entry.

That said: you should download collective.multitheme to our src folder and add it to the src section as wll.

It will work without the src part, but you will not get all the options added lately. ( I was hoping to get some help to release a new version so I have not released for a while)

Ah, I understand now. @espenmn what help do you need to release a new version?

(ps: I might restart the demo site now and then for the next week (when I develop something 'more' )

I will give it a try this morning

Note: the hidden option in manifest.cfg requires checkout of themefragments from GitHub.

Also: the front page: http://xweb14d.plana.dk:8081/Plone is constructed in setuphandlers (so if you see something wrong or typos please edit them there).

Do you mean that collective.themefragments is a requirement of collective.multitheme? Or do you really mean that a git checkout of collective.themefragments is required?

yes it is a requirement (but it is defined as a require ment so I dont think you have to think about that).

But the option showing how to hide tiles will not 'work', which doesn't not really matter, but will be very useful if you want to use it on a real site, since the users will not see the tiles that you dont want to use. If you look through the videos you will see it here https://youtu.be/Kr98zm3K3Vk?t=1m10s )

So if you want that option, you will have to check out themefragments ( https://github.com/collective/collective.themefragments/commit/10d6510a9a5a1dc9fdabb1230a47bc2a4bedf939 )

Oh I may have a reason to my problems:
When I double clicked on Buildout.exe, it ran the windows cmd, and the text was so fast i coulndt read it. So I made a real quick screenshot and seen that the cmd told me "
While:
initializing
Error: Couldn’t open C:/plonecms/buildout/env/scripts/buildout.cfg
The buildout.exe is trying to open an other buildout who doesn’t exist because my buildout.cfg is in C:/plonecms/buildout/buildout.cfg
What should I do? Move my buildout.cfg to the scripts folder?

I am no Windows user. This means my advice is likely not optimal: start the "command" program (maybe called command or cmd) -- this should give you a terminal window where you can type in commands. Change the current directory to the one containing your buildout.cfg (when I remember right, the command is chdir dir (maybe cd)). Start buildout via bin\buildout.

It would probably work (and then you can figure out a better way later)