Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Deco , finally!!!

No description
by

Rok Garbas

on 10 October 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Deco , finally!!!

Rok Garbas, http://garbas.si Deco, finally!!! Deco Toolbar Tiles Deco is a layout editor! <div style="dispay:none;"
data-iframe="toolbar"
data-iframe-resources="jquery.js;jquerytools.js;...">

<div id="plone-toolbar">
... actions / buttons ...
</div>

</div> iframe.js <div data-tile="@@plone.app.texttile/23232af328ab8787cff23"></div>
<div data-tile="@@plone.app.fieldtile?fieldName=title"></div> Transient Tile Persistent Tile @@plone.app.texttile/23232af328ab8787cff23 Plone integration - plone.app.tiles View Add Edit Delete @@add-tile/plone.app.texttile @@edit-tile/plone.app.texttile/23232af328ab8787cff23 @@delete-tile/plone.app.texttile/23232af328ab8787cff23 back end entirely based on Twitter Bootstrap front end grid system also based on Twitter Bootstrap grid system Current Integration in Plone Deco Lite Dexterity behaivour
(only avaliable for dexterity content types). Works with latest stable Plone (4.2.2). Working only on "content area". Portlets are still working as before. Examples 1. Simplest tile possible configure.zcml <configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:plone="http://namespaces.plone.org/plone"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
18n_domain="example.tile">

<genericsetup:registerProfile
name="default"
title="example.tile"
directory="profiles/default"
description="Installs the example.tile package"
provides="Products.GenericSetup.interfaces.EXTENSION"/>

<include package="plone.app.tiles" />

<plone:tile
name="example.tile"
title="My tile"
description=""
add_permission="zope2.View"
permission="zope.Public"
class=".tile.MyTile"
for="*"
layer="*"/>

</configure> from plone.tiles import Tile


class MyTile(Tile):

def __call__(self):
return u"<html><body><p>Hello world</p></body></html>" tile.py profiles/tile/registry.xml <?xml version="1.0"?>
<registry>
<record name="plone.app.tiles">
<value purge="false">
<element>example.tile</element>
</value>
</record>
</registry> 2. Tiles without Deco configure.zcml <browser:viewlet
name="plone.logo"
manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
class="plone.app.layout.viewlets.common.LogoViewlet"
template="logo_viewlet.pt"
permission="zope2.View"
layer=".interfaces.IExampleTileLayer"
/> logo_viewlet.pt <div tal:attributes="data-tile string:${view/navigation_root_url}/@@example.logotile/1"></div> configure.zcml <plone:tile
name="example.logotile"
title="Logo tile"
description=""
permission="zope.Public"
class=".tile.LogoTile"
schema=".tile.ILogoTile"
template="logo_tile.pt"
layer=".interfaces.IExampleTileLayer"
/> tile.py from plone.supermodel import model
from plone.autoform import directives as form


class IImageTile(model.Schema):

form.widget(picture='plone.app.imagetile.imagewidget.ImageFieldWidget')
picture = NamedImage(
title='Select an image',
required=True,
)

title = TextLine(
title='Image title',
required=False,
)


from plone.tiles.tile import PersistentTile


class LogoTile(PersistentTile):

def __init__(self, *arg, **kw):
super(LogoTile, self).__init__(*arg, **kw)
self.portal_state = getMultiAdapter((self.context, self.request),
name=u'plone_portal_state')

@property
def portal(self):
return self.portal_state.portal()
@property
def logoName(self):
bprops = self.portal.restrictedTraverse('base_properties', None)
if bprops is not None:
return bprops.logoName
else:
return 'logo.jpg'
@property
def logoTitle(self):
return self.portal_state.portal_title()
@property
def logo_tag(self):
return self.portal.restrictedTraverse(self.logoName).tag(
title=self.logoTitle, alt=self.logoTitle)
@property
def navigation_root_title(self):
return self.portal_state.navigation_root_title()
@property
def navigation_root_url(self):
return self.portal_state.navigation_root_url()

@property
def actions(self):
return [
{'name': 'edit','url': '@@edit-tile','title': 'Edit'},
{'name': 'remove','url': '@@delete-tile','title': 'Remove'},
] logo_tile.pt <html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xml:lang="en" lang="en" i18n:domain="plone">

<body tal:define="scales view/@@images;
thumbnail python: scales.scale('picture', scale='mini');">

<a id="portal-logo"
title="Home"
accesskey="1"
tal:attributes="href view/navigation_root_url;
title view/navigation_root_title"
i18n:attributes="title">

<img tal:condition="thumbnail"
tal:attributes="src thumbnail/url;
width thumbnail/width;
height thumbnail/height" />

<img tal:condition="not:thumbnail"
tal:replace="structure view/logo_tag" />

</a>

<ul style="display:none" class="plone-tiletype-actions">
<li tal:repeat="action view/actions">
<a href="#"
tal:attributes="href python:action.get('url','#');
class python:action['name'] and 'plone-tiletype-action-' + action['name'] or ''"
tal:content="action/title">Action</a>
</li>
</ul>

</body>
</html> logo_tile.js $(document).ready(function() {
var logoTile = $('#portal-logo', window.parent.document)
.parents('[data-tile]').ploneTile();
logoTile.show();
}); Final thoughts @garbas <iframe name="toolbar" id="toolbar"
scrolling="no" frameborder="0" border="0"
allowtransparency="true"style="border: 0px...">
<head></head>
<body>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquerytools.js"></script>
...

<div id="plone-toolbar">
... action / buttons ...
</div>

</body>
</iframe>
Full transcript