This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class YourBrowserView: | |
def some_method(self): | |
original_lang = self.context.REQUEST['LANGUAGE'] | |
original_lang_binding = self.context.REQUEST['LANGUAGE_TOOL'] | |
target_language = 'de' | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configure> | |
<!-- Per request language overriding --> | |
<adapter | |
factory=".negotiate_language.NegotiateLanguage" | |
for="* your.addon.interfaces.IAddonInstalled" | |
provides="Products.PloneLanguageTool.interfaces.INegotiateLanguage" | |
/> | |
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.simplebox { | |
padding: 8px; | |
margin: 10px; | |
background: #eee; | |
border-radius: 8px; | |
border: 1px solid #ddd; | |
box-shadow: 0 1px 1px #fff inset, 0 -1px 0px #ccc inset; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configure | |
xmlns = "http://namespaces.zope.org/zope" | |
xmlns:five = "http://namespaces.zope.org/five" | |
xmlns:genericsetup = "http://namespaces.zope.org/genericsetup" | |
xmlns:monkey = "http://namespaces.plone.org/monkey" | |
i18n_domain = "tud.profiles.webcms"> | |
<!-- Disable Theming/Diazo in transformation chain if appropriate --> | |
<adapter | |
name="your.addon.disable_theme" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[test] | |
recipe = zc.recipe.testrunner | |
eggs = | |
${buildout:eggs} | |
defaults = ['--auto-color', '--auto-progress'] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Products.Five.browser import BrowserView | |
class AjaxView(BrowserView): | |
"""Various callable methods. | |
""" | |
def plus(self): | |
return int(self.request.form('a')) + int(self.request.form('b')) | |
def minus(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Idea is to install a helper/utility browser view (it does have no template, just methods to be called). | |
Please note, that these files should reside in /browser of your addon (except maybe template, when it's overriden). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configure | |
xmlns="http://namespaces.zope.org/zope" | |
xmlns:browser="http://namespaces.zope.org/browser" | |
xmlns:plone="http://namespaces.plone.org/plone" | |
xmlns:zcml="http://namespaces.zope.org/zcml" | |
i18n_domain="plone"> | |
<include package="plone.app.contentmenu" /> | |
<!-- VIEWS FOR PLONE SITE ROOT --> |