-
Posts
10,912 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
The problem is that PDO is outside the PW namespace, which is why the "\" is necessary to get you to the global namespace. That change definitely works for me. But then you'll get an error with the way you have your execute([$limit]); I would go with this version instead: function getKappers($limit = 10) { $rs = wire('database')->prepare("SELECT * FROM appointment_kapper WHERE (actief = '1') ORDER BY volgorde LIMIT :limit"); $rs->bindParam(':limit', $limit, \PDO::PARAM_INT); $rs->setFetchMode(\PDO::FETCH_ASSOC); $rs->execute(); return $rs->fetchAll(); } Note that I also used FETCH_ASSOC so you automatically get an array back without needing to iterate the results to build it up.
-
Is that the entire contents of your contact.php file? I would say you'd probably just want to add that echo statement (wrapped in PHP tags) somewhere above or below your address block. You will also need to add the google maps script tag on the page - you could likely do it with your angular script code, but depending on how this template file is used are where the <head> and <body> tags are defined, it might be better to place it in that other file: _main.php perhaps? You could add some additional logic that checks the template of the page before adding it.
-
That just goes into one of your template files, like: site/templates/home.php or basic-page.php, or perhaps contact.php if you are putting this map on a contact page that uses a template named "contact". Do you have a PW site up and running with one of the initially installed site profiles? You should have at least a home.php template file - try there to start to get yourself going. It sounds like it might be worth reading through some of the tutorials: http://processwire.com/docs/tutorials/ We're here to help, but you should do a little reading first to make life easier on yourself!
-
Take a look at the Google maps example pages: https://developers.google.com/maps/documentation/javascript/examples/map-simple Remember that with PW your template files are what is used to output the HTML. It depends on how you have your template structure/logic setup - Direct vs delayed output. They key thing is to have the script output on the page where the maps needs to be displayed. I still think it would be easier for you to use that MapMarker module I linked to - it will take care of all of this for you!
-
If you're using ryan's MapMarker module (http://modules.processwire.com/modules/fieldtype-map-marker/) you can add the API key in the module config settings. If not, this page explains how to add it when you manually add the script: https://developers.google.com/maps/documentation/javascript/get-api-key <script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" type="text/javascript"></script>
-
Thanks @mel47 and @Klenkes - I have pushed that version to Github. Happy holidays to all!
-
Thanks @tpr - I have implemented that, although I was a little hesitant. I certainly like the look, but I was worried about the consistency of the interface compared to what we're used to with ASM Selects. Curious why you haven't done this for the roles settings in AOS?
-
Are we talking children of pages or the children that make up the repeater field (that live under the Admin branch). If the latter, then I think my idea sounds good, but again, sorry I really haven't read through this thoroughly. I really am just thinking from the experience I had with that Pagetable to Repeater(matrix) converter. I didn't recreate the child pages, I just moved them from the page table parent to a repeater parent location and then renamed them using the repeater naming scheme. There was lots more to it than just that, but this way it turned out completely reliable, whereas copying resulted in all sorts of problems with there were complex sub-field types involved. Anyway, I think I should bow out from this now as I really am not following properly
-
You like to keep me busy don't you How's this? That along with a few tweaks/fixes has been committed. Don't forget to fork and contribute
-
i haven't been following thoroughly and maybe PW should be dealing with this, but this is what I used to manually generate unique repeater names for the PageTableToRepeaterMatrix action: private function getUniqueRepeaterPageName() { static $cnt = 0; return str_replace('.', '-', microtime(true)) . '-' . (++$cnt); } Maybe this is helpful?
-
Hi @mel47 and @Klenkes - sorry for the delay in dealing with your issues. I have implemented some fixes, but things are not well tested yet, so I am just going to attach the updated version to this post. @mel47 - can you please test the attached version and let me know if it fixes it. I inadvertently deleted my line ending fix in a recent commit. It has been reinstated so hopefully that will take care of this for you. @Klenkes - I am not against this idea because I can understand the problems you are having. Unfortunately I think that would be a huge change to the module. I'll definitely think about it, but I can't promise a timely resolution for this I'm afraid - hope you understand! Yeah you were right - I never implemented the multiple values separator logic for files/images. The attached version should take care of this. I have tested with field pairings, but not without at the moment. Please let me know how it goes for you.
-
Getting a little OT here, but @Juergen - if this is incorporated into Admin Actions, you could call it via the API like this: $options = array( 'field' => 99, 'sourcePage' => 1131, 'destinationPage' => 1132 ); $modules->get("ProcessAdminActions")->CopyFieldContentToOtherPage($options); Yes, that action should be improved to also handle field names (not just IDs), but you get the idea.
-
New version now supports running actions via the API. Here's an example of copying content of a field from one page to another. Simply load the module, and call the action class name as a method while passing the required options as an array: $options = array( 'field' => 99, 'sourcePage' => 1131, 'destinationPage' => 1132 ); $modules->get("ProcessAdminActions")->CopyFieldContentToOtherPage($options); Hopefully you'll find a use for this in your hooks or template files.
-
This sounds like a handy AdminAction Not specifically from the parent to child page, but a general one for copying/moving from one page to another. Not sure if it would be best as a new action, or incorporated into the logic of the "Copy Field Content To Other Page" action which currently only handles basic text based fields. I would like to extend this to support all field types.
-
Alternatively render textarea as plain text
adrian replied to heldercervantes's topic in General Support
strip_tags is the simplest for sure. If you want more control, try the textarea sanitizer: https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/core/Sanitizer.php#L1022 -
Would you mind adding a note to that issue to confirm that you are seeing it also? Thanks! Yes, that works, but probably not a good idea, because status values are additive - it may not really matter with repeaters, but I would still recommend that we get Ryan to sort out the source of the problem.
-
@CalleRosa40 - you may want to look at this: https://github.com/processwire/processwire-issues/issues/36#issuecomment-258702228 Firstly, it shows how to unpublish a repeater, but it also shows that there is currently a bug with this - at least as far as I can tell, but Ryan hasn't responded to my last post, so will have to wait and see. I'd love your feedback on that Issue if you can also confirm what I am seeing.
-
Wishlist: Add a "Siblings" tab to edit mode
adrian replied to creativejay's topic in Wishlist & Roadmap
I don't have time to help out right now, but this would be an easy module to create - either added to the children tab (which you could rename to family) or adding a new siblings tab. -
Module Module: RuntimeMarkup Fieldtype & Inputfield
adrian replied to kongondo's topic in Modules/Plugins
Any chance $page->parent->title; is returning an object due to multi-language? -
@lokomotivan - you should never install modules with the "-master" on the folder name. The easiest way to install is to use the ClassName option, or URL, or zip links. This is way easier than manually extracting and copying to the modules folder and it takes care of this for you.
-
But a page can have more than one child You can define it as $page->child() or $page->children()->first() and you'll get the first child, but you need to define what child you are after!
-
It should work that way. I am just guessing that $child is not defined in the _init.php file, so your $postedago variable is blank/null
-
What did you set $child to?