Link to docs about replacement patterns?

Silek - July 1, 2009 - 00:03
Project:Views
Version:6.x-2.6
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi folks,

I'd like to know, where I can find docs concerning relpacement patterns in views.
I want to replace a value of an integer field by a certain number of images depending on the value count.

THX

#1

merlinofchaos - July 1, 2009 - 06:17

To what replacement patterns do you refer? What you're doing sounds vastly more complex than you can do with the simple token replacements in the output rewriting (and what you can put there is fully documented right there) and probably requires custom theming in a field template.

#2

Silek - July 1, 2009 - 15:48

Do you have examples for that?

Thanks for help

#3

dereine - July 3, 2009 - 17:13

this is not possible right know because the replacement onyl supports simple things. No if...then constructions

but theming is quite easy

See this example


<?php
$data
= $row->{$field->field_alias};
switch (
$data) {
  case
1:
   
$output = theme('image', 'pathtoimage');
    break;
  case
2:
   
$output = theme('image', 'pathtosecondimage');
      break;
}
?>

 
 

Drupal is a registered trademark of Dries Buytaert.