I wasn't sure where to put this topic but, I am trying to do a table view of some properties(houses) and i am using the publish content module to allow the client to publish and unpublish properties. I was wondering if it would be possible to apply a div class to property by if its published or unpublished.
Comments
Comment #1
merlinofchaos commentedAdd the published field. Set it to exclude.
Create a theme template (see theme: information and the advanced help on themeing for details) and override the table theme. When displaying the rows, you can look into the result data and apply a class to the row using that data.
Comment #2
chrislabeard commentedWould it be possible to add a php statement saying
Comment #3
chrislabeard commentedWould it be possible to add a php statement saying
">
Comment #4
chrislabeard commentedWould it be possible to add a php statement saying
">
Comment #5
dawehnerWhat do you want to say with this?
You can theme the content, yes. Therefore you have to add the published field, as hidden, and check the variable.
Comment #7
millenniumtreeHere's a template I created.
I have a view named 'search', that essentially overrides the site search.
I wanted to display some of the results (products), side-by-side, and the rest of the results on top of each other (clear:both)
I couldn't tell the different content types apart in the view, so I modified this template to add the content type into the views row.
Note the filename views-view-unformatted--search.tpl.php - it only overrides the search view with the unformatted style.
As you can see, this bit...
...is what adds the content type. Quite a lot of information is available in the $view->result[$id] object.
And don't forget to clear your cache on the /admin/settings/performance page.
I hope this helps someone.