Nidelven IT - All about Python, Zope & Plone - and Open Source!

Here you'll find issues related to our services. Mostly about Python, Zope and Plone, as well as hosting-related issues.

"Keeping IT real"

Older entries

Atom - Subscribe - Categories
Previous | Next

Company website upgrade & update, now and then

So, I'm pretty much done with the upgrade of the website

It's been a bit of work to fine-tune the layout, polish the content (although it should be more). I've also had to go in and modify the package to include the suggested patch (don't remember where) that skips <ul> tags in navigation to get an HXTML result that is 100% compliant with the W3C validator.

I started with the beyondskins.responsive theme for layout and design, and have made a lot of changes to it to simplify it, and make it pass the W3C validator. It had some weird HTML-attributes such as role.

There was also an HTML attribute in Plone that didn't jive with the W3C validator, and that was the attribute placeholder on the search box. Isn't (X)HTML compliance a bit important thing for SEO and accessibility, if so - why did something like that slip through the Plone development/release process?

I tested the webpage in a speed tester for counting downloads, download speed and so on. There was a *huge* amount of Javascript included, so I figured I could make Javascript files available only for logged inn users in portal_javascripts.. that worked out well and cut down a big chunk of requests and data transfer. I did the same for portal_kss. Although now I see the search option isn't available for users with a small screen size (probably Javascript) but that'll be fixed.

There was one thing in particular I noticed when validating the page on W3C - and that was that the KSS system put an invalid attribute into the template. So I added a product in products called Patches, with the following file:

from zope.interface import implements
from zope.component import getMultiAdapter
from zope.viewlet.interfaces import IViewlet

from Products.Five.browser import BrowserView

class KSSBaseUrlViewlet(BrowserView):
    """ Renders a link rel tag with the real url of the published object. """

    def __init__(self, context, request, view, manager):
        super(KSSBaseUrlViewlet, self).__init__(context, request)
        self.__parent__ = view
        self.context = context
        self.request = request
        self.view = view
        self.manager = manager
        self.context_state = getMultiAdapter((context, request), name=u'plone_context_state')

    def update(self):

    def render(self):
        # We need to generate the link in every case, since the new url base detection
        # algorithm of kss relies on it.
        return u'<link rel="alternate" href="%s/" />' % self.context_state.object_url()

from import headerviewlet

headerviewlet.KSSBaseUrlViewlet = KSSBaseUrlViewlet

That worked out well.

Anyway, I think the website looks pretty good now, available in English, Norwegian (y un poco) espaƱol.

I would *love* to get some comments and feedback on what is good and bad, what should be changed, removed or added.

Thanks :)

[Permalink] [By morphex] [Python, Zope, Plone - and anything loosely related to that (Atom feed)] [2013 10 Jan 12:09 GMT+2]

Add comment (text format)


A passphrase is required to comment on this weblog. It is required to make sure that bots aren't doing automatic spamming. It is: nit is the best!.