Columns in Plone 5

So just doing some theming in Plone 5 at the moment and have discovered something I'm having issues with.

In Plone 4 I used to copy the #portal-columns classes over to my Diazo theme because they were handy for CSS when for example, a site user would decide they don't want any right hand side portlets any more. I would just have my CSS written so that if the width-1/4 class was not available, make the #portal-column-content 75% (allowing for either #portal-column-one or portal-column-two to be gone) and the same for no columns, content would then go 100%.

My issues is with Plone 5 I don't have any sort of wrapper or classes being applied, all that happens is column-one and two are not sent over to my theme if they do not exist.

I am now trying to append a class to #portal-column-content if either or both #portal-column-one and/or #portal-column-two exist. This is my difficulty, I'm trying to use XSL but not sure it is possible. Has anyone had similar issues?

It certainly applies the 'something' class:

<xsl:template css:match="#portal-column-one">
    <xsl:copy>
        <xsl:attribute name="class">something</xsl:attribute>
        <xsl:copy-of select="@*" />
        <xsl:apply-templates />
    </xsl:copy>
</xsl:template>

I just need to apply a class to #portal-column-content instead of #portal-column-one.

I thought I could be clever and do this without going back to main_template but now I'm not sure :frowning:

Any help would be greatly appreciated.

queue sad violins

Check out this example in the Plone training manual for theming, there might be something there that could help you:

http://training.plone.org/5/theming/theme-package.html#main-content-area

1 Like