Promet Knowledge Sharing

Archive for the ‘Tips’ Category

img_assist inline image does not appear

with one comment

There seems to be lack of documentation on how to properly install img_assist. It took me a while before I figured out how to make the img_assist inline images appear in node content. So here it is:

img_assist will only display images if the Input Format of the current node is Full HTML. You can select the default Input format to HTML by setting it in the Input Format Configuration page (go to Admin > Site Configuraiton > Input Formats). Selecting the Full HTML option is not enough though. We need to configure this so it can recognize the img_assist tag. In the Input Format configuration page again, click the configure link of the Full HTML option. Under the Filters group, make sure to check the Inline images checkbox. As per the description, it will add images to your posts with Image assist.

And that’s it. The images should appear.

Written by rachel

March 9th, 2009 at 3:29 am

Posted in Drupal, Tips

Tagged with ,

Ternary Operator

without comments

Usually we use the following snippet of code to assign a value in a variable given a condition:

<?php
if (cond) {
v = value1
} else {
v = value2
}
?>


This code can be expressed using the ternary operator.

<?php
v = cond ? value1 : value2;
?>


Of course we can use the ternary operator with nested conditions.

<?php
v = cond ? (cond1 ? value11 : value12) : (cond2?:value21:value22);
?>


But that isn’t really an advisable option :)

Written by jun

December 11th, 2008 at 8:49 am

Posted in PHP, Tips

Tagged with

Browser Test Tools

without comments

Wondering how your website look in different browsers? Check out the following for a view on how your website might look on a certain browser.

Written by tere

September 2nd, 2008 at 12:55 am

Posted in Tips

Tagged with ,