hi,
i just thought of sharing a little snippet on how to print postal labels with drupal out of addresses.
using cck and views templates, i created a custom function in themes/mytheme/template.php corresponding to my view (named label2).
then, by customizing print.css, i can only print the labels. note the "div style="page-break-after:always" to create page breaks with css2.
Renaud
/**
* View: labels2
*/
function phptemplate_views_view_list_labels2($view, $nodes, $type) {
$fields = _views_get_fields();
$taken = array();
// Group our nodes
$set = array();
foreach ($nodes as $node) {
$set[$node->node_data_field_country_field_country_value][] = $node;
}
// Set up the fields in nicely named chunks.
foreach ($view->field as $id => $field) {
$field_name = $field['field'];
if (isset($taken[$field_name])) {
$field_name = $field['queryname'];
}
$taken[$field_name] = true;
$field_names[$id] = $field_name;
}
// Set up some variables that won't change.
$base_vars = array(
'view' => $view,
'view_type' => $type,
);
$nl = "\r\n"; //line break
$output = $nl . '
' . $nl . '
';
$c = 0; // just a cell counter
foreach ($set as $label => $nodes) {
$items = array();
foreach ($nodes as $i => $node) {
Hey! I pretty much started developing this for about 4 months (first time drupaller) and it I released it about 2 weeks ago and haven't gotten around to posting in the showcase. It's an online music community for Portland Oregon and surrounding areas, pretty much is you sign up as a band or fan. Bands upload their music via the Audio Module and you know, get feedback from the fans.
Welcome to russian social network made for everyone interested in business, management, finance knowledge.
The community was build by using drupal modules like karma, userpoints, tinymce, og, views. Design is unique, but made on atck (very few).