Insert external content into plone site with Diazo

Hi, there are some info on (inside #header) that I need to show on my plone site. I added the lines below to the rules.xml to load the necessary info using Diazo.

<rules if-path="tests/externalpage">
    <replace css:theme="#content-core" css:content="#header" href="">

Unfortunatelly, nothing happens. What am I doing wrong? There are some extra configuration?


Wild guess:

<replace css:theme="#content-core" css:content="#header" href=""

Thank you for your response but I tried both and the problem still happens.

another guess:

Do you have #content-core in your index.html ?

(try adding a div with another id in index.html and replace with that)

PS: Be sure to disable / enable the theme (or restart)

I've tried to add a div with another id in index and disable/enable the theme every time but the problem still happens. Thanks.

When you look at the html, can you see the div with the new id (by the way, your div is like this

<div id="something">here comes stuff</div> 
(and not)

<div id="#something"> This is wrong </div>

I've added the line below on index.html of my copy of Barceloneta Theme zip

<div id="silvio"></div>

I've added the line below on rules.xml

<replace css:theme="#silvio" css:content="#header" href="" />

What I mean is:
When you look at the html code of your page: do you see the the div (with id silvio).

Maybe it is not the right index.html is used, test it by removing everything except some dummy text and the silvio div

Is the site you are adding it to using SSL? The content could be blocked coming from http://

Tests without href works. For example, the code below shows Marino:

<replace css:content="#silvio"><div>Marino</div></replace>

The problem happens with replace and href.

I don't think so. I've tried to add it on localhost site and on a production site without any success.

I tried to inject it (with pat-inject), no idea if diazo does the same 'checking' when it is a different URL,

[Error] Failed to load resource: Origin http://localhost:8081 is not allowed by    Access-Control-Allow-Origin. (index.html, line 0)
[Error] XMLHttpRequest cannot load due to access control checks.

Do you have read network enabled? Otherwise external requests will fail.
Check under "site setup" > "themes" > "advanced"


while you are entirely correct to say that it is necessary to have network enabled, it is unlikely to the extreme that the OP could have missed this fact. If you have seen what happens when Lxml block a network access with Plone, it can't be overlooked. It's pretty much a 'in-your-face' message.

I never checked this item before. Thank you for your suggestion but the problem still happens.

1 Like

I think that your rule is never applied because it conflicts with the behaviour of your theme. If you examine your generated page in the browser debugger, I think you will find your href directly copied by the block copy done by your theme (if it's Barceloneta it works just like that for central content). If there is a way with a simple rule to externally change the behaviour of a xsl copy, I don't know it. The only way I can see is to special case the whole block copy.

You are most welcome. At least we can check this off the list.