Using RefineryCMS and the Theming Gem - ruby-on-rails-3

I am in the beginning stages of diving into the world of RefineryCMS and am having an issue with the theming Engine.
I was able to customize the look of the home and blog pages, but for individual pages I create outside of the home and blog engine are not falling under the normal theme I created. I used the override method to copy all of the necessary files to my custom theme, but like I said, the page is using the default /pages/show.html.erb file vs the theme/mytheme/pages/show.html.erb file..
Any ideas on why this would be happening?

The use of the theming engine is not recommended anymore:
USE OF THE REFINERYCMS-THEMING GEM IS NO LONGER RECOMMENDED. Why?
Theming performs some strange code hacks in order to get it to work.
Therefore, it makes it difficult to keep it compatible with other
engines. Also, many people have reported over 15 second load times
with theming, whereas regularly you would get 3 second load times.
Finally, Resolve Digital no longer uses nor supports this method.
https://github.com/resolve/refinerycms-theming

Related

silverstripe dynamic backend for flexible frontend

I'm searching for a while, but didn't find a practical answer for the following problem:
An Articlepage in the Frontend can contain different types of sections. For example a block text section and than a text section with left photo an at the end an wallpaper photo.
Now I want to implement this in my backend dynamically, so that I can choose, which type of section and -even more important- how many sections my article should contain.
In my recent project I've solved the problem as an Articlesection with a Dropdown, wich contains the different section styles. And one article hat xy Artilesections as childpages. In the frontend I included all Childpages of the Article - so to speak the Articlesections, where I've checked with if conditions, which sectionsystyle I have in this Section and here I styled the section as I want.
For example Artilce1 has 2 Childpages: Articlesection1 and Artilcesection2.
In AS1 I have choose in the dropdown: right text with left photo and check with if conditions, to style the section. The same with AS2, that is for example a wallpaper photo.
This semiprofessional solution worked, but there are some bugs with displaying the Article correct in the backend, because I have to declare the Articlesections as Includes and not native childpages. And in generell this don't seems like the developers of silverstripe want the users to do it this way..
Are there better ways to implement a dynamically changing backend, so I can decide, which and how much sections I have in the frontend.
Take a look at https://github.com/sheadawson/silverstripe-blocks. There's quite a few addons that offer similar functionality as Blocks such as Elemental. The following blog post might also be useful too - https://www.silverstripe.org/blog/silverstripe-strips/.
Thank you for your reply, but there is a problem, because I don't work a lot with the terminal and the composer. In principle I want to install sheadawsons silverstripe-block. I have installed the composer and run the command:
"composer require sheadawson/silverstripe-blocks" it seems like it installed that correctly, because I became no errors, but what then? With dev/build -to refresh the database- happened nothing and the following instructions in the readmy chanced nothing. Should I copy any files in my Sivlerstripe web folder or what else..? I'm a bit desperate, because there is such a poor documentation.
Tank you

passing options to a matplotlib backend in a clean way

For my personal use, several times I have modified the matplotlib gtk backend (also the tk and wx) , replacing the window with a notebook. This is because I use too many plots at the same time.
This time around I feel I can take the challenge to do a pull-request for my changes. But I want to do it as clean as possible. That is where I need advice (clean is the key).
I would like to place my class TabbedFigureManagerGTK3 inside
backend_gtk3.py
The problem is that using
matplotlib.use('gtk3cairo')
or
matplotlib.use('gtk3agg')
Directs the specified backend (gtk3cairo or gtk3agg) to use backend_gtk3.FigureManagerGTK3
I do not want to replicate backend_gtk3agg.py and backend_gtk3cairo.py just to change the call to backend_gtk3.FigureManagerGTK3
I would like to implement a solution that allows the user to pass an option to the backend, and from there it choses the traditional FigureManagerGTK3 or my TabbedFigureManagerGTK3
I am looking for a recomendation on how to do it that has more chances to be accepted upstream (after pull-request and the whole shebang).
Do I modify matplotlib.use to add something like **kwargs?
Do I just recreate the whole backend_gtk3agg.py and backend_gtk3cairo.py (subclassing of course)
Do I forget about trying to get this accepted and do it breaking the Coding guide
Thanks
Federico
This does sound like a nifty feature.
I would do it by modifying the existing manager and following how the PySide vs PyQt issue is handled (by using a secondary rcParams which controls which one the backend imports). In your case, I would add backend.gtk3.tabbed, or something similarly named, which controls how the manager behaves.
Write your modifications so that changes as little of the existing api as possible (breaking backwards compatibility is a no-go) and make it so a user that doesn't explicitly enable your changes won't even know they are there.
Also email the dev list, they are all pretty friendly. Or just open a PR, that is the most effective way to get feed back.

Does thomas-mcdonald / bootstrap-sass support the use of generators? Getting an error saying cannot find

