Using z3c.jbot to override Plone document_view - overriding

I'm working with Plone 4.0.7 & Python 2.6.7 on Mac OSX 10.7:
I need to tweak the document_view just slightly when in a specific segment of my site so I want to add a conditional to the document.pt. I'm trying to use z3c.jbot to do this but for some reason my changes aren't showing. I'm using the file name Products.CMFDefault.browser.templates.document.pt in order to override the file. I use z3c.jbot all the time and I'm really not sure why this isn't working so any suggestions would be greatly appreciated.
Thanks

I think you probably want to override (in a skin layer) one of these files instead:
main_template.pt
(plonetheme/sunburst/skins/sunburst_templates/main_template.pt or
Products/CMFPlone/skins/plone_templates/main_template.pt)
document_view.pt (Products/CMFPlone/skins/plone_content/document_view.pt)

Related

How to correctly customise search.get.js in Alfresco?

I'm using Alfresco Enterprise 6.2. Actual changes I need to make belongs to the search.lib.js
This is an import in the search.get.js. I tried modifying search.lib.js itself and had no effect. So I populated the import in the search.get.js and modified it directly. I'm not too sure if it's the right approach. What would be the best way to go about this change?
Keep your files to below location to override.
alfresco\extension\templates\webscripts\org\alfresco\slingshot\search
The approach to overriding web scripts via the alfresco/extension/templates/webscripts/org/alfresco/slingshot/search/search.get.js path has not changed in 6.2 and is still viable.

Theme development in Liferay

I'm trying to make a theme for Liferay 6.2 and I have some misunderstandings.
I create new project, choose theme, then click next and choose velocity and _styled responsively. But I want to get a standart theme which I can deploy and nothing change in comparison with default theme. I thought I got the point and after that I should copy overriden .css files in _diffs folder. But I don't achieve that. I attached screenshot with my result and I can't understand why I don't have default theme instead. Also I understand that it may be very dumb question but I hope someone would explain it briefly to me. Thanks in advance.
You should use the classic theme as base.
Something like:
property name="theme.parent" value="classic"
in your build.xml will build your project with the theme that comes with LR by default (the classic one).
Victor already gave the correct answer. If you're interested in the background: _styled is a theme that basically provides the basics for your own theme but doesn't make any assumption on its appearance. If you really want to build your own theme, this is the preferred one to start from. If you only want to tweak a few things from the classic theme, start with classic (as Victor says).
Note that classic is not meant to be extended (though it works) - contrary to the documentation, the css/custom.css file in classic theme is not empty for this reason. This means that you'll need to adopt the instructions for creating a theme and start with classic's own custom.css file.

How to get Plone's CSS Registry to load new CSS files

