plone

create an instance of one class from another class

不羁的心 提交于 2019-12-13 23:12:27
问题 I created browserView class named as "bdrMenuView" . It should be like "class bdrMenuView(BrowserView):" . and the class contains the method named as "createPictMenu" . The whole class should be class bdrMenuView(BrowserView): def createPictMenu(self): Now i have written one more class named as LogoViewlet . It should be like "class LogoViewlet(ViewletBase):" . and the class contains the method named as "update" . The whole class should be class LogoViewlet(ViewletBase): def update(self): Now

How to add the is_folderish attribute to Dexterity objects?

試著忘記壹切 提交于 2019-12-13 19:50:45
问题 The .is_folderish attribute is used in many places. For example when setting an object as the default view or when activating discussions on an object. My first question is how to check is an object has that attribute set. I tried using the bin/instance debug with something like this: >>> app.site.news.is_folderish ... AttributeError: is_folderish I imagine that I can't reach attributes on that way because app.site.news is a wrapper to the object that has that attribute. My second question is

How to customize Plone-5's folder_contents

痞子三分冷 提交于 2019-12-13 17:25:48
问题 I want to customize Plone's folder_contents to add an 'edit'-link to each listed item, like show in the image below. How would one do that? 回答1: There is a file called table.xml but I have not tried it. It is very cumbersome to change something internal in Plone. 回答2: Looks like the right way to do it is loading the module and changing it's prototype: var structure = require('mockup-patterns-structure'); structure.prototype.defaults._default_activeColumns = ["ModificationDate","EffectiveDate"

Script Python using plone.api to create File appear error WrongType when set a file

偶尔善良 提交于 2019-12-13 15:38:36
问题 Dears, I'm creating a script python to mass upload files in Plone site, the installation is UnifiedInstaller Plone 4.3.10. This script read a txt, and this txt have separation with semicolon, the error appear when set up a file in a new created item. Bellow the Script. from zope.site.hooks import setSite from plone.namedfile.file import NamedBlobFile from plone import api import transaction import csv portal = app['Plone'] setSite(portal) container = portal['PROCESSOS'] with open('CARGA/C008

How to add new collection criteria in Plone 5?

拈花ヽ惹草 提交于 2019-12-13 15:23:33
问题 I add a new choice field named course to Dexterity Content Type File in a new created instance. In order to use the field "course" as criteria in /++add++Collection, I follow this guide and add these to the file registry.xml in plone/buildout-cache/eggs/plone.app.querystring-1.3.14-py2.7.egg/plone/app/querystring/profiles/default/registry.xml: <records interface="plone.app.querystring.interfaces.IQueryField" prefix="plone.app.querystring.field.course"> <value key="title">course</value> <value

Webfont not working in Internet Explorer

笑着哭i 提交于 2019-12-13 14:49:57
问题 I'm using a webfont which is hosted by fonts.com. It renders normally in Chrome, Firefox, Safari, but not in any version of Internet Explorer. Even IE10 is not rendering it. The project runs with Plone. The css file is registered normally via Cssregestry. But this shouldn't make any difference to a normal site. To all who are familiar with Plone, this is the registry: <stylesheet bundle="aufhebenswert" id="http://fast.fonts.com/cssapi/47bc7d51-3bb8-428d-a077-06d3d6f54eae.css" insert-after="*"

How do I link the logo to an external site?

本小妞迷上赌 提交于 2019-12-13 05:15:21
问题 I would like to change the link in the Plone logo viewlet. By default it points to the Plone site root, I want to point it to a location that is not within the Plone site. I tried writing a custom logo viewlet, but this seems very complex for such a small change. What is the best way to do this? 回答1: The easiest way to change the Logo link is to override the logo viewlet template. This is best done with z3c.jbot. You need to add z3c.jbot to your projects custom product, by adding it as a

Adding a custom field to Plone groups

空扰寡人 提交于 2019-12-13 04:40:28
问题 Using Plone 4.2, how can I add a field/property to Plone groups? Beside default ones (name, title, description, email) I'd like to have one more. 回答1: You could try your luck with http://localhost:8080/Plone/portal_groupdata/manage_propertiesForm and report the results :) At least Site Setup's group edit form seems to be generic enough to support arbitrary number of fields (of all types). 来源: https://stackoverflow.com/questions/10172524/adding-a-custom-field-to-plone-groups

Is it possible to use collective.alias in a 3.1.7 plone?

百般思念 提交于 2019-12-13 02:42:55
问题 Is it possible? I would like to install it in a 3.1.7 Plone instance, but don't want to enter the buildout incompatible versions hell. I tried in my machine, adding along with collective.alias extends = http://good-py.appspot.com/release/dexterity/1.0a2 and [versions] plone.recipe.plone = 3.1.7 plone.recipe.zope2instance = 3.6 But starts downloading a lot of stuff, until it downloaded Plone 4 egg itself as a dependency. I couldn't find a source of really pinned versions for 3.17 that would

Extending SearchableText using collective.dexteritytextindexer

a 夏天 提交于 2019-12-13 02:27:57
问题 I am trying to extend the SearchableText index for my content type. I have succeeded in getting multiple fields to be included by marking them as indexer:searchable="true" in the model file. However I can't extend the SearchableText from my type's py as follows: class IMyBehavior(form.Schema): dexteritytextindexer.searchable('description') description = schema.Text(title=u'Precis') alsoProvides(IMyBehavior, IFormFieldProvider) class MySearchableTextExtender(object): adapts(IMyBehavior)