Jump to content

bernhard

Members
  • Posts

    6,629
  • Joined

  • Last visited

  • Days Won

    358

Everything posted by bernhard

  1. i think it's more related to setting up a proper rewrite base than changing this module. https://processwire.com/docs/tutorials/troubleshooting-guide/page3
  2. hi roych, you should be as clear as possible in your questions. you don't explain what the problem is. you could add screenshots how it is and how it should be. styling is usually done via CSS. answers depend a lot on your setup...
  3. vary small thing: could you please make the column width inputfield selected by default after clicking on the width shortcuts? that would make it very fast to change multiple columns at once: click column type number ctrl+s thank you
  4. do those pages have a title field? maybe you removed it? in the pagetree you wouldn't realize it because it would show the page name. try a tracy console like $child = $pages->get(_your_childpage_id_); d($child->id); d($child->title);
  5. DEPRECATED - this module will not see any updates. I'm short before releasing RockGrid as commercial module. If you are interested contact me via PM this is a preview of a module that i'm working on for quite a long time. I needed it for an intranet office management application that i'm still working on. It makes it very easy to create very customized Datatables using the awesome jquery datatables plugin (www.datatables.net) Download - sorry, removed as it changes too frequently; closed alpha - contact me if you think you can contribute Remarks: The module is intended to be used on the backend. Loading styles is at the moment only done via adding files to the $config->styles/scripts arrays. Also the communicaton to javascript is done via the $config->js() method that is built into the admin and would have to be implemented manually on frontend use. But it would not be difficult of course Installation: Nothing special here, just download + install edit: removed some parts, because i made a complete rewrite of the module (and may not have been the last one)! [...] removed Why i created this module: of course i know @Soma s module but i needed a lot more features and the newer datatables version. also i like to define all the columns as objects and have everything on one place. lister & markupadmindatatable: nice for basic tables but lacks of features to modify the appearance of the cell values (like rendering icons, background colors and so on) datatables provides a great frontend API for filtering, showing/hiding columns, getting data, modifying it... it also plays well together with frontend charts like google chart api in this case: todo / roadmap: reload only one row add filters to all columns (in future also dropdowns, smaller than, bigger than, Regex, ...) make it possible to add table on frontend pages make buttons look like pw buttons make it possible to set settings globally and only for one table provide easy way of colorbars (percentage, red/green), maybe at different positions (left, top, right, bottom) provide easy way of adding action items (edit, show, link etc - visible or onhover) make own layout for tables (topleft, topright, bottom etc to make it easy to create extensions and show messages) privide way of simple javascript plugins (like I already have for row sums etc) provide easy way of handling actions for all selected items (delete selected, update selected...) provide easy way of reloading data (--> easy when using ajax source) easy way of showing/hiding columns excel/csv/clipboard export GUI for table setup processmodule to show different tables (lister replacement)
  6. hi! could you explain some details what has to be done, please?
  7. any news on that @Soma ?
  8. i would suggest doing the following: create a new template file for your page that holds the map data with exactly the code from the google example (javascript + html): https://developers.google.com/maps/documentation/javascript/examples/map-simple?hl=de change nothing but your api-key. when you view this page you should see the same map as on the google docs page. replace the fixed values for lat/lng/zoom by those saved in your processwire site. see my example above ($page->map->lat...) view your page, it should show the map at the position that you specified in your backend change your style by adding the styles options (see code below) view your page, you should see the new style if everything works, try to implement your map in your original template file var map; function initMap() { map = new google.maps.Map(document.getElementById('map'), { center: {lat: -34.397, lng: 150.644}, zoom: 8, // add comma here styles: [ { "stylers": [ { "hue": "#c1d72e" } ] } ] }); }
  9. just don't use the modules render() method and write the code on your own. you should know how to do that as you say you already did it without the module you have all the necessary field data in these variables: echo $page->map->address; // outputs the address you entered echo $page->map->lat; // outputs the latitude echo $page->map->lng; // outputs the longitude echo $page->map->zoom; // outputs the zoom level you can also just copy the generated markup of your render method and then adjust the necessary (parts of your) scripts.
  10. this module uses mpdf for pdf generation. maybe the docs help you? https://mpdf.github.io/fonts-languages/fonts-in-mpdf-6-x.html
  11. yes, it is: https://www.google.com/search?q=change google map colours should be very easy using their readymade styles: https://snazzymaps.com/
  12. thank you for your explanations @Nurguly Ashyrov ! this sounds great
  13. thank you for the quick response! i got that now hmmm... so you define your query on the client side? how can you make sure that people do not modify your queries in a way that you do not want? i read of your server-side restrictions regarding templates, but wouldn't it still be possible to modify the queries to some extend (like changing number of records to show, fields and so on). i'm thinking of someone maybe stealing content or creating his own json exports of my site's content...
  14. hi @Nurguly Ashyrov this looks very interesting! could you please provide a simple example how one would use graphql and/or your module with simple ajax requests? i guess this could be great to return data for https://datatables.net/ ?
  15. you could also put everything in one file to have all translations aggregated in one page in the admin custom code: return wireRenderFile('fieldmarkup', array('field' => 'calendarbox')); fieldmarkup.php <?php switch ($field) { case 'calendarbox': $out = '<div>...</div>'; $out .= '<p>...</p>'; echo $out; break; } i guess for easy fields that would be better than having a file for each field...
  16. i guess you could use wireRenderFile, then it should show up in the backend.
  17. today i came up with this solution. it finds the page related to a pagetable item, but it should also work for repeaters, i guess? for repeaters there is also the getForPage() method, wouldn't it be possible for you to work with this? my code: // find the related event page to the current coupon item $current = $pages->findOne('template=event, couponcodes.id=' . $page->id); // return all tickets of this event so that the user // can choose for wich tickets the coupon is valid return $current->tickets; it finds the page of type "event" that has the current item ($page->id) as part of its pagetable called "couponcodes" drawback is that this only works after saving. but thats necessary since the item wouldn't exist before saving... maybe i'm getting you wrong. but maybe it helps someone
  18. hi adrian, nice that you take up my idea. i may have the code somewhere but i don't think it would be helpful. i did a manual search&replace in the wire folder that writes all calls to a file. i think you'll have a much better approach in some minutes looking forward to your solution. what i mentioned when playing with it was, that it gets quite messy very quickly. there are lots of hookable methods and on every pagesave or edit there are lots of recorded hooks. it would be necessary to build some UI around that. or additional informations, like a dump of the event object or the like. I'm not sure what the best solution would be for this. do you understand what i'm talking about?
  19. hi jmartsch, no, i didn't release it, but it is still on gitlab: https://gitlab.com/baumrock/Alfred/tree/master as i remember nothing changed since then... hope that helps.
  20. hi guys, has anybody tried this module on a PW3 installation? are there better solutions out in the meantime? thank you for your help
  21. i would not see this as a problem. but i also don't want to discuss this further - uikit is just a personal preferation of mine. ryan will have to weigh all pros and cons and i'm sure he will take a great decision
  22. no, don't have enough time to follow the forum atm. i just saw some nice previews of uikit3 and was supposing that uikit 3 is as solid and awesome as uikit 2 was whatever framework it will be... I'm with you that any kind of framework will make it easier to collaborate and/or to get the context of how everything works in the admin more quickly.
  23. uikit 3 is now available as beta: http://yootheme.com/blog/2017/01/09/uikit-3-beta-released would be a perfect timing for a new admin *dreaming
  24. always depends what you want to do. only changing the field label on different templates would perfectly be fine without a hook. adding date+time would not be possible without a hook i just wanted to give a simple example what could be the next step
  25. kongondo beat me it may seem complicated in the beginning, but once you get the concept it's really easy and straightforward. you just have to look a bit into the code to know what is going on behind the scenes. take my code example, it's easy: // attach a hook whenever a page edit form is built // this happens in the class "ProcessPageEdit" in method "buildform" // see github how this method looks like: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L588-L595 $this->addHookAfter('ProcessPageEdit::buildForm', function($event) { // $event is the hookevent object; it holds all necessary data to execute all kinds of actions // https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L591 // here you see that the method gets 1 parameter and this parameter is the form, so if you want to get this form just do this: $form = $event->arguments(0); // to get the field of your form just do the following // see https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldForm.module // or https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ $field = $form->get('yourfieldname'); // now we want to do something based on the page that is edited // that is a bit different than in template context because we are VIEWING an admin page, whereas we are EDITING a different page // we want to know the template of the EDITED page, so let's get it... // $event->object is the class where the hook is attached. in our case "ProcessPageEdit" // to get the edited page this class has an own method: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L2009-L2019 $page = $event->object->getPage(); if($page->template == 'template_a') $field->label = "this is field label on template a, it is " . date("d.m.Y H:i:s"); elseif($page->template == 'template_b') $field->label = "this is field label on template b, it is " . date("d.m.Y H:i:s"); else $field->label = "other template, it is " . date("d.m.Y H:i:s"); });
×
×
  • Create New...