Jump to content

alec

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by alec

  1. Thanks to nghi's post in http://processwire.com/talk/topic/690-map-marker-fieldtype/page-9#entry50956 I have made Google map info window with image inside.I have changed Nghi's (and Ryans's, or Ryans's and Nghi's ) code in MarkupGoogleMap module like this: foreach($pageArray as $page) { $marker = $page->get($fieldName); if(!$marker instanceof MapMarker) continue; if(!$marker->lat) continue; $url = $options['markerLinkField'] ? $page->get($options['markerLinkField']) : ''; $title = $options['markerTitleField'] ? $page->get($options['markerTitleField']) : ''; $images = $page->images->first->url ? $page->images->first->url : ''; $phone_number = $page->phone_number ? $page->phone_number : ''; $out .= "$id.addMarker($marker->lat, $marker->lng, '$url', '$title', '','$images','$phone_number'); "; } Where $page->images->first->url.... takes your first image from page where you have map field. Second code that I changed is in MarkupGoogleMap.js, where I have add info window: on line 96 I have add map_image to marker, which represent $images field. this.addMarker = function(lat, lng, url, title, icon, map_image, map_number) after, from line 122 i have comment, or you can delete this part of code. This part of code when marker is clicked directly goes to page. We dont need that for infobox, cause when marker is clicked infowindow needs to open. /** if(marker.linkURL.length > 0) { google.maps.event.addListener(marker, 'click', function(e) { window.location.href = marker.linkURL; }); } */ next is infowindow code. I have add this part of code near line 130 // info window var contentString = '<div class=\"chapter-bubble\">' + '<div class=\"chapter-bubble-title\">' + title + '</div>' + '<img width="200" src="' + map_image + '"/>' + '<div class=\"chapter-bubble-number\">' + map_number + "</div>" + '<div class=\"chapter-bubble-url\">' + '<a href=\"' + url + '\">Visit Chapter Site</a></div>'; var infowindow = new google.maps.InfoWindow({ content: contentString }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(this.map,marker); }); it creates info window with our fields, here I have add image width 200px, "map_image" of course is our first image from page, that will be shown in infowindow. This is minor change of Ryan's code, but it can be very useful, I have used it in my project, for infowindow. Of course, this can be implement in Info box also. Next thing that I need is custom icons for markers. So if someone knows solution for marker icons please write here. P.S. Thanks Ryan and all comunity for this amazing CMF and quick response for all my questions I have asked.
  2. alec

    PHP question

    Yes, i found "include" like possible answer. Thank you, @diogo
  3. Hello comunity. I have little problem with search form and templates. This is more like php question so I will appreciate for your help. I have "home" template, where I want to put search form and display it on main file. Form is in html div. Because if I put form directly in main file, then it would be show on every page, but i only want to show search form on home page. Now, question is, how can I put form in function, or php variable and later include in main file. I have try with "if" statement on main file, but it doesn't work. Here is form: <form id='search-form' action='<?php echo $config->urls->root?>search/' method='get' class='hide-for-small'> <div class="row collapse"> <div class="small-9 columns"> <input type="text" name="q" value="<?php echo $sanitizer->entities($input->whitelist('q')); ?>" placeholder="" /> </div> <div class="small-3 columns"> <button type='submit' class="button prefix">Search</button> </div> </div> </form> </div>
  4. Hello comunity! I have made google map info window with image inside. But I have problem with image folders. In MarkupGoogleMap.js i have added code bellow. Now, problem is when I add new image, it goes to another folder, here I have made route to "1023" folder, but PW generate every time new folder for images. So, my route to "1023" folder, works only for some images. Is there solutions for images url? // info window var contentString = '<div class=\"chapter-bubble\">' + '<div class=\"chapter-bubble-title\">' + title + '</div>' + '<img width="200" src="/process/site/assets/files/1023/' + map_name + '"/>' + '<div class=\"chapter-bubble-number\">' + map_number + "</div>" + '<div class=\"chapter-bubble-url\">' + '<a href=\"' + url + '\">Visit Chapter Site</a></div>'; var infowindow = new google.maps.InfoWindow({ content: contentString });
  5. Thank you very much for this answer. I am new to PW, and I am still exploring this awesome CMF.
  6. Hot to implement fancybox module for images, what do I need to do?
  7. Hello everybody from process wire comunity. I need sugestions from experienced process wire users about travel site that I want to create. Is it possible to create similar site like lonely planet, or stay.com with process wire framework?
×
×
  • Create New...