A simple question. Does this version support generators?
I wanted to test out using it and follow along with Ryan Bates screen cast which I uses a different version.
I've been playing with tables today and want to see how this works using the generator with a scaffold generated model and all its components.
Running rails g bootstrap:themed returns
Could not find generator bootstrap:themed
So I tried to reinstall with rails g install:bootstrap
Error similar which lead me to try to find if it supports these commands.
Thanks
It doesn't need generators for asset files, since we hook into the asset pipeline through the use of a Rails Engine - configuration options are available through the use of variables (use this as a reference, Sass variables are actually $x rather than #x and need to be defined before importing bootstrap), Sass' #extend, and Bootstrap's #makeRow and #makeColumn mixins, along with the other Bootstrap mixins.
Themed scaffold would be interesting but generally would be a pain to maintain - view scaffolding tends to get ripped apart pretty quickly anyway. Perhaps a 'sane' application.html.erb layout generator could be useful.
So yeah, we currently have no generators, don't need an asset one, themed scaffold probably not coming soon unless someone is interested enough to do the work on it, potentially a layout generator in the pipeline.
Checkout
https://github.com/decioferreira/bootstrap-generators
Seems to be what you are asking for.
-Rick

How to locally test cross-domain builds?

Using the dojo toolkit, what is the proper way of locally testing code that will be executed as cross-domain, without making the actual build?
As it appears, there are three possible options (each, with their own drawbacks):
Using local (non xd) XMLHttpRequest dojo.require
This option does not really test the xd behavior, since it dojo.require[s] the js synchronously via XHR.
djConfig.debugAtAllCosts = true;
Although this option does load the required code asynchronously (via the 'script' tag), it also pulls the code in via XHR, parses the dojo.require[s] inside that, and pulls them in. This (using the loader_debug), again, is not what the loader_xd is doing. More info on this topic in a different question.
Creating a cross-domain build
This approach requires a build, which is not possible in the environment which I'm running the code in (We're using our own on-the-fly build process, which includes only the js that is necessary for a particular page. This process is not suitable for development).
Thus, my question: is there a way to use the loader_xd, which does not require an xd build (which adds the xd prefix / suffix to every file)?
The 2nd way (using the debugAtAllCosts) also makes me question the motivation for pre-parsing the dojo.require[s]. If the loader_xd will not (or rather can not) pre-parse, why is the method that was created for testing/debugging doing so?
peller has described the situation. If you wanted to just generate .xd.js file for your modules, you could look at util/buildscripts/jslib/buildUtilXd.js and its buildUtilXd.xdgen() function.
It would take a bit of work to make your own script, but you could look at util/buildscripts/build.js for pointers.
I am hoping in the future for Dojo (maybe Dojo 2.x timeframe) we can switch to a loader that just uses script tags with a module format that has a function wrapper around the module, something that is coded by the developer. This would allow the same module format to work in the local and xd cases.
I don't think there's any way to do XD loading without building and deploying it. Your analysis of the various options seems about right.
debugAtAllCosts is there specifically to solve a debugging problem, where most browsers, until recently, could not do anything intelligent with code brought in through eval. Still today, Firefox will report exception in the console as appearing at the eval site (bootstrap.js) with a line number offset from the eval, rather than from the actual eval buffer, and normally that eval buffer is anonymous. Firebug was the first debugger to jump through some hoops to enhance the debugging experience and permitted special metadata that Dojo's loader injects between the XHR and the eval to determine a filepath to the source. Webkit/Safari have recently implemented this also. I believe debugAtAllCosts pre-dates the XD loader.

Is there a script that turns a Pharo core image into something more useful, that would include an OmniBrowser?

I cannot use the most recent dev Pharo release because of some strange issues with the compiler built into Pharo. Well. I was wondering if there is a quick way to install all the nifty extras into Pharo that the core image misses, as compared to the dev image.
With all non-core Pharo images come a script which was used to build that image. Just edit that file and drag&drop it on a new core.
You could also tell me what you don't like in the Pharo images so that I can enhance them.
There is also the script I published on the Pharo wiki that I use to build my images:
http://code.google.com/p/pharo/wiki/ImageBuildScripts
Of course it is very specific to my preferences and needs, but you can take it as an example and adapt it to your own needs.
CommandShell works with Pharo 9.10.10. You will hit several errors as you try to load the package due to Pharo lacking MVC, but you can simply proceed past the first bunch and abandon the last one (that tries to actually open a CommandShell in Morphic). At that point, you'll have a class called PipeableOSProcess that can be used very easily to grab output. For example:
(PipeableOSProcess command: 'ls /bin') output
will return the contents of your bin directory as a string.
Ok, OB itself can be easily downloaded using ScriptLoader loadSuperOB.
Damien adds (from comment below):
The problem with that approach is that nobody really maintains it.
Moreover, you miss some configuration steps to enhance the use of OB
(for example, you won't have the OB-based browsers if you ask for the
senders of a message from a workspace)