Jump to content

bernhard

Members
  • Posts

    6,629
  • Joined

  • Last visited

  • Days Won

    358

Everything posted by bernhard

  1. in my last update from InputfieldHandsontable I inject the scripts in the init method: https://gitlab.com/baumrock/FieldtypeHandsontable/blob/master/InputfieldHandsontable.module#L26-35 field-specific CSS is loaded inside the render method with jquery like this: https://gitlab.com/baumrock/FieldtypeHandsontable/blob/master/InputfieldHandsontable.module#L61-69 +1 for a comprehensive tutorial on this thanks @abdus sentineljs looks nice!
  2. I might be wrong but I think scripts get loaded when added inside the init method of the inputfield
  3. hmmm... good question. i guess at the current setup this would not be so easy. maybe it would be better to change how the data is stored. it would be nice to let the storage know in wich column the data lives, for example. then it would be possible to move/change a table's setup after data has already been stored. but if you find a quick solution i'm happy to accept a pr on this
  4. i knew it but still i would prefer a solution during install. the topic is maybe also related to wireshell... personally i don't use either of the mentioned solutions. maybe i'm just too lazy. but maybe there could be a more streamlined or standardized way of doing this... or maybe i should start using moduletoolkit. i'll have a second or third look on my next project
  5. @abdus exactly, but we are getting offtopic here
  6. Nice idea. And a textarea to post the names of modules to install automatically. And an URL field to post the URL to a gist with a basic setup ^^
  7. just pushed an update to support ajax fields and also fields inside repeaters
  8. hi and welcome to the forum! you can bootstrap pw from your app like this: https://processwire.com/api/include/ and create a custom login like this: not sure if that's the best solution in your case - you would have to give us more informations but maybe my links already help you a bit.
  9. what about using less.js for development? it would be as easy as adding one line: $config->scripts->add('//cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js');
  10. hi and welcome bergy, the topic you are talking about is not an easy one... you can do a forum search (see my signature link) on keywords like "staging", "production", "synch" etc. as always in the world of processwire you have free choice personally i develop locally (i would strongly recommend you take a look on laragon: https://laragon.org/ . i replaced my xampp setup over a year ago and it's really great and fast and you can even put it on a usb drive and have a full dev server with virtual hosts and ssl certificates, mailcatcher etc.). regarding the migrations / staging/dev topic: i develop locally and when i'm (almost) done i put it on the live server. from that time on i develop directly on the server with daily backups and via vscode remote ftp plugin. it has some drawbacks but also some advantages, like monchu already mentioned the quick-fix ability when you are abroad. if you really need a proper dev/live staging system migrations might be the way to go. for simple changes you can also create/edit/remove fields and settings directly in your module so if you push an update to your live system you would also get the same changes to your database. in my projects it was easier to have a simple setup. in the rare case i needed bigger changes i talked to my client that he should not make any changes on day X and i changed their password after copying the live site to something else. of course, this would not work if you had user-input like form submissions or the like. that said, it always depends on the situation. summed up i would say there are three levels of complexity and what i do (or would do) in those cases: simple website with very simple edits --> live edit via SSH / FTP more complex edits with no changes while developing --> backup, do changes locally, upload back to live server complex changes with live changes while developing --> custom migration scripts, migrations module
  11. Same here. I think I'll stick to hooks.. Another thing: with AOS turned on I have problems with cke fields. The header is sticky and if you have lots of buttons the textarea will get inaccessible (first screenshot is AOS off and it works):
  12. it should always be a pagearray when you get the unformatted value: // change this $items = $page->{$f->name}; // to this $items = $page->getUnformatted($f->name); then you don't need the additional "else" statement
  13. why don't you use a hook to set the required attribute based on your condition? sounds easier than your way
  14. did you take a look at adrians adminactions module? i think there is a copy repeater contents action and i guess you can adopt it to your needs.
  15. offtopic, but see also field rendering https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/#field-rendering-with-template-files wireRenderFile() https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions and markup regions https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/
  16. don't forget to sell yourself (and not the system that you are using) find out what your client is looking for and then tell them what you can offer. if they are looking for a quick & cheap wordpress website (they can have good reasons for that), maybe you are not the right person for the job... (and maybe its also better for you to create one great PW site with a great client than 2 cheap websites with 2 not-so-great clients) think of the following 2 approaches and how the client may feel or what the client may hear: or this one: how would you feel? what would you think? maybe in situation one you would feel bad and confused because there is somebody telling you that something that most of the others are using is a bad choice? in situation two you can see instantly how the client reacts: does he want that quick&dirty way? does he want to be like everybody else? same situation but maybe totally different feelings for your client if he asks you for your reasons you know that he is interested (or at least curious). he knows that you are not the quick&dirty guy and he should not feel offended or over-instructed (telling him if he decides like 80% of all others he will regret - actually, when i read that, that sounds really strange and i totally understand my clients ). thanks for all the other input. i'll try to remember some points for future talks. especially yours @Jonathan Lahijani @DaveP thanks for that example. totally valid points too. especially for us as developers. but think of that in context of my first quote. that may create the total opposite message in your clients head: ah, this guy is a nerd. he speaks a language i don't understand and talks about things most other website owners obviously don't care about...
  17. Was also confusing for me! +1
  18. you could also use my handsontable module to create an input for each language and then query the column based on the language code and return the price. the module is alpha and you have to be careful when changing settings after field setup as data may bet lost, but maybe it's worth a try.
  19. wow, @abdus thank you for that hint! just took a look at their service and played around with their demo (https://demo.cloudinary.com/?mode=default) and this looks amazing! would love to see a module integrating with their service!
  20. this query will not be slow, so it would be nice if you showed us your current code
  21. you have 3 possibilities on any page of the admin. does not seem too hard for me?!
  22. Have you ever tried to work with reno for some time? my first steps for every project: - reno - tracy - AOS but it took me some time to get used to reno but it's much nicer to work with imho. you have the quicklinks on the left side always available AND you have more space on the right. i guess i didn't like it in the beginning, because it reminded me of the look and feel of wordpress hope we see some action on the new admin theme soon too. and i agree with you guys that the website looks way more old fashioned than processwire is. It's like visiting a website that has the latest news entry saying "merry christmas 2007 to all our visitors!" i always "apologize" for the look&feel when i present processwire to other devs and i tell them that they should take a look under the surface.
  23. thanks @adrianromega thats the breaking change i was talking about here:
  24. nothing fancy here. you see it's not polished and some hardcoded values... the javascript to handle the clicks: $(document).on('click', '.ckesnippet', function() { // find correct ckeditor instance $field = $(this).closest('li.Inputfield'); var id = $field.attr('id'); var ckename = id.replace('wrap_',''); var cke = CKEDITOR.instances[ckename]; var data = cke.getData(); cke.setData(data + $(this).data('snippet')); return false; }); and the hook to modify the field: $this->addHookBefore('InputfieldTextarea::render', $this, function($event) { $field = $event->object; if($field->name == 'rockinvoice_suffix') { $del = ''; foreach($this->wire->pages->get(38967)->texttemplates as $item) { $field->entityEncodeText = false; $field->description .= $del . '<a href="#" class="ckesnippet" data-snippet="' . str_replace(PHP_EOL, '', $item->body) . '">' . $item->title . '</a>'; $del = ' | '; } } elseif($field->name == 'rockinvoice_prefix') { $del = ''; foreach($this->wire->pages->get(38967)->texttemplates_greeting as $item) { $field->entityEncodeText = false; $field->description .= $del . '<a href="#" class="ckesnippet" data-snippet="' . str_replace(PHP_EOL, '', $item->body) . '">' . $item->title . '</a>'; $del = ' | '; } } $this->wire->modules->get('RockTools')->loadAsset('ckesnippets.js', 'HrDiamonds'); }); and a repeater to setup the snippets:
  25. it's one of many custom "hacks" all the items can be set by the client on a custom settings page. it's a regular repeater. then there is a hook that renders that items as field description and some javascript that adds the html to the ckeditor. thanks. no problem at all. but there's not really a lot of data... the table showing all the revenues for different years is a custom DB-view because there's no built in possibility for such listings in pw. the pw alternative would be many many foreach loops and thats a no-go.
×
×
  • Create New...