I have a plone 4.2.1 site and I am using various diazo themes. I also use Piwik for web statistics. Unfortunately the javascript for web statistics is being utterly ignored when one of the diazo themes is installed.
I have tried to edit the rules.xml file as suggested in https://groups.google.com/forum/?fromgroups=#!topic/plone-users/VM4b51ergFA, but adding
<!-- Google Analytics JavaScript -->
<after theme-children="/html/body"
content="/html/body/div[#id='visual-portal-wrapper']/div/script" />
does not work for me.
Is there any other option which I can use to fix this issue?
Thanks,
Julian
The viewlet plone.analytics is rendered in the footer viewlet manager:
<browser:viewlet
name="plone.analytics"
manager="plone.app.layout.viewlets.interfaces.IPortalFooter"
class=".view.AnalyticsViewlet"
permission="zope2.View"
/>
The snippet is rendered as it is, so you can identify your script tag in the way you want.
You shoud try
<script id="plone-analytics" ...>YOUR SCRIPT...</script>
And modify the rules.xml to put #plone-analytics in your footer
In Plone 4.2 at least the plone.analytics is not in the visual-portal-wrapper so the rule you try will not work.
Related
I'm using Bootstrap to develop a website and recently I asked here a question because some custom simple lines in CSS weren't working. I discovered that using development sites such as jsfiddle or codepen, the code works but I can't still get it working in my computer.
Do I need to install do something or install something? I thought it could be an issue of not using a web server, but I've just installed XAMPP and nothing...
In the end, I'm using XAMPP, with proper path xampp_path/etsit/index.html --> localhost/etsit/index.html. This doesn't work, there's no error in the cosole. When I just click in index.html to open it with the browser, it doesn't work either.
For bootstrap, I just add these links to the body (JUST FOR YOU TO KNOW I HAVEN'T DOWNLOADED BOOTSTRAP BUT I'M USING CDN):
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
UPDATE
Sample in codepen and jsfiddle that work.
The original (it's the same code) you can find it in these other post I made.
UPDATE 2
Please, read the post entirely before editing my question and marking it as duplicate, not noticing that same question is mine and has been referenced twice in the post....
Based on your answers in the comments section, it seems as though you are not loading your CSS file. You've stated that you do indeed have a link to it in your in your code. So either a) that link is now gone (in which case you would not see it at all in your dev tools' network tab); or b) the link is incorrect (in which case you would be getting something like a 404 error in your network tab). Make sure the path to your CSS file is indeed correct and that it exists at the location that you are defining.
I need a solution that meets following requirements:
use a diazo theme based on unstyled(!), Theme base (i.e. "Plone Default") with the URL diazotheme.domain.com
use "Sunburst Theme" (or any other Plone Theme) with the URL "sunburst.domain.com"
It seems that diazo not only uses the Base Theme for the diazo theme but also for the "Unthemed host names". Setting the Base Theme in diazo's "##theming-controlpanel" actually changes the Default skin of the Site.
I've posted a solution using diazo in combination with editskinswitcher: https://stackoverflow.com/a/23130398/1659599. I'd like to know whether this is possible without using editskinswitcher.
Take a look at the collective.behavior.localdiazo package.
You can see it in action in http://www.cfa.org.br/rba site, which has a different theme from http://www.cfa.org.br/ main site.
RBA is an instance of Microsite, a Dexterity-based content type defined in sc.microsite.
you'll definitely need a mechanism to activate different skins for the different parts of you site. editskinswitcher is one choice here.
you could also code your own traverser that applies the correct browserlayer and patches the portal_skins tool.
another approach is to allow skin selection in portal_skins and set the skin via a request variable.
the concept is outlined here: https://dev.plone.org/ticket/10311
Do you need to switch plone skin? Or would it be enough to change the diazo theme, using the same (more or less neutral) plone skin?
I use this approach to switch diazo rule set and index.html depending on the path. The two diazo themes uses different resources: images, styles, js, etc., and are very different.
My rules.xml - shortened:
<?xml version="1.0" encoding="UTF-8"?>
<rules
xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- The theme for my "app" -->
<rules if-path="/app_path /site/app_path">
<theme href="index_app.html"/>
<!-- rules for the specific path -->
</rules>
<!-- The default theme, used for standard Plone web pages -->
<theme href="index.html" css:if-content="#visual-portal-wrapper" />
<!-- Rules applying to a standard Plone web page -->
<rules css:if-content="#visual-portal-wrapper">
<!-- rules for the rest of the site -->
</rules>
</rules>
The same should be doable for domains using p.a.theming theme parameters: https://pypi.python.org/pypi/plone.app.theming#theme-parameters
and using "Conditions based on arbitrary parameters" from http://docs.diazo.org/en/latest/advanced.html
(replace the if-path with if="$host = 'domain'")
UNTESTED! :)
I am designing a website using Dotnetnuke latest version 7.1. I wanted make my website search engine friendly. I got options to add meta keywords, description. Another thing i wanted on my site is canonical tags for all the pages in the site. I stumbled upon many forums which gave an idea about manually adding canonical tags in Page header section for each page but these tutorials were written based on DNN 4.x and 5.x.
Since DNN7 pages doesnt have page extension like .aspx as previous versions did. Is their any possibility to automatically add canonical tags in DNN 7.x like any module or any technique add canonical for the same.
Thanka in advance,
You can do this with the default settings for the base Page URL's.
Go to "Admin" -> "Site Settings" while logged in as a Host user. Under the Portal Aliases section you can set "canonical" as the preferred option.
You only need canonical tags if users will be linking to your pages using different URLs. For example, here on Stack Overflow, all you really need to reach this question is the following address:
http://stackoverflow.com/questions/19516100/
Anything after the trailing / is optional. Because the title may change over time, and because Stack Overflow allows linking directly to individual answers and only shows the shortened version of the url in certain circumstances, several different links to this page may exist in the wild. Stack Overflow needs the canonical tag so that if Google crawls this page based on a referral from one of those links, Google properly attributes the page to the correct location.
Prior to DNN7.1, it was common on a DNN site to end up with links both with and without the .aspx extension, and so the Canonical tag was needed and helpful on every page. Now, you have correctly noted that DNN7.1 only ever presents the page name without the .aspx extension. Therefore, the only places where you need a canonical link are those cases where you've done a 301 redirect within your own site, and for those cases it's easy enough to add the canonical tag using the old method.
That didn't work for me on https. I had tu force the LINK rel canonical tag on the file SiteAnalytics.config into both paragraphs:
<![CDATA[
<script>
... google analytics script
</script>
<LINK href="https://yourdomain.com/" rel="canonical" />
]]>
and
<![CDATA[
<noscript>
... google analytics script
</noscript>
<LINK href="https://yourdomain.com/" rel="canonical" />
]]>
Hope that helps alienated folks like me.
I have installed Joomla 3.x and some modules.
One of my modules is to display articles from certain categories of my articles, but when I navigate to my article, the CSS stylesheets do not load.
When I view the source, I discovered that the URL for the CSS stylesheet in the page above becomes:
<base href="http://cambridge.mywebcommunity.org/index.php/10-%E7%88%B1%E7%AB%8B%E6%96%B9%E5%8A%A8%E5%90%91%E6%9B%B4%E6%96%B0/3-welcome-to-your-blog" />
... instead of the original I put in, here:
<base href="http://cambridge.mywebcommunity.org/" />
This also happens to another CSS stylesheet from the module. The CSS URL loads like this:
<link rel="stylesheet" href="http://cambridge.mywebcommunity.org/10-爱立方动向更新/modules/mod_news_pro_gk5/interface/css/style.css" type="text/css" />
... instead of the original CSS URL that I put in:
<link rel="stylesheet" href="http://cambridge.mywebcommunity.org/modules/mod_news_pro_gk5/interface/css/style.css" type="text/css" />
So I have figured out that the issue is the URLs are not being added by Joomla correctly. How would I go about fixing this?
From what you've posted it looks like you (or extension developers) are trying to add css with absolute links. Looking at the source of your page will quickly show you that your links look different from the core links in that they are absolute not relative. You may need to look a the code in the modules doing this and fix or contact the developers and ask them to fix. Also ask them about the js.
In Joomla you add style sheets with code like this in your template index:
$doc->addStyleSheet('templates/'.$this->template.'/css/template.css');
The change in behavior is most likely due to a recent security fix concerning uris in the header. I'm not going to link to details of the exploit but easy enough to find out why this was changed, but it was for good reasons.
I made my own welcome intro page using org.eclipse.ui.intro and I'm able to show my welcome extended with other contributors.
Now I'd like to decore my welcome with some css, and I have two question:
1) How can I apply predefined eclipse css (i.e Slate) to my page? I've already tried putting org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.slate in plugin_customizazion.ini without success
2) there's a way to extend css to contributors without giving them the css file??? I mean there a way for contributors to use my own css if it is only inside my plugin (or eclipse plugin if i will be able to use "slate" style?)
Eclipse SDK Help
The only way to select a theme is via the preference org.eclipse.ui.intro/INTRO_THEME in plugin_customization.ini.
Theme-enabled intro implementation must make all the references to style and presentation resources using the $theme$ substitution variable. Absolute paths for images, pages, styles, etc. will be computed by resolving the substitution variable using the path of the currently active theme.
See Intro Content XML Format as well.
To answer the second question, if you define an intro theme which include your css file, other plugins will be able to use it for sure.
Cheers,
Max
Ok, now I've learned more about themes, but I think I have some problem with path.
I've defined my own theme, css and graphics, so I extend theme by configExtension. But when I load my application the welcome page doesn't load css neither images. I've also defined org.eclipse.ui.intro/INTRO_THEME in plugin_customization.ini.
I have a structure similar to slate template like this
my.plugin.name
|_resources
|_intro
|_graphics
|_html
in graphics there are all images definitions whlile in html there are css
then in intro I have my root.xhtml (referenced by intro.xml)
with this css reference
<link rel="stylesheet" href="$themes$/html/root-ie.css" type="text/css" charset="utf-8" />
finally I've defined configExtension with theme
<extension
point="org.eclipse.ui.intro.configExtension">
<theme
default="true"
id="my.plugin.name.themes.themename"
name="%theme.name.themenam"
path="/resources/intro"
scalable="true">
I think maybe the problem is with the path, I've also tried with path="resources/intro"
path="/resources/intro/" and path="resources/intro/" withous success
could someone post a simple but complete working sample please?