3

I'm using diazo for theming, and I have a problem with all popups. I'm using Plone 4.1.3.

I've read a lot that to prevent theming popups, you have to include this rule :

<theme href="index.html" css:if-content="#visual-portal-wrapper" />

That's already the case. Maybe this rule works for some popups but not for the login_form one, nor the select_default_page, nor the contact-info one.

Why ? Just because all this 3 templates has #visual-portal-wrapper in.

So, I've tried with some rules like that :

<notheme if-path="select_default_page" />
<notheme if-path="contact-info" />
<notheme if-path="login" />

But, it's not really efficient, if I forgot one template in this rule, I need to add it, and if someone go to /contact-info (without the popup) the page is unstyled (of course, but it's not good...).

I've tried to look on the side of the URL, I saw that there is a "ajax_load" query string, but it's not present on the contact-info.

I've also tried to look at the HTML added in the main_template, the "pb_ajax" class, but that didn't work too...

So, is there a way to identify a template in a popup ?

Edit :

Here is the template : http://pastealacon.com/29662

and here is the rule.xml : http://pastealacon.com/29663

Jihaisse
  • 977
  • 5
  • 24
  • Using css:if-content="#visual-portal-wrapper" condition is enough. No need for extra notheme. It works, you may have an other issue somewhere. Is your theme available somewhere (like github) ? – toutpt Feb 08 '12 at 09:15
  • Strange... Here is the template : http://pastealacon.com/29662 and here is the rule.xml : http://pastealacon.com/29663 – Jihaisse Feb 08 '12 at 12:22

1 Answers1

3

You need to make sure that your template includes the id="content" div tag.

When popups are loaded via AJAX, a filter is employed that strips away everything that's not needed for the popup (all the chrome of the design). That filter, defined in popupforms.js is:

var common_content_filter = '#content>*:not(div.configlet),dl.portalMessage.error,dl.portalMessage.info';

The key part here is "#content>*". It means we're filtering out everything except what's inside the id="content" div. But, if that div is missing, there will be no match, and all the html returned appears in the popup. A mess.

SteveM
  • 6,058
  • 1
  • 16
  • 20