Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by microcipcip

  1. @gmclelland I already have dump enabled, the problem is that I get a blank page when I output something, it seems that it is trying to return an object that is too big. With PHP I have a easier time debugging the code, but don't know how to debug even from there, when twig is enabled.
  2. I am having difficulty debugging variables within twig. Do I need to do it in PHP side instead? Everytime I try to dump something that isn't a very simple string or small array, I get a blank page. Is there any tip for debugging variables correctly? Here's a simple example (in a multilang website) where I get a blank page: {% for lang in languages %} {{ dump(lang) }} {% endfor %}
  3. @Basilico Agency I have exactly the same code and I am able to extend twig. For example with this code you can enable debugging wire()->addHookAfter("TemplateEngineTwig::initTwig", function($event) { $twig = $event->arguments('twig'); $twig->addGlobal('hsaApp', wire('config')->hsaApp); $twig->addGlobal('hsaDist', wire('config')->hsaDist); $twig->addExtension(new \Twig_Extension_Debug()); });
  4. Ditto this. I have been following this module development with huge interest. I too develop SPA with VueJS and this module will be very useful. Hopefully not a stupid question, but is it possible, for example, to get cropped images? Or more of a general question, can you manipulate the data before you fetch it? Here is an example of the JSON I generate ATM: { "banners": [ { "origin": { "description": "", "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.jpg", "width": 2500, "height": 1666 }, "thumb": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.400x400.jpg", "width": 400, "height": 400, "orientation": "" }, "bp": { "400": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.400x300.jpg" }, "800": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.800x600.jpg" }, "1200": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.1200x900.jpg" } }, "srcset": "http://www.mysite.localdev/site/assets/files/1/img.400x300.jpg 400w,http://www.mysite.localdev/site/assets/files/1/img.800x600.jpg 800w,http://www.mysite.localdev/site/assets/files/1/img.1200x900.jpg 1200w" } ] }
  5. I created a "editor" role with this access (see attachement) but I get the error in the second attachment
  6. Thanks a lot everyone :). It seems that PageTable field type is what I was looking for. It amaze me so much that it is included in the core, just a click away The Repeater Matrix looks amazing but I haven't got the budget yet to buy the proModules, although I can't wait to try them out, expecially the FormBuilder seems a huge timesaver! I have few questions regarding the PageTable field type. Is it possible to hide from the user (in the page tree) the folder I use for containg the PageTable sections? It seems that if I restrict access to the containing template the user can't add new pages anymore. How do I prevent PageTable sections from being accessibile in the front end? Should I just unpublish the containing folder and I should still be able to fetch the data right?
  7. Is there a way in ProcessWire of building single pages made of several draggable sections? For example, let's suppose that I am building the homepage and I want to have a banner section twice, a content area three times, and a testimonial section once, and a contact form at the end. My understanding of ProcessWire is that everything is a page, so I guess that these "Sections" in the ProcessWire world would be just pages with a specific template that are not browsable by default. Is this correct, or is there any other way of building something like this? Basically what I am looking for is a functionality like SilverStripe Blocks: https://github.com/sheadawson/silverstripe-blocks
  8. @gebeer that's cool, I like the idea of using the CMS API as much as possible for better consistency. How'd you rewrite this code? With vanilla PHP isset($_POST)? Can't see the equivalent with WireHttp. if(Rest\Request::is('get')) {} if(Rest\Request::is('put')) {}
  9. @clsource thanks a lot for the very detailed answer, about my fifth point I have found the following libraries: https://github.com/guzzle/guzzle http://phphttpclient.com/
  10. Thanks @Robin S that was it! Now it is working perfectly
  11. @kongondo I didn't fix this . BTW you don't need npm to use VueJS (although recommended). ATM I am not at home for a week but when I come back I'll create a VueJS+Router starter kit template for ProcessWire and share it on github, as I think other PW users may have this problem.
  12. Does anybody know how to do this? Is it possible to do a redirect without getting the 404 error not found?
  13. I guess it could be possible to write a function like this and wrap header and footer in a if statement using that function? So yes, I think you're in the right track. For JSON I'd enable url segments or use query string and do a request to the JSON. See this tutorial.
  14. Yes, see attachment. I have even tried to disable most of the modules I had installed. According to this thread, when there is a non existing template on a existing page, a 404 error is thrown.
  15. If I browse to an existing page that does not have a php template, for example `http://www.mysite.com/projects/`, in the console I get "[HTTP/1.1 404 Page Not Found 94ms]". If I then create the template used for the 404 error page, it redirects to that template and never hits the home page. If I browser to a non-existing page, then it redirects correctly to the home.php page. If I create the template for the existing page, then it uses that page as template as usual, and not the home.php... Do I need to use the home.php template as 404 error page? Still, it doesn't seem right that I'd get the [HTTP/1.1 404 Page Not Found 94ms] error message, expecially for SEO
  16. The problem is that the js router is using the same URL of PW so the urls do exist, that's why when I refresh I see a blank page, because there's no php template associated with those pages. Basically on PW I have a page like http://mysite.com/projects/ with a template projects (without php file) and the same url in the JS router. The only possible solution I have in mind is move all pages to a container so that in this way I'll be able to allow the app to hit the home.php segment. Is there any other way? I need to rewrite several areas of the app if I change the url (for example the nav...).
  17. I don't understand how this would work. If I have a js route to http://mysite.com/about/ it returns a blank page when I refresh the page because that template doesn't exist in the ProcessWire FrontEnd, it's only in the JS route. ATM I am already outputting everything in the home.php PW template. All I am trying to do is redirect it to the home.php entry point so that the router will get the right url and load the right js page.
  18. @Wanze thanks a lot, it works with the dev branch of PW. Is this the one that is usually released on Fridays?
  19. I have a VueJS single page app with a router, how do I redirect all requestes to the index.php page? The processwire .htaccess file is quite big I am not sure how to change it. This is what is suggested in the router docs: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>
  20. I've installed the newset version of the dev branch for this module with ProcessWire 3.0.36 and I am still getting the issue. Do I have to install the latest PW on dev to get it working?
  21. microcipcip

    14.000 Topics

    I am there too. Now is 14,003 and counting
  22. If you want you can try my flexbox grid. It is configurable and based on Sass. Only issue (I guess) is that it hasn't been used by many users yet so you may find some bugs, I am using it on live websites with great results though. Note as well that you need at least IE10 for this grid. https://microcipcip.github.io/gridy/#!/ If you are using Sass with Ruby, it definitely is worth the hustle! Node Sass uses LibSass that is a C++ implementation of Sass, and it is extremely fast. Usually on big websites it doesn't take more than few milliseconds to compile. My workflow is Gulp + Sass + Autoprefixer, then I install thoughtbot Bourbon and Bitter plus a custom made mixin for the media queries
  23. This is not a bad idea, I'd like to see a tutorial/guide of how to implement a REST API with common best practices and possibly the correct way of getting the image/repeater fields and show how to use query selectors with limits, pagination etc.
  24. @ryan I have a suggestion regarding the Roadmap. Why not providing a REST API as a pro module or in the core? Headless CMS are on the rise and there's a huge market of Front End developers (Angular, React, VueJS) that would love this. Caching and JWT auth integration would also be appreciated. At the moment setting up a REST API requires a little bit of set up, which may be trivial for a PHP developer but a little difficult for a Front End developer. For example looping all fields, by default won't show image fields or repeater fields, you have to add specific code to get them properly.
  • Create New...