![]() |
|
#1
|
|||
|
|||
|
I'm trying to create a pre-filled Google Maps URL for each listing in the directory. Each listing entry will have a street address field, city field, and state field in the db tied to it. I need to add those fields to a preset URL string and swap the spaces in each field with a + symbol so that the URL will automatically show up next to each listing and will point users to a Google Map with that address.
I don't know exactly which file I'd need to modify in the script. Can anyone help me out? Thanks in advance. |
|
#2
|
||||
|
||||
|
If you just need to format the link a bit then you shouldn't need to edit any files. Just edit your 'ADV_LINKS_SHOWLINK' template and add something like this for the URL:
google.com/?$link[fieldX]+$link[fieldY]+$link[fieldZ] |
|
#3
|
|||
|
|||
|
Thanks, got it working.
|
|
#4
|
|||
|
|||
|
This is incredible! It's just what I needed and it works fantastic! I used Yahoo maps only because I like their setup a bit better.
But I have a question.... Only some of my links categories need this. In fact about half of my link categories don't even use the custom address fields that produce the map link. Therefore... Is there a way to only have the google map link show up in certain categories? It would also be cool to have the map link in the pull down menu when you click on a link in the category i.e., - View Site - Get Map - View Link Details - Post Reply - Rate Link Thanks in advance for your time. |
|
#5
|
||||
|
||||
|
You can use an <if condition> within the tempate to limit it to certain categories.
Code:
<if condition="$catid == X OR $catid == Y OR $catid == Z"> |
|
#6
|
|||
|
|||
|
Quote:
Brian, you are so great to deal with, so much better than some I wont mention. ![]() What template handles the Link Options? I want to add the mapping feature there. |
|
#7
|
|||
|
|||
|
Doh! I think I found it. It's in the same template I think.
|
|
#8
|
|||
|
|||
|
Hmmm... I cant seem to figure this one out. I want the "View Map" option to right under "View Site" but I can't seem to locate where to put it.
Can you help me? |
|
#9
|
||||
|
||||
|
You mean in the drop-down menu, right? If so, the code for that would be located in your 'adv_links_linkbit' template.
|
|
#10
|
|||
|
|||
|
Perfect! Done! Thank you.
|
|
#11
|
||||
|
||||
|
Very Cool! Very, very cool!
Ok, I coppied the code for the website link in the drop-down, then modified it to map to Google Maps, threw in an IF condition for when there is a Suite Number, then threw in another IF condition so IF there is no ADDRESS data entered, it will not even offer the "View Google Map" option in the drop-down menu. Here is the code that I ended up with: Code:
<if condition="$link[field1]"><tr> <td align="$stylevar[left]" class="vbmenu_option falseclass"><a href="http://local.google.com/maps?f=q&hl=en&q=$link[field1]<if condition="$link[field11]">+Suite+$link[field11]</if>+$link[field2]+$link[field3]+$link[field4]" target="_blank"<if condition="$show['nofollow']"> rel="nofollow"</if>>View Google Map</a></td> </tr></if>
Here is a link to my website for review. Please keep in mind that I have only entered data into the fields of the very first entry: "Anchor Fellowship (The) - Map". The rest of the links LOOK like they have information entered, however this data is still all in the "Description" field collectively. After I work the kinks out, I will re-enter all the data in the correct fields for all the links. Thanks for your help! This is a VERY COOL feature! Jeff |
|
#12
|
||||
|
||||
|
1). Try removing the 'falseclass' part from the code you've added. That was added to the <td> tag that the 'View Website' link is located in to avoid some problems with vB's javascript not allowing the link to open in a new window, but should not be necessary in any other <td> tags.
2). Code:
<if condition="$link[field1] AND $link['field2'] AND $link['field3']"> |
|
#13
|
||||
|
||||
|
Great! Thanks for the help Brian!
So, should I leave the 'falseclass' part of the code in the "View Website" TD tag? It would seem to me that since both the "View Website" and the "View Google Map" links are triggering a new browser window to open to reference offsite resources, that IF the 'falseclass' is still needed in one, then it may be needed for both??? What's your recommendation Brian? Can I remove it from both? Has vB's javascript been improved since that work-around was originally implemented? Thanks again! Jeff |
|
#14
|
||||
|
||||
|
I just tried removing that from my local copy and did not have any problems in IE7 or FF, so it looks like vB might have fixed the issue. You can try removing it, and as long as the links still open in a new window, then it's fine to omit that code.
|
|
#15
|
||||
|
||||
|
Did it, works fine, thanks a lot!
Jeff |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ...just create a link to forums from CMPS Home Page | Sean Massey | "How Do I..." Questions | 7 | 11-03-2007 11:35 AM |
| Forum Listing | warcom | "How Do I..." Questions | 2 | 04-04-2007 10:17 AM |
| HOW-TO: Display link ID# in a listing? | ataraxia | "How Do I..." Questions | 5 | 10-07-2004 04:24 PM |
| How do I create a link Block | b4ne | Troubleshooting / "How do I..." Questions | 15 | 08-29-2004 08:56 AM |