Peter Knight
Members-
Posts
1,377 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Peter Knight
-
Yes, I updated my post. I didn't want to create another post and monopolise the thread I don't really follow your instructions but that's me wrapping my head around this and not your instructions. basically, I didn't realise that url below could be the name of a field on my PageTable page. 'markerLinkField' => 'url' Based on this, you saying I can create a field called url and somewhow reference the parent page address in that? And by the way, the map I am referring to would be a map displaying ALL pins right across the site and not just pins associated with a single page.
-
Typically a pin on a map will link to the source PW page. However, I have a Map which pulls in locations and those locations are child-pages generated via PageTable. In this case, I want the pin to link to each pins parent url instead of itself. I've discovered an option in Ryans module which seems to control the links attached to the pins I'm not sure how to apply it to the following <?php $items = $pages->find("template=update-location, pt_map!='', sort=title"); $map = $modules->get('MarkupGoogleMap'); echo $map->render($items, 'pt_map', array( 'height' => '500px', 'markerLinkField' => 'url')); ?> I've tried these but obviously messing up my syntax or understanding of its workings <?php $link-to-parent = page->parent->url; //create a variable and then pass that to the markerlinkField $items = $pages->find("template=update-location, pt_map!='', sort=title"); $map = $modules->get('MarkupGoogleMap'); echo $map->render($items, 'pt_map', array( 'height' => '500px', 'markerLinkField' => ' . {$link-to-parent} .')); //call my variable here ?> <?php $items = $pages->find("template=update-location, pt_map!='', sort=title"); $map = $modules->get('MarkupGoogleMap'); echo $map->render($items, 'pt_map', array( 'height' => '500px', 'markerLinkField' => 'url->parent')); //try adding a reference to the parent ?> Can anyone point me in the right direction?
-
I think this is from hitting Publish on a PageTable page but then not hitting Save on the same. Or something like this.
-
Pages are being automatically created as children of the parent page.
-
Thanks Bernhard. That does indeed look cleaner. Im not sure why but this method doesn't always show my most recent pin. Whereas the longer code will. When I look at my parent page and scroll to the PageTable field, I have a notice saying: Once I check the box beside the missing page, the pin will show on a map using your code.
-
Got it. I needed to do this <?php // outputs multiple pointers from pagetable maps(pt_map) $items = $page->children("pt_map!='',"); $map = $modules->get('MarkupGoogleMap'); echo $map->render($items, 'pt_map'); ?>
-
Can't quite get this to work with Page Table though. Each PageTable instance is a separate child page, right? So if this works for repeater maps and assigns a map called incident_location with those pins, echo $map->render($page->test_map_repeater, 'incident_location'); how would I generate a map containing a pin for each pageTable?
-
Image doesn't load and it gives a 403 error
Peter Knight replied to zilli's topic in Getting Started
Hi @zilli You can add as many images as you want to an image field in PW. This is assuming your images field hasn't been set to max 1 when setting up the image field. If I have a PW page that requires several images, they're all dropped into my General Images field. Then, in CK editor, I choose which ones I want to manually output in my Body field. If we're working with templates and you want to iterate through several images and echo them onto a page (for example, a gallery) , you can do that easily. Can you give us a use-case? There is so much flexibility here, you can work in a number of ways with images. -
That's nice. Although I like the simplicity of Repeater, using PageTable instead means extra fields can be associated with each pins tooltip. IE I could have a Summary field and that could display on mouse-over of each locations pin.
-
Solved it. I just needed to update this: echo $map->render($page, 'incident_location'); to this echo $map->render($page->test_map_repeater, 'incident_location'); Seems obvious now :-/
-
Just updating my request with a visual. You can see this page refers to three locations and thats what I need to output on a single map. I'm thinking it might be the way to go. In the meantime, I created a repeater field based on the MapMarker field and in the Admin, this works well as I can pinpoint a single address for each of my three locations. In the back end, I'd have a few separate maps per individual page but that's ok. On my front though, I want my single map to display those three addresses. This is what I've been using to display a map for a single location <?php foreach($page->test_map_repeater as $map); $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'incident_location'); ?> I'm not sure how to isolate the address from each individual repeater map and pass it to the single MarkupGoogleMap above. I know my repeater map addresses have a value as they output when I try a simple echo such as <?php foreach($page->test_map_repeater as $mapinstance) { echo "{$mapinstance->incident_location->address}<br/>"; } ?>
-
Trying MapMarker for the first time and really love it. Is there a way for me to specify multiple addresses in a single Map field in the back end? I know on the front end, I can probably setup pages and repeaters and pull those into a map on the front end but thats not what my project requires.
-
How to display newly added field value in page.
Peter Knight replied to Citytech Tester's topic in Getting Started
There's plenty of great form tutorials on the web if you'd like to try building your own PHP form. Make sure you also look at the Form module which Ryan built and makes it real sime to create forms, collect results and notify recipients etc https://processwire.com/talk/store/product/2-form-builder-single/ -
Might be worth a shot. Only issue is my client is a professional services firm and prone to pasting all sorts of crud into text fields.
-
No joy Adrian. I added those lines to the Extra Allowed Content field. Having Googled the CK Editor forums, it does seem like it should have worked.
-
Just curious but why do you have a separate page for the reverse side? What you could try is having a single page and enable tags on your image fields. You can then create a selector to call any image with the tag of 'reverse" etc. just started using image tags here recently and in some cases has reduced my pages and templates significantly.
-
Was browsing the cheatsheet trying to pickup some new selector tricks and noticed the next all siblings selector. $page->nextAll($selector, $siblings) Introduced in Version 2.0 Description Return all sibling pages after this one, optionally matching a selector. $selector Optional selector string. When specified, will filter the found siblings. $siblings Optional siblings to use instead of the default. Based on the description above, should the following not return a pages siblings? <?php $solutions = $page->nextAll($siblings); foreach ($siblings as $solution){ echo " <a href='{$solution->url}'>{$solution->title}</a> ";} ?> It works if I drop the nextall and refer to siblings without the variable $ <?php $solutions = $page->siblings; foreach ($solutions as $solution){ echo " <a href='{$solution->url}'>{$solution->title}</a> ";} ?> Just curious really.
-
Morning (in my part of the world) I want to manually add a usemap to an existing image in CK Editor turning this: <img alt="" src="/site/assets/files/1151/diagram.gif"> into this <img usemap="#diagram" alt="" src="/site/assets/files/1151/diagram.gif"> When I save my page, the usemap is being stripped out. Having experimented with Content Type, ACF and HTML Purifiers and then investigating the Image field itself, I'm not having much look. A search for the forum and Google turns up nothing. As I am porting across a 6 year old MODX site, I wondered if ImageMaps are no longer really used or am I overlooking a setting?
-
Page field: select from a large number of pages
Peter Knight replied to HerTha's topic in Getting Started
Ohh that's nice. Hadn't seen this module before and it has a search too! -
Page field: select from a large number of pages
Peter Knight replied to HerTha's topic in Getting Started
Had a similar issue recently and tried a few of the Auto complete solutions for some client projects. It's worth mentioning that auto-complete only works effectively when editors know in advance the name of the page they need. This isn't always the case. What I'd love to see is a hybrid of the two. Ie a page select field where you can browse a tree AND search too. -
Adrian This should work for displaying the cover of a PDF in ListerPro? I'm using ListerPro to list a virtual directory of PDFs. Essentially each PDF is a page with a Files field. I drop my PDF in there and then use ListerPro to display the following I'll try it tomorrow but thought I'd check first. Unfortunately, I already have my File and Images fields named so that may affect things?
-
PDF files as single Pages (Virtual file repository)
Peter Knight replied to Peter Knight's topic in Getting Started
Hi Martijn The PDF pages open as PDFs without applying this. Probably because in CK Editor I am linking to a page and then selecting a file attached to that page. I imagine forcing the PDF extension is mainly used when I am calling a PDF page with an echo statement? -
PDF files as single Pages (Virtual file repository)
Peter Knight replied to Peter Knight's topic in Getting Started
Love ListerPro. Will definitely use it and it would allow me to use columns for last updated, modified by and even short descriptions of files etc -
Working on a site at the moment with lots of PDF downloads and was wondering how you handle these? In my ProcessWire projects so far, each PDF has generally be restricted to a single page. I normally create a field called Files and reference that in any CK Editor links. The problem I realised is that when one of these PDFs needs replacing, my client needs to remember every page where the PDF is referenced. With this site I'm currently building, I have multiple pages referencing the same PDF(s). In the CK Editor modal for linking files, I can of course choose a different page where the file "lives". I'm starting to wonder though if I should create a virtual Files directory which would simply be a container page with each sub-page representing and named after a file. This way, when my editors need to replace a file, they just need to replace and update in a single location. Any known cons of doing it this way?
-
Confirmed - this is an "issue" with PTExtended. On PT, the icon is once you hover over the row. Mine wasn't displaying as the field was caching some PTE settings.