Archive for the ‘Tips’ Category
img_assist inline image does not appear
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.
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.
Ternary Operator
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
<?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
Browser Test Tools
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.
