OmniGraffle – awesome wireframe tool

September 29, 2010 § Leave a comment

I got introduced this tool awhile ago. Although it is a paid version, it works very smooth and nice for wireframe purpose.

Plugin I recommend would be Konigi’s Wireframe plugin and it is free

You can download it from http://konigi.com/tools/omnigraffle-wireframe-stencils

And the Omnigraffle trial you can try it from http://www.omnigroup.com/products/omnigraffle/

WPML and NextGen Gallery Translation

September 29, 2010 § 6 Comments

I was searching on the net to see if anyone did some script to integrate both. At the end, nothing seems to work, I finally figure out a quick method to translate a dynamic string.

From here you can see the official site document about the string register
icl_register_string($context, $name, $value)
so basically you put

$content as The plugin name (name it the way you want, coz we are going to use it in front end later ) , in this case ,we  use ‘NextGen’

$name as the Hook that we link to the string.

$value as the value of the string.

After we understand the usage of this function, it comes clear to us that we only need to put it to the place where the string appear.

From the first sense, I can think about the NextGen Admin Panel.

Backend

So go to the file in NextGen plugin called Manage.php in line about 364

if (isset ($_POST['updatepictures'])) {
// Update pictures

……
if ( nggGallery::current_user_can( ‘NextGEN Edit gallery options’ )) {
……

Following the line, put icl_register_string function on.

For example,
icl_register_string('NextGen', $_POST['title'], $_POST['title']);
In this way, we can capture the title value among the gallery if we ever update them.
Then we can go to WPML >String Translation to do the translation.

For sure, you could put the capture code to anyway in almost anywhere in the plugin

Front End

We can put icl_t($context, $name, $value) to call the string translation.

The function will find the string with combination of context and name, and if not the value given will be return.
in our example, icl_t(‘NextGen’, $gallery->title, $gallery->title) .

Please make sure you understand the usage of NextGen Gallery and WPML , it does help to peek at the coding as well.

Magento Tips for formatting decimal point

September 17, 2010 § 4 Comments

If you ever want to display front-end store with some modification of precision point.

You could copy

app>code>core>Mage>core>modal>Store.php to

app>code>local>Mage>core>modal , create files if need.

Then open app>code>local>Mage>core>modal>Store.php ,

go to function formatPrice
public function formatPrice($price, $includeContainer = true)
{
// return $price;
if ($this->getCurrentCurrency()) {
return $this->getCurrentCurrency()->format($price, array(), $includeContainer);
}
return $price;
}

You can see there is an array pass into the function format, adding following parameter will do.

array(‘precision’=>0) will make all decimal point go away. ;]

For the Admin side , there are quite a number of article to cover it.

Go to lib>Zend>Currency find
protected $_options = array(
‘position’ => self::STANDARD,
‘script’ => null,
‘format’ => null,
‘display’ => self::NO_SYMBOL,
‘precision’ => 0,
‘name’ => null,
‘currency’ => null,
‘symbol’ => null
);

modify the precision to 0 and there you go!

Where Am I?

You are currently viewing the archives for September, 2010 at Nick Wan L.K..