Jump to content

bernhard

Members
  • Content Count

    2,786
  • Joined

  • Last visited

  • Days Won

    73

Everything posted by bernhard

  1. Same experience I got when I wanted to try it on mobile. I thought that was because it was too new when I tried first
  2. Looking great! Thx! Nice to see apex charts in action. Did you build it as a module (or have thought about that) or is it implemented manually?
  3. Same here, now I know why I didn't know about it I'm using version 3.1 because I had something not working on 4.0 - I guess you are on a newer version?
  4. Just had a glance. German umlauts seem to not work:
  5. So would caching be an (easy) option? At the moment this is how RockGrid works: It makes one query to get one row (so the query should have limit=0,1) so that it knows which columns to setup for the grid. Then the second request is to get all data (and this is also used for all subsequent requests when reloading the grid). This is not the best solution, but I have no plans to change that for RockGrid. I start working on RockTabulator today where it will load all the data at the first request and display it instantly
  6. That's strang, thx for checking @Robin S ! I'll report back...
  7. Thx, but this does only allow P tags and strips all H, UL, etc
  8. Thank you @Robin S for this one! Do you know the syntax for "disallow all styles except text-align:left|center|right|justify ? The docs only show how to allow everything except: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_disallowed_content.html#how-to-allow-everything-except Or in other words: How can I disallow all styles so that they are removed when pasted from word (which works great with your custom config rule), but allow some formattings, like text-align features?
  9. Thx for the reminder about admin.php - I'm always creating hooks for injecting custom scripts. admin.php might be easier and a better place
  10. Hi @gbball, that's similar questions I asked when I shared my first project here in the forum, which was also a webapp with lots of mixed javascript + php involved. And I also stored lots of JavaScript in textarea fields: The project is dead, but you might still find some interesting code snippets in it - even though I would do everything completely different now Back to your questions: 1) What is JSON? https://en.wikipedia.org/wiki/JSON Modules are always the way to go when you want/need to reuse or share your code at some time. It's easier to just start writing code in the templates, but it's a lot more flexible, powerful and robust when you start writing modules and to understand OOP concepts of PHP. Which road you want to take depends on you, on the project, on the deadlines... If you want to start quick, just go ahead, get something done, have fun, hit some walls, learn, improve To my code example: Just take this in your home.php file to get the idea. <?php $js = (object)[ 'page' => [ 'id' => $page->id, 'path' => $page->path, 'name' => $page->name, 'title' => $page->title, ], 'foo' => 'bar', ]; ?> <script> mySettings = <?= json_encode($js) ?>; console.log(mySettings); </script> That way you can communicate between PHP and JS without mixing both languages in one file too much. Of course you assign the PHP $js settings to mySettings JS variable once, but then you can just access those variables from within JS. You could then include a regular JS file that shows your animations... checking for specific variables and values and then changing its look or features based on the value of those variables.
  11. Yeah, really easy. I'd write your own implementation: <?php $js = (object)[ 'foo' => 'bar', ]; ?> <script> mySettings = <?= json_encode($js) ?>; var yourLibrary = new yourLibrary(); yourLibrary.setWhatever(mySettings.foo); // mySettings.foo = bar </script> Escaping might be a problem sometimes. Just see how $config->js() does it; I think it would be nice to have such a feature built into ProcessWire - but a JS API is on the roadmap for a long time...
  12. Only thing I want to mention is that you do expose some date from the PW backend to the public that you might not want to expose, eg ProcessWire.config.urls.admin: It's not critical, but it's also not necessary, so you might be better off using your own implementation of that principle: https://processwire.com/talk/topic/14077-config-js-only-working-when-logged-in/?do=findComment&comment=126552 I think that is easier than unsetting/masking the admin url property in the js object (because that would have to be done on the server side).
  13. Thx @gottberg, glad we could find a sulution even though we couldn't find the reason for the issue
  14. https://processwire.com/docs/modules/hooks/#how-can-i-add-a-new-method-via-a-hook
  15. I've now came up with this setup which works really well for me: /site/config.php (can safely be committed to GIT) <?php if(!defined("PROCESSWIRE")) die(); /*** SITE CONFIG *************************************************************************/ $config->debug = false; $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; /*** INSTALLER CONFIG ********************************************************************/ $config->dbHost = 'localhost'; $config->dbPort = '3306'; $config->chmodDir = '0755'; // permission for directories created by ProcessWire $config->chmodFile = '0644'; // permission for files created by ProcessWire $config->timezone = 'Europe/Vienna'; // include config file from outside of the repo include('../config.php'); ../config.php DEV (one file for all laragon hosted sites on my local machine) <?php $config->dbUser = 'root'; $config->dbPass = ''; $config->httpHosts = [$_SERVER[HTTP_HOST]]; $config->debug = true; switch($_SERVER['SERVER_NAME']) { case 'www.XXX.test': $config->dbName = 'XXX'; $config->userAuthSalt = 'XXX'; $config->installed = 123456789; break; [...] } ../config.php LIVE (one file for each vhost) <?php $config->dbName = 'XXX'; $config->dbUser = 'XXX'; $config->dbPass = 'XXX'; $config->httpHosts = ['www.XXX.com']; $config->userAuthSalt = 'XXX'; $config->installed = 123456789; setlocale(LC_ALL,'en_US.UTF-8'); Thx for that ideas @arjen and @jens.martsch!
  16. Yes. Same here. Also on mobile it is a little annoying. Google does it like this: Ctrl+Scroll for Desktop: 2-finger-scroll for mobile:
  17. I understand, thx for the explanation What program did you use for the mobile screenshots?
  18. This issue is fixed now, but when I try to scroll down the menu further than shown on the screenshot the modal closes:
  19. This looks absolutely brilliant! Congratulations for this great work and thanks for sharing it with us! I've also tried it on my phone and everything just worked One thing that was counter intuitive for me was the left arrow icon on the top left corner of the frontpage. On all other pages this icon means "back", on the frontpage there is no "back" of course, but I didn't realize that I was on the frontpage, so it might make sense to remove the icon there? Another thing: I wanted to share the app with a friend, but the share icon is only available on sub-pages.
  20. Thx arjen! Never used field permissions because I've never needed them. Or actually I've just hooked the field and set it to locked collapsed state. I think your scenario is close to mine. The solution sounds great from a technical point of view and for the tools and settings we have. But I think it is not the way it should work! Imagine a site that manages users and invoices. That's all content, isn't it? So a content management system should be perfect tool for this job. Imagine you want to store forename, surname, email for users and you want to store net value, gross value, items and date for invoices. Processwire would be great for that, wouldn't it? Now imagine you want to show all invoices to some users, but the users should not be able to edit them. Not so easy! We have the tools for listing basic info (date, net, gross), but how could we show all details of the invoice to the user? The edit screen would be perfect. Well, if the fields were not editable there... Setting the fields themselves to read only sounds like a proper solution, but that's a lot of effort for such a simple and basic task! Imagine you had more fields! And imagine you added a new field later to the invoice template and forgot to set the field restriction... You'd have an editable field on a read only page. IMHO The fact that you've built your own custom process module for this proves that the tools we have are not enough! I just want to have a role that can see all data of invoice templates but not edit them. I think this is a fundamental hickup in the permissions we have. Or it is a missing process in the backend. Maybe we need a process that can VIEW pages in the backend if the user has view permission, even if the corresponding template file for frontend display does not exist? Not sure what the best solution would be, but it's not the ones I've used and heard so far I'm also happy to hear if someone disagrees. Have a great week and thanks for your opinions!
  21. Hi @Jonathan Lahijani, this sounds really great! I'm in for collaboration on this @wbmnfktr the problem that I have with site profiles is that they never work the way I want them to work. The setup is usually different to how I develop pw websites on the frontend. I tried to build a frontend theme module once last autumn, but it got complicated quite quickly. So to use such a module it would be quite some effort to get started (same problems as with site profiles). Nevertheless I think that it would be great to have some kind of frontend framework. Something similar to what we already have for the backend. That makes standard tasks easier (think of $config->styles->add(...) ) and - well - more standardized (meaning reusable/shareable). I thought of developing a module for that that would basically just bring in some helper functions (like rendering style and script tags) and that can be extended via sub-modules for CSS frameworks that hold custom methods (like rendering an uikit menu, uikit slider etc). I have not started with that one, but the benefit of such a module would be that we could start with a very simple module that everybody could easily use and it could very easily be extended via pull requests (add uikit slider render method, add uikit modal method etc). And this setup would be 1-click updateable via the PW modules screen. Some kind of migrations module could do the setup of necessary fields. Site profiles don't offer this flexibility! But it sounds like Jonathan is coming up with something great here...
  22. I'm sorry but I can't help you further than I did with this one. If you want me to have a look at your setup you can contact me via email/PM.
  23. Sorry, no - otherwise I would of course have posted them above. Please debug it, check the console for errors, try different browsers etc.; It is working here on all my installations.
×
×
  • Create New...