-
Posts
126 -
Joined
-
Last visited
Everything posted by antknight
-
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; }
-
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>"; }
-
Prepending 'Home' instead of home page title to navigation?
antknight replied to antknight's topic in General Support
Thank diogo but that doesn't work because it adds a home link foreach child page. I will take Soma's advice -
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
-
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?
-
Ability to edit php templates in admin?
antknight replied to antknight's topic in Wishlist & Roadmap
@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/ -
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});";
-
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;
-
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!
-
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?
-
Thinking about building an "easy" site profile
antknight replied to statestreet's topic in Themes and Profiles
I generally use 960.gs and adapt.js. Although I do like Foundations use of * { box-sizing: border-box } -
Some good options there. Thanks. I am using the module at the moment but only works with a tinymce enabled textarea?
-
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
-
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...
-
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/
-
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!
-
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'
-
Wow! Thanks! I continue to be amazed by PW......
-
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.
-
I know! That's what I love about it
-
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.
-
Thanks Ryan, that trailing comma was exactly what I was wondering about how to deal with!
-
Thanks guys! Is there a central repository of syntax examples somewhere?
-
this request was aborted because it appears to be forged
antknight replied to joshuag's topic in General Support
Is it OK to just use the default install and just delete the fields, pages and templates? Anything else that should be done? -
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?