Hi, I've been searching day and night for a solution to my issue and can't seem to find my situation on this or other forums.
Basically I'm using Gmap with views and it works the way it should, map displays fine. I also customized the views-view-fields.tpl.php file to suit my content type.
But the problem i have is that when the marker is clicked on, it displays this content type's display. There are too many fields appearing in that
infowindow.
I was wondering if there's a way I can point to another file, views-view-fields2.tpl.php so that I can just display the content that I want.
In other words, I have views-view-fields.tpl.php which outputs..
Name
Location
City
State
Countryin that infowindow. But I would like to output only..
Name
Locationusing a file that I create called views-view-fields2.tpl.php.
I don't know what to modify so that I can basically detour the view to my customized file.
I hope someone can point me to the right direction.
Thanks,
John
Comments
_
Since views-view-fields.tpl.php is passed the view as a variable ($view) can't you simply add some conditional code depending on the value of $view->name ?
Pete.
hi pbarnett, Thanks for your
hi pbarnett,
Thanks for your response. Just for your reference, I'm just a beginner with php..
I see, so your saying that I can use a conditional statement like this:
Forgive my lack of proper use of commands above..If I can use this conditional statement, would it go directly in the views-view-fields.tpl.php file or would it go into the template.php file?
- John
_
Hi John!
There are so many ways to do this... I was suggesting that you change the views-view-field.tpl.php such that it has an if.. statement in it that checks for the view name being the view you want to customise; you could say something like
instead of doing anything more complicated. Note the curly brackets!
Are you new to PHP, or programming in general?
Your code would simply have to check the field name and display it if it was one you wanted, so to speak.
This is hardly a detailed explanation, and not necessarily the best way to do it, but it would definitely work...
Pete.
Pete, Thanks! that did
Pete,
Thanks! that did it!
Well, needed to modify the if/else a little bit, but this did the trick.
Thanks again!