Rick Hurst Web Developer in Bristol, UK

Menu

Category: plone

useful CSS hack – replace an image with an.. er.. image

via hicksdesign:-


img {
width: 0;
padding-left: 20px;
background: url(mynewimage.gif) no-repeat;
}

I have a real-world example of where this would be useful in plone skinning – in some places inline images are still used for icons (here and there – they are generally being phased out). At the moment I usually set them to display:none and apply padding and background image to the containing element, but this may be a better solution.

archived comments

Just wanted to say thanks for this. 🙂 It is exactly what I need for over-riding some annoying hard-coded images in a blog I’m skinning.

Sarah Lewis 2007-05-04 16:45:04

Things to do in Seattle

As I mentioned before a few of us from netsight are going to Plone Conference 2006 in Seattle. Besides actually attending the conference i’ve been reading up on other things to check out while i’m there. I plan to visit a few of these coffee shops with wifi and i’ve also just read that the blog business summit is also on at the same time – maybe there could be a bit of cross-fertilisation there as many of the plone bloggers will be at Plone conf?

moving a plone site

something worth bearing in mind when moving a plone site (or upgrading a plone site, or any other process that requires a full export and reimport of a plone site). If like me you have a habit of installing lots of products just to see what they do, it is worth uninstalling them (removing any objects in the site created using them first) before you do the export. Otherwise you might just find yourself having to track down all the products you used at any point on the site before it will let you import the zexp.

configure what types are available as default items in plone folder

From Plone 2.1 onwards you can choose to use a content item within a folder as the default view of the folder. By default all the usual suspects are available: page, news item etc, but if you have custom types they will not be available without some configuration. To configure the types that are available to be used as default use zmi -> portal_properties -> site_properties (add type to list in default_page_types)

Incidentally, it took me ages to find this and I eventually found the answer I was looking for by searching my own gmail archives of the plone users list. The post referenced this how to

(The information I needed was actually in the first paragraph!)

do not show home item in Plone 2.5 navigation tree

zmi -> portal properties -> navtree properties -> (uncheck includeTop)

in case anyone is wondering why you want to do this, in this case I have a site where there is folder in the root called home. Next I have to figure out how to redirect the actual home page there and collapse the breadcrumbs so it doesn’t show home twice, or .. hmmm.. maybe change the home item to display the site name, that would be nicer

UPDATE: to change the first item in portal breadcrumbs, customise global_pathbar.pt (in plone_templates), to set the default page of a plone site, use zmi-> properties tab (change default_page property)

Plone appears on the spammers radar

As Plone becomes more and more mainstream, it has appeared on the radar of spammers. They are targeting community sites where people are allowed to sign up without moderation, and using scripts to create loads of false members. A weakness in the way user portraits are handled is being exploited to inject javascript redirects in, so that people visiting a profile page (or anywhere else where portraits are displayed?) are redirected to other sites. If you are affected by this, or don’t want to be – here’s how to sort it out

zope portal catalog – the difference between metadata and index contents

I always forget this – when doing a zope catalog query, you are searching the index contents not the metadata contents. If there is a field in your metadata that you want to be able to use as a variable in a portal catlog query, you need to add the field as an index and then reindex the catalog (or just the new field within the catalog).

For example I was generating some custom tabs for the contents of a particular folder within a plone site and I wanted the catalog query to exclude any items with the “exclude_from_nav” field set to True. It wasn’t listening to me. The solution was to go to portal_catalog -> indexes and add a new field index ‘exclude_from_nav’ (i.e the field name needs to match the meta data field name). Tick the box next to the new ‘exclude_from_nav’ and hit the reindex button. Now the catalog is aware of this field and which objects in the zodb are set to true and false.

archived comments

Where does one set ‘exclude_from_nav’ to true?

Eric 2007-05-13 00:53:24

exclude_from_nav is a field within the metatdata of a plone page – it is set using the check box Exclude from navigation on the properties tab when editing a page or other plone content type

Rick 2007-05-13 19:35:16

Thank you, Rick.

Can you provide an example on how to use this in my AT Class file (filesystem based product)?

Thanks much.

Eric

Eric 2007-05-13 19:48:34

If your AT class file inherits from another plone content type then you do not need to add this field, as it will be inherited by your content type. I’ve never had to add it in – I just did a quick search and see that it is an Accessor in ATContentTypes/content/base.py – it is actually returning a value from a var called excludeFromNav – where ever that is coming from

Rick 2007-05-13 20:03:09

plone livesearch results overlapped by content and action menus

On a custom plone 2.5 skin we found that the livesearch results were getting overlapped by certain elements of the content including action menus and elements within a composite page, in IE6. After much trial and error this turned out to be because I had used absolute positioning on the search form, which obviously confused something somewhere along the line. I also had to remove position:relative from a couple of containing elements to get it to work. As this was a custom skin already fairly heavily modified (both css and template changes), I haven’t narrowed down exactly what was happening yet, or if there is a better way to address it, but I ended up moving the form and using floats and margins to get it in position.

The plone livesearch template and CSS code seems a little over-complex to me, and I don’t really like the use of an HTML fieldset to render the results, as this is always the first thing I break during a customisation so I may create my own version in due course (in private of course, before I go around claiming I have a better version than the one that ships with plone!).

archived comments

Yes i agree, the livesearch css is a bit overly complex. i’m attempting to slightly restyle the plone live search. I have copied the livesearch css from the public css file and pasted this into my default css in my skin product. The live search layer displays on the left of the screen and not as expected on the right? Have you had similar experience? any ideas? This display is the same in firefox and ie7. Also the search div layer isn’t overlapping. When the layer appears it pushed the rest on the page contens below it. Hmm

Richard 2007-03-12 15:27:59

Just noticed this incoming link where someone else found a slution to this same problem:-

http://ohtogo.com/blog/?p=42

“adding z-index:1” to the parent – parent of which element I wonder?

Rick 2007-10-02 21:36:44