Why do I get duplicate toolbar entries? - django-cms

The django-cms cms_toolbar has duplicate items -
It happens for me on django-cms 2.2 and the develop branch (2.2.post0). I'm running python 2.7.2, django 1.3.1
Any suggestions?

I got this problem, it was because, I had {% render_block "js" %} this coding two times in the template.

Related

Jekyll site works locally but not on Github Pages

I forked the Solid-jekyll theme (solid-jekyll) and got it to work locally. However, when I pushed it up to Github pages, it seems to loose it's css formatting.
My fork of solid-jekyll is on github, username:BeenzSyed. I tried changing the baseurl to "/solid-jekyll" but that didn't work either.
This is what it looks like on my fork: https://beenzsyed.github.io/solid-jekyll/.
This is what it should like though: http://ojs.xyz/solid-jekyll/.
I think it's because it can't find the _includes/css/style.css file but I'm not sure what to do to fix that. Any help is appreciated!
Faced exactly same issue long back and it consumed 2-3 days. Find your main stylesheets (like main.css) and save it to assets folder and commit. This way Github will be copying stylesheet to site built. It usually won't copy :( main.css
I followed the suggestion of dracos on this GitHub Issue page and related commit to change /_includes/head.html from:
<link rel="stylesheet" href="{{ site.baseurl }}public/css/poole.css">
to
<link rel="stylesheet" href="{{ "/public/css/poole.css" | relative_url }}">
Changing most site.baseurl references to relative_url works in both local testing and on GitHub Pages.
My commit for changes to my site can be found below:
https://github.com/naamancampbell/naamancampbell.github.io/commit/f60da4d4e48447708c2e157ff1e07303d5377587
As someone pointed out, the live demo uses a different stylesheet. So the repo isn't the same. I suggest creating a new issue in the repository.

Twig function navigation in PhpStorm

I have been successfully using space + left click navigation from within my twig templates to open function, filter definitions.
E.g.
{{ somefunction() }}
-->
new \Twig_SimpleFunction('somefunction', ...
For some reason this has stopped working. Strangely autocomplete still works though.
Enable the Checkbox "Enable Plugin for this Project" in the PHPStorm Stettings -> Languages & Frameworks -> PHP -> Symfony
Make sure the Twig-Plugin ist installed.
Restart PHPStorm, Done.
Go to declaration and its type
JetBrains PhpStorm Documentation
TL;DR: Keep pressing Ctrl and hover over function/filter and left click.
This is not limited to twig templates and can be used throughout all PhpStorm.

What's the difference between the include tag and the include function?

I saw someone including a template on his application using the twig template system.
He included his template like this:
{{ include( 'Bundlename:Directory:template.html.twig' ) }}
instead of this:
{% include 'Bundlename:Directory:template.html.twig' %}
At first I thought he was using a custom twig extension, but it actually
works on symfony in general, even though its not documented.
http://twig.sensiolabs.org/doc/tags/include.html
So is there a difference between the two?
why is it not documented?
if the syntax is wrong why is it even working?
It is documented http://twig.sensiolabs.org/doc/functions/include.html.
Twig tag include vs function include

django templates inline CSS

I want to create a set of widgets (tables, calendars, etc) that can be include in HTML emails we send out via Mandrill. I already have these widgets build as components pulled into web pages, I would like to reuse them in emails but in order to do that I need to inline the CSS.
I have tried using https://github.com/roverdotcom/django-inlinecss, which appears to do what I want but doesn't appear to support S3 as a staticfiles source and I can't get it to run locally. Using the tag {% inlinecss "/css/main.css" %} gives an error:
"The joined path (/css/main.css) is located outside of the base path component ([my local path]/static)" from the contrib.staticfile.find_location call to safe_join.
Question 1: can I use django-inlinecss with S3 as a staticfiles repo as it stands or would I have to fork and enhance it?
Question 2: if 1 is possible, what do I need to do to get django-inlinecss running successfully locally?
Question 3: if 1 is not possible does anyone have any alternative suggestions for inlining css using the django tempting framework.
Thanks in advance - Guy.
In the end Mandrill already solved this problem. I the message dict of the API call to mandrill you can tell Mandrill to inline the css for you.
message['inline_css'] = True

custom error page not being used

I'm having trouble getting my custom error page to work. I have followed the instructions on http://docs.ghost.org/themes/ and added an error.hbs template into the root of my theme. The code inside this template is really simple:
{{!< default}}
<section class="error">
<h1>{{code}}</h1>
<p>{{message}}</p>
</section>
Each time I try to test it by going to a non existent page, the blog shows the default ghost error page every time.
Have I missed anything crucial?
If you are using ghost 0.4.2 I'm sorry this is a bug and would be fixed in 0.5 release
see the bug issue at github
https://github.com/TryGhost/Ghost/issues/2513
Have you restarted Ghost? Whenever you add or remove a theme file you need to restart the application for it to become aware of the changes to your file structure. Edits to files are detected automatically, but new or removed files need this extra step.

Resources