Jump to content

antknight

Members
  • Posts

    126
  • Joined

  • Last visited

Everything posted by antknight

  1. In the admin the map doesn't load fully if the field is set to be collapsed on page load. I think it is because width is set as 100% rather than setting a size explicitly. .InputfieldMapMarkerMap { width: 100%; height: 300px; }
  2. This is what I came up with, it works, does it look ok? foreach($country->children() as $dealer) { $url = str_replace('http://', '', $dealer->website); echo "<tr class='reviews-row1'><td><strong>{$dealer->title}</strong><br>{$dealer->map_marker->address}</td>"; echo "<td>{$dealer->telephone}</td>"; echo "<td><a href='{$dealer->website}' target='_blank'>{$url}</a></td>"; echo "<td><a href='mailto:{$dealer->email}'</a>{$dealer->email}</td>"; echo "</tr>"; }
  3. Thank diogo but that doesn't work because it adds a home link foreach child page. I will take Soma's advice
  4. I am using the nav code snippet from the default site, but I would like to display 'Home' in the nav instead of the home page title. <ul id='topnav'><?php $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; } ?></ul> Any help much appreciated
  5. Is there a way to stop the URL field adding http:// upon save? Or perhaps there is just a way to strip the http:// for display on the front end?
  6. @netcarver Thanks! I just thought it might be handy to quickly edit template files, I seem to remember playing with something similar with http://get-simple.info/
  7. Ugh, thanks Ryan, it seems so obvious now....in my defence, it was late last night I posted that. Although how would I grab the anchor link of the parent of each marker i.e. #australia rather than #dealer1? Edit: Got it! $js .= "\nRCDMap.addMarker('{$marker->title}', '#{$marker->parent->title}', {$marker->map_marker->lat}, {$marker->map_marker->lng});";
  8. OK, I need some help with this. This is my setup: Dealers -Australia --Dealer 1 --Dealer 2 I would like a map on the Dealers page showing a marker for each dealer. Is there a way to have the marker link go to an anchor tag I have set for the country heading on the same page? echo "<div id='map'></div>"; //div to show in template map $js = "<script type='text/javascript'>"; $js .= "RCDMap.options.mapTypeId = google.maps.MapTypeId.ROADMAP;"; $js .= "\nRCDMap.init('map', 0, 0);"; $dealers = $pages->get("/dealers/")->find("template=dealer"); foreach($dealers as $marker) { $js .= "\nRCDMap.addMarker('{$marker->title}', '{$marker->url}', {$marker->map_marker->lat}, {$marker->map_marker->lng});"; } $js .= "\nRCDMap.fitToMarkers();"; $js .= "</script>"; echo $js;
  9. Would it be possible to have a module that allowed editing the actual page templates and css etc from the admin? Perhaps using something like http://ace.ajax.org/ That would be sweet!
  10. I notice Ryan writes lovely tidy html, especially noticeable in the default site installation templates. What is the best way to achieve this? I have tried a couple of ways, Espresso 2 doesn't have a tidy function so I occasionally use Dreamweaver for the 'apply source formatting' and have experimented with http://dirtymarkup.com/. Is it simply something that is done by hand or perhaps with another editor?
  11. I generally use 960.gs and adapt.js. Although I do like Foundations use of * { box-sizing: border-box }
  12. Some good options there. Thanks. I am using the module at the moment but only works with a tinymce enabled textarea?
  13. I agree, but with what fieldtype? URL? Then how to embed the video? They would have to copy the embed URL with the correct size from youtube. It would be good if the youtube video embed module worked with URL field
  14. gallery_image is a field within a repeater which is populated. That code returns gallery_image is: NULL. Also, I used a tinymce textarea to enable multiple youtube video embeds, best way to do that you think? I couldn't think how else to do it, but it does rely on them pasting each video link in a separate paragraph...
  15. Thanks! I did try if(count($page->gallery_image)) { but that didn't work... Can you explain what you mean by Are you referring to this? http://processwire.c...why-php-syntax/
  16. First question. How does PW deal with empty fields? Second question. I have made a repeater for a slideshow where you can set image, delay and caption. I only want the h6 to display if there are actually items in the repeater. How can I test for this? <h6>Images</h6> <?php foreach($page->gallery as $slide) { echo "<a rel='prettyPhoto[pp_gal]' title='{$slide->gallery_caption}' href='{$slide->gallery_image->url}'> <img class='peKbGallery' data-delay='{$slide->gallery_delay}' src='{$slide->gallery_image->url}' alt='{$slide->gallery_caption} (Click to enlarge)' /> </a>"; } ?> Thanks!
  17. Assuming I create a child page for each country and then child pages of each country for the individual dealers, do those pages need to be set to hidden in PW and hidden from search engines if they are not used on the front end? Do they need their own template.php or can I just use 'Create a new template without a file'
  18. Wow! Thanks! I continue to be amazed by PW......
  19. When using a repeater you effectively 'nest' a number of fields within the repeater field, which is really neat. Is there a way to nest without using a repeater? For example say I wanted to group all the SEO related fields for the page together e.g. title, meta description, meta robots etc and set the parent field visibility to collapsed to tidy up the edit page.
  20. I think the main problem is that I dont know any PHP beyond the odd include, so the syntax is what I have trouble with. I do try to find snippets in the forum but sometimes I don't know what keywords to use. I think you are right though about using google.
  21. Thanks Ryan, that trailing comma was exactly what I was wondering about how to deal with!
  22. Thanks guys! Is there a central repository of syntax examples somewhere?
  23. Is it OK to just use the default install and just delete the fields, pages and templates? Anything else that should be done?
  24. This is a silly question but I just can't seem to get the syntax right. I have created a field called 'logo' and added it to my template. Now I want to output the image on the website, what do I put in my php template?
×
×
  • Create New...