Deactivating hashlinks rewrite in silverstripe 3.1 - silverstripe

The old way of doing this is deprected. Is there a new way to do this? What are the pros and cons?
SSViewer:: dontRewriteHashlinks();
The requirement is because it breaks many JS plugins. Altering those standard UI components instead of making this change to SS seems the wrong way to fix this.

in /mysite/_config.php
Config::inst()->update('SSViewer', 'rewrite_hash_links', false);
or using the YAML config system (ex. /mysite/_config/config.yml)
SSViewer:
rewrite_hash_links: false
See http://doc.silverstripe.org/framework/en/3.1/reference/templates#fragment-link-rewriting

Related

How would I create a RouteModule in Angular 2 without forRoot

I am working on going through the Style guide for Angular 2 and I happened upon this line
Do end the filename of a RoutingModule with -routing.module.ts.
I haven't had luck finding anything on routing module examples so I went to Papa's blog. There I found this line...
The forRoot() function should only be used for creating the root modules' routes. When we get to child modules and routes, we'll use other techniques that we'll see in later posts.
So how do I create a RouteModule that isn't using forRoot like suggested.
I think I found an example here...
https://github.com/angular/angular.io/blob/master/public/docs/_examples/ngmodule/ts/app/contact/contact-routing.module.ts

How do I disable all css/theme from ZK?

Im using zk version 7.0.2 and I need to disable all styles/themes from zk, then I need to put my own style css. There is a way to do this?
I tried to put some css files but it doesnt change. In some docs I've found shows me about creating my own theme using LESS but it doesnt work.
Thanks
Yon can specify the disable-theme-uri element in zk.xml, for more details, please take a look at this document.

Pretty dump variable/object in Symfony 2.*?

When developing stuff I need to output the state of some instance in order to inspect it.
While using CakePHP I always had a debug() function which does some kind of var_dump inside a <pre> html element, so the content is readable.
Is something similar in Symfony 2.x too?
exit(\Doctrine\Common\Util\Debug::dump($someVar));
use
\Doctrine\Common\Util\Debug::dump($user);
As of today, one of the best ways to debug in Symfony that I know of is the Ladybug Bundle. Its output is similar to xdebug's, but it has some nice features, like a collapsible tree structure for arays or automatically linking to documentation pages (supporting standard PHP, Doctrine and Symfony).
You can find some great examples of its use on the README.
Now there is a new function in Symfony - dump(), have a look at http://symfony.com/blog/new-in-symfony-2-6-vardumper-component

Prestashop 1.5 - cannot over ride top menu css

I am new to Presta Shop and trying to create a custom theme. I have read about the documented way to do this by extending the current module css/template files where necessary here: http://doc.prestashop.com/display/PS15/Overriding+default+behaviors
It all seems straight forward. I have over rode the templates and CSS for 2 modules so far with ease but on my 3rd attempt I am encountering some issues. I attempted to over ride the following CSS file:
/modules/blocktopmenu/css/superfish-modified.css
with this
/themes/newtheme/css/blocktopmenu/superfish-modified.css
but it did not work. Out of interest I also tried overwriting with this path too:
/themes/newtheme/css/blocktopmenu/blocktopmenu.css
but that also did not work?
Hopefully someone out there can help or shed some light as to the reason for this or a solution?
Thanks, Matt
Actually I just figured out the issue, the superfish-modified.css is in its own css folder in the actually module so the correct path to over ride should be:
/themes/newtheme/css/blocktopmenu/css/superfish-modified.css
10 points to me.
Is there a missing "modules" in that path? Is it not…
/themes/newtheme/css/modules/blocktopmenu/css/superfish-modified.css
to me, should be
/themes/newtheme/modules/blocktopmenu/css/superfish-modified.css
and you must copy blocktopmenu from /modules to /themes/newtheme/modules/
Seems to be an issue related to this module. Here the solution

How can I modify a CSS file programmatically?

I have a legacy application that I needed to implement a configuration page for to change text colors, fonts, etc.
This applications output is also replicated with a PHP web application, where the fonts, colors, etc. are configured in a style sheet.
I've not worked with CSS previously.
Is there a programatic way to modify the CSS and save it without resorting to string parsing or regex?
The application is VB6, but I could write a .net tool that would do the css manipulation if that was the only way.
You don't need to edit the existing one. You could have a new one that overrides the other -- you include this one after the other in your HTML. That's what the "Cascading" means.
It looks like someone's already done a VB.NET CSS parser which is F/OSS, so you could probably adapt it to your needs if you're comfortable with the license.
http://vbcssparser.sourceforge.net/
One hack is to create a PHP script that all output is passed through, which then replaces certain parts of CSS with configurable alternatives. If you use .htaccess you can make all output go through the script.
the best way i can think of solving this problem is creating an application that will get some values ( through the URL query ) and generate the appropriate css output based on a css templates
Check this out, it uses ASP.NET and C#.
In my work with the IE control (shadocvw.dll), it has an interesting ability to let you easily manage the CSS of a page and show the effects of modified CSS on a page in realtime. I've never dealt with the details of such implementations myself, but I recommend that as a possible solution worth looking at. Seeing as pretty much everyone is on IE 6 or later nowadays, you can skip the explanations about handling those who only have IE 5,4,3 or 2 installed.
Maybe the problem's solution, which is most simple for the programmer and a user is to edit css via html form, maybe. I suppose, to create css-file, which would be "default" or "standart" for this application, and just to read it, for example, by perl script, edit in html and to write it down. Here is just the simple example.
In css-file we have string like:
border-color: #008a77;
we have to to read this string, split it up, and send to a file, which will write it down. Get something like this in Perl:
tr/ / /s;
($vari, $value) = split(/:/, _$);
# # While you read file, you can just at the time to put this into html form
echo($vari.":<input type = text name = ".$vari." value = ".$value.">");
And here it is, you've got just simple html-form-data, you just shoul overwrite your css-file with new data like this:
...
print $vari[i].": ".$value.";\n";
...
and voila - you've got programmatical way of changing css. Ofcourse, you have to make it more universal, and more close to your particular problem.
Depending on how technically oriented your CSS editors are going to be, you could do it very simply by loading the whole thing up into a TextEdit field to let them edit it - then write it back to the file.
Parsing and creating an interface for all the possibilities of CSS would be an astronomical pain. :-)

Resources