By olalindberg on
Hi!
I have configured a View that lists all Nodes of a certain type using the Filters in the View. I have also configured the Views Alpha Pager module to create a nice alphabetic index view.
What I would like to do now is to add some HTML that wraps each returned item from the filter with some HTML-code. For example: Lets say that I have list with company nodes and I would like to make all companies that has more than 50 employees bold. My idea was to set up a filter that just added the HTML-code to all returned elements.
Is this the way to the this or is there any other?
Comments
I might be totaly wrong using the View for this
After thinking about this for some more time I realized that my approach might be totally wrong...
It might be better to have some mechanism that adds a nodeContent if the condition is true (in this example if a business size field in the node is greater than 50) wherever this module is written in some other location than the View. The functionality might even be available on the node itself (I can't get to the computer from here to check). This way I could make the CSS look different depending on what parent HTML-element my node is written.
I guess it would be possible to do it in the Node tag something like this: http://drupal.org/node/187307 but it would be more convenient to make it in a node plugin or something like that.
Thats the best idea I have for now and I have no idea if it is a good way of solving my problem. I'll give it another try tomorrow and report back.
No success yet but I have
No success yet but I have another example of what I want.
In the image here: http://static.olalindberg.com/drupal/071031_ViewExample.jpg you will see an example listing with 3 nodes. What I would like is to have the possibility to exclude or include fields (in this case the image field) if a certain condition is true. In the example mentioned above to have the image printed if the company has more than 55 employees.
Working on customizing the view
Still no success. I'm trying to work out how to modify the output when my view is rendered based on this tutorial: http://groups.drupal.org/node%252F2647
I'll report back!
Success!
I have now succeeded with the listing I needed!
The answer was found in the following two guides:
Especially the first of the links helped me out a lot!