I'm trying to upgrade a Plone 3.3.5 server to 4.3.6. However, when I update the site, I find that the CSS for the site is not carried over. If I go to my CSS Registry, I find that almost all of my CSS is producing the (resource not found or not accessible) error.
My confusion seems to be in how Plone locates and links/imports stylesheets in general as Plone seems to be loading virtually none of my CSS and pretty much giving me raw HTML in the browser. I'm assuming the CSS registry is loading CSS from the buildout-cache. With this assumption, an example stylesheet that I'm targeting is located under:
Plone/buildout-cache/eggs/Products.NuPlone-1.0b3-py2.7.egg/Products/NuPlone/skins/nuplone_styles/base.css
When the CSS Registry failed to load this, I noticed that some CSS was being loaded in via handles like this:
++resource++tinymce.stylesheets/tinymce.css
But this format doesn't work with base.css and others.
So my question is, given I've got a new product installed with some CSS included in it, how do I get Plone to target said CSS?
For resources inside "skins" FS folders, the way to register on portal_css tool is to simply provide the filename, so simply put there base.css.
If this is not working probably the nuplone_styles skin folder is not registered properly in the portal_skins tool.
So go to ZMI --> portal_skins --> click on "Properties" and check the following:
what theme is used? You must probably switch back to NuPlone (but I'm not sure if it works on Plone 4)
is the nuplone_styles folder in the list of CMF layers of the used theme?
Please note also that adding the nuplone_styles layer to another theme is not a good idea. Please think about copying CSS you need in the custom directory.
This is not an answer, but some additional explanation, not fitting in a comment:
The "old" way to include style-sheets via skin-folders, requires to specify only the file-name, not a full path, and will be found by traversal, meaning the first found file with the according name, will be taken. In case of several files with the same name, the order of skins matters.
The other way is to register style-sheets via a browser-package, to have an unambiguous path to a certain file, they must start with +++resource++.

Events manager - child theme not working

I am trying to make changes to plugins/events-manager/templates/forms/event/bookings.php via my child theme. When I make changes to the file directly in the plugin, it works well, but I know the way to go is to make changes at the child theme level so this is what i have done:
I added the edited bookings.php to twentytwelve-child/plugins/events-manager/templates/forms/event/bookings.php but for some reasons the changes are not applied.
I have also tried to add the edited bookings.php to twentytwelve-child/events-manager/templates/forms/event/bookings.php but it is not working either.
I would appreciate if someone could help me figure this out (screenshots below). FYI - I am not a developer, so please try not to be too technical in your answers.
Many thanks,
Yvan
It would be nice if developers could simply override a specific file within a plugin from within their theme, but I'm pretty sure WP doesn't work that way (At least not for overriding plugins. Theme files? Yes. Plugins? No).
If the plugin developer was nice they will have given you some override capabilities like using action hooks, filters, or including their function as static within a class.
From the looks of the events-manager plugin file there are three such action hooks available:
do_action('em_events_admin_bookings_header', $EM_Event);
do_action('em_event_edit_ticket_td', $EM_Ticket);
do_action('em_events_admin_bookings_footer', $EM_Event);
You will either need to hook into these actions to make your adjustments (highly recommended), or duplicate the plugin, rename it, and edit it manually (which means you will need to duplicate these edits every time you upgrade... YUCK!)
EDIT after further researching the events-manager plugin:
While WP doesn't provide this template override functionality, it looks like the plugin does. However after some digging in the documentation I noticed that this functionality doesn't specify weather it supports child themes. Try placing the template override within twentytwelve instead of twentytwelve-child. If that works, then maybe you could move that folder back into twentytwelve-child and create a symlink within twentytwelve to the real folder in twentytwelve-child (sort of tricking the plugin). Doing it this way means you have to recreate the symlink each time you update twentytwelve, but the trade off is that you can now override templates and won't loose your changes if you update twentytwelve (just the symlink).
The problem is your file path:
plugins/events-manager/templates/forms/event/bookings.php
should be
plugins/events-manager/forms/event/bookings.php
If you have issues with EM we monitor the free forums here (I stumbled on this by coincidence) - https://wordpress.org/support/plugin/events-manager
also #StevenLeimberg, thank for chipping in! we do support child themes it was just wrong directory structure.

Do I have to use Compass to modify CSS with Django-Grappelli?

I recently setup django-grappelli on my first django app. While I like the way it looks I want to customize the colors, and other CSS.
From my research, it looks like I will have to use Compass but I've never used Compass before and want to double check that this is the best method before I embark on that path!
Is Django-grapelli even the right choice for some one that wants to customize the color theme?
Things I tried
Modify the CSS in the Grappelli stylesheets but they are formatted in a way that makes it tedious.
Extend the style sheet but I am not sure where to do this for the admin.
Create a custom.css but could not figure out where to put the path
Thanks for your advice!
It seems to me like Compass is just a tool to write CSS. I've never used it, but at the moment I don't see how it could make modding the admin interface any easier than doing it manually!
Whenever I make changes to the admin (I've made changes to Grappelli, like you're trying to do), I always use what you've listed as number 2. I've never had any troubles! I can try to help you out, if you'd like to try again.
What I do first is go to my Python install directory and copy the Grappelli source from Lib/site-packages. I put this code in my project directory as a project-level app. So, if you're using Django 1.4, you'll have a folder that has your project folder as well as manage.py in it. Put the code there.
Then, using your favorite web developer tools (I prefer Chrome's), figure out which stylesheet you need to modify and which css file it's in. I do this by right-clicking the element and selecting Inspect Element. This brings up the dev tools, and at the right it tells you the css file its referenced from as well as which line its on. If you open up that css file in your favorite text editor and make changes to it, it should work!
Let me know if you're having any trouble with this. I can try to help you out further.
(and, P.S., I wasn't trying to be pedantic with a basic overview of the use of Chrome's developer tools. I was just trying to be helpful by not assuming anything. I hope you don't take it as an insult.)

Resources