Symfony plugins – sfJQueryLightboxPlugin

It is Symfony plugin written by me.

This helper transforms image link into fully featured lightbox effect. Automatically creates gallery for all lightboxed images on page.

Try out demonstration

Learn more…

Symfony plugins – sfJQueryUIPlugin

It is Symfony plugin written by me.

This is form widget plugin. Currently available is only one widget, sfWidgetFormDateJQueryUI which uses jQuery DatePicker to choose date. Widget displays one input tag (not three seperated input tags for year, month and day like sfFormExtraPlugin).

Try out demonstration

Learn more…

Symfony plugin – sfFlashMessagePlugin

It is Symfony plugin written by me.

Its displays user flash messages using two methods. First method displays very nice looking notify bar which pops from the top and disappear after defined amount of time. Second method displays growl-like messages at the right side of the browser window.

Try out demonstration – method one: growl
Try out demonstration – method two: pop

You can customize look and feel by changing delay time, colors, sizes and much more.

Learn more…

jQuery and # selector

After I’ve read jQuery documentation it was obvious to me that selector like this:

$('form #category')

will work. It will not. Id selector ‘#’ works only when its alone (and that’s right after all, id should be unique):

$('#category')

If your page is not well build and you  have multiple id with same name and want to use id attribute with selector try this:

$('form input[id='category'])

It will work fine.

Installing Symfony 1.2.x – my way. Quick tutorial.

Requirements

Download and install Symfony

cd /path/to/your/home
#note: not www document root !
wget http://www.symfony-project.org/get/symfony-1.2.9.tgz
tar -xzf symfony-1.2.9.tgz
rm symfony-1.2.9.tgz
mv symfony-1.2.9 symfony
#note: if you want to use ZendFramework and SwiftMailer use same way

Check configuration of your server

php symfony/data/bin/check_configuration.php
#note: that php command can be php5 on some servers
#note: on linux systems sometimes php client and php www uses different php.ini

Creating and configuring your project and applications

Create your project

mkdir yourproject
cd yourproject
php ../symfony/data/bin/symfony generate:project yourproject

Continue reading ‘Installing Symfony 1.2.x – my way. Quick tutorial.’ »

How to add more syntax highlighters to the Wordpress syntax highlighter plugin

I’m using awesome Syntax highlighter wordpress plugin. This plugin uses javascript library by Alex Gorbatchev. I was in need to add syntax hilighter of yaml files but unfortunately yaml syntax highlighter is available but not bundled with this library.

To add syntax highlighter of your choice you have to download according javascript file from here and put it in wordpressdir/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts (I need Yaml hilighter so I’ve downloaded shBrushYaml.js).

Then you need to modify wordpressdir/wp-content/plugins/syntax-highlighter-and-code-prettifier/syntax-highlighter.php and add following line

...
<script type="text/javascript" src="<?php echo $current_path; ?>scripts/shBrushXml.js"></script>
<script type="text/javascript" src="<?php echo $current_path; ?>scripts/shBrushYaml.js"></script>
...

Moreover, in above file, you can add some custom default behaviours for plugin (described here):

...
<script type="text/javascript">
 SyntaxHighlighter.defaults['wrap-lines'] = false;
 SyntaxHighlighter.defaults['toolbar'] = false;
 SyntaxHighlighter.all();
 </script>

Hello World !

Why this blog ? Because “sharing is caring” :)