Hi There,
Thanks for submitting these updates :) its great when members give back!
I have gone through the changes and they are very sensible and having the ability to choose a tmpl file is a nice addition. The only thing that needs a rethink is the inline css being added to the page using the css variables.
Currently they are being added to the <dl> using the inline "style" attribute like so
Code:
<?php //dauthanhhai@gmail.com - start
$contact_width = $params->get('contact_width', '160px');
$contact_height = $params->get('contact_height', '160px');
$contact_margin = $params->get('contact_margin', '0');
$contact_padding = $params->get('contact_padding', '0');
?>
style="width:<?php echo $contact_width; ?>; height:<?php echo $contact_height;?>;margin:<?php echo $contact_margin;?>; padding:<?php echo $contact_padding;?>; float:left;"
<?php
//dauthanhhai@gmail.com - end
?>
Its good practice to keep all styling separate from the html for a number of important reasons, most of which is maintenance, they are less accessible and to keep the html clean and code count as low as possible.
See a good basic article about this here:
Best Practices: Avoid CSS Inline Styles
This is why using a class with php generated CSS is better, so...
The cleaner approach is to add a class to the div and then output the css to the selector using "addStyleDeclaration"
.someClass {
width: $contact_width;
height:$contact_height;
margin: $contact_margin;
padding:$contact_padding;
}
I will play with this a little when I get some time and try implement this change.
Thanks again for sending the updates back to us :)
Cheers,
Andy