Jump to content

gebeer

Members
  • Content Count

    1,007
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by gebeer

  1. @adrian Thanks for pointing that out. When I pass it like $child->render(array("useMain" => false)) and then check in the child template $useMain = ($options['useMain'] === false) ? false : true; I get the same results as passing it like $child->render($useMain = false) Which renders a blank page. So the problem is not passing the value for $useMain in the right manner. Rather it is the delegate approach that I'm struggling with. My places.php is calling the child template (place.php) multiple times for rendering each child page. Everytime the child page template is being called for rendering, _main.php gets included. Result is multiple rendering of the complete html from _main.php. Now when I set $useMain to false for the child page template I'd expect to just get the markup from that template. But instead I get an empty string. That's what is confusing me.
  2. Thanks for the quick reply. I adapted my code following your suggestions. My places.php <?php //template places foreach ($page->children as $child) { $child->rendered = true; $content .= $child->render(); }; ?> and place.php <?php //template place $tags = ''; foreach ($page->tags as $tag) { $tags .= "<li><a href='#'>{$tag->title}</a></li>\n"; } if ($page->rendered) { echo "<article class='article'>\n"; echo "<ul class='nav nav-pills'>\n$tags</ul>\n"; echo "<h2>{$page->title}</h2>\n"; echo "{$page->body}"; echo "</article>"; return; } else { $content = "<article class='article'>\n"; $content .= "<ul class='nav nav-pills'>\n$tags</ul>\n"; $content .= "<h2>{$page->title}</h2>\n"; $content .= "{$page->body}"; $content .= "</article>"; } ?> But still the same result. For each child page the whole _main.php gets rendered. I also tried in places.php foreach ($page->children as $child) { $content .= $child->render($useMain = false); }; with my original code in places.php But this gives a blank page again.
  3. Hello, I'm using PW 2.4.11 with its delegate template approach. I have a page "places" with template places.php to list all its sub pages <?php //template places foreach ($page->children as $child) { $content .= $child->render(); }; ?> All sub-pages of "places" have the place.php template <?php //template place $tags = ''; foreach ($page->tags as $tag) { $tags .= "<li><a href='#'>{$tag->title}</a></li>\n"; } $content = "<article class='article'>\n"; $content .= "<ul class='nav nav-pills'>\n$tags</ul>\n"; $content .= "<h2>{$page->title}</h2>\n"; $content .= "{$page->body}"; $content .= "</article>"; ?> Problem is that for every sub page the whole _main.php gets rendered. I guess this happens because of $useMain = true; in _init.php. How can I tell the place.php template to only include _main.php when it is not called through the render() method? If I add $useMain = false; to place.php, I get a blank page. I'm sure the solution must be really simple. But for me not being a coder, I just can't seem to get my head around it.
  4. Hi zwergo, great project. Thank you for sharing. A lot to learn from your code. I'm really happy that I could convince you to take another look at PW as the right tool for your project. Cheers Gerhard
  5. To answer my own question: I had to install the module first (stupid me had forgotten that). After that I could select it as a Process. Simple as that
  6. @Soma, thanks a lot for the module code. Very useful! I have created the module in site/modules/ProcessUnpublishedList.module I also created a new page under the admin tree. How do I assign the module to the Process for that page? It does not appear in the select field where all processes are listed and can be assigned. Cheers Gerhard
  7. @Wanze I set up a quick and dirty test for jsPDF library here: http://jspdf.webseiten-fuer-alle.de/ Underneath "Choose example" select "**NEW: addHTML()" and you will see the result instantly It handles floating images and divs very well. I like the way you can just drop in a complete HTML page and the result seems to be almost exactly what you see in the browser. So no more extra pdf templates. Definitely looks promising. As for saving the pdfs, that's a good question. Browser support seems to be fine.
  8. @muzzer jsPDF library can handle floating divs and images pretty well. I set up a quick and dirty test page at http://jspdf.webseiten-fuer-alle.de/ Underneath "Choose examples" select the last one "** NEW addHTML()" and you'll instantly see the result. For floating divs with mpdf have a read here: http://mpdf1.com/manual/index.php?tid=385 As far as I understand it in your example the text wrapping the div also needs to be wrapped with float and width (but then it won't wrap the div anymore).
  9. Great input, thanks Wanze! At the moment I'm waiting for the go from my client. They haven't signed off the project yet. So I'm still in the research phase. Once I start real work on the project I surely will consider your recommendations and will then keep you updated on my progress. WirePDF module looks promising. Have you ever experimented with client side PDF creation libraries like https://github.com/MrRio/jsPDF ? Cheers Gerhard
  10. My issue was related to wrong apache user/group in my vagrant box. After changing those I can now login.
  11. Finally was able to solve my issue. It was related to user/permissions on my vagrant box. apache was running as the wrong user. After changing that I can now login
  12. I'm still not sure exactly which way to go with PDF creation. There is also a client side JS library: https://github.com/MrRio/jsPDF We'll have to check this out more thoroughly. Maybe it will make things like floating images possible?
  13. Sorry for crossposting from there. I have the same problem on admin login on my vagrant dev box. I went through all related posts here in the forum but couldn't find a solution. Here's what I tried: First thing I grabbed latest dev branch and updated /wire and index.php. I checked permissions for /assets folder and content as well as config.php. All set to 777 just to make sure, I recreated cache, logs, sessions inside assets and reapplied permissions I tried setting $config->sessionChallenge = false; I tried adding $config->protectCSRF = false; (here the login screen just reloads without showing the message) I'm not using blank profile Installed a brandnew dev version -> same problem Turning on debugging, I get: Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/pwfoundation5/site/assets/sessions) in Unknown on line 0 A 0 byte session file gets created. So sessions folder is obviously writable. jan reported the same here. But in my case there's ample space on the dev machine and I can manually create files with content from command line inside the session folder. Now I'm really lost and don't know what else to try.
  14. git push ignores those dirs because they are listed in .gitignore Just came across this post trying to solve the same issue...
  15. @benbyf nice website you have there. I particularly like the way you present your works. Elegant animation on the buttons and the filter effect is way cool.
  16. This is great and very useful. Thanks a lot Can! May have spotted an error. In line 33 you define the HTML table as $pdfOutput. And the in line 71 you go $mpdf->WriteHTML($table); I think it should read $mpdf->WriteHTML($pdfOutput); I will most likely put this to use. Only waiting for the customer to finally confirm that they want this feature. I will add the cart logic as discussed in the other thread and publish my code here. Will take another month more or so. Cheers Gerhard
  17. Hello Can, thanks a lot for your input. I will give this a shot and let you know how it works out. Vielen Dank! Gerhard
  18. Thanks Can for your ideas. After browsing through available modules, I think I'm going to use a modified version of Apeisa's cart module https://github.com/apeisa/Shop-for-ProcessWire/blob/master/ShoppingCart.module to add pages to a cart. Do you have any idea how to hook into the pages2pdf module on save/update of pages in the admin? I found this post https://processwire.com/talk/topic/2331-doing-additional-logic-after-saving-a-new-page/ Not sure though if that goes in the right direction and how to hook into pdf creation from there. Cheers Gerhard
  19. Hello and thank you for this module! I'm planning to use it on a client's side, but with some extended features: Users can add pages to some type of "shopping cart". All pages in the cart are then merged into a pdf that is offered for download. I am not talking about a webshop here, just the cart functionality. There is an extension for Joomla that does exactly that: http://netamity.com/extensions/contented-pdf I'm currently researching possibilities to build this with PW as I'm switching more and more over to PW from Joomla. So it would be great if you could give me any pointers on how to achieve the pdf cart thing in PW. Another idea is to create the PDFs for every page on save from admin. Then have the cart functionality which collects the already created pages and merges them into one downloadable pdf file. This would be less workload for the server (only merging existing files, no creation on the fly). Can we hook into your module from the admin on creating/saving a page? Cheers Gerhard
  20. I'm experiencing this problem on a vagrant box with nfs mapped www folder. Changing permissions of site/assets recursively and config.php to 777 doesn't help. I checked sessions folder. a 0 byte session file gets created. But the vagrant box has plenty of space available. I checked out brandnew dev branch, installed it and get the error on login to admin. All other PW sites on that vagrant box have the same problem. They used to work until recently. I'm not aware of any changes to the box that could have led to this behaviour. Any pointers to a solution would be much appreciated.
  21. Hi Larry, I have started a new thread about Yeoman genarator for PW.
  22. Hi all, today I stumbled upon yeoman and went searching for a PW generator. Larry Botha mentioned in a side not in his thread about MVC template approach that he has put a yeoman generator for PW together. I test installed it and it is working great. Pretty fascinating how quick we can setup a PW project with yeoman. This definitely can be a great timesaver. Larry's generator sets up a pretty opinionated PW install with his MVC structured fixate template and KSS etc. It would be great if we could have an unopinionated version that gives us a clean PW install. We could add options to the generator for installing a choice of boilerplate templates like the blank template, Foundation, Bootstrap, Blog etc. Just wanted to get your opinion on this. If any of you are interested, we could pull something together. Cheers Gerhard
  23. Hi Larry, thanks for the quick reply. I just test installed it on my dev box and am browsing through the structure. Indeed, this is pretty opinionated. So I'm not sure if I would want to work with it (no offense intended). It would be great if we could pull together a more general yeoman generator. I#ll start a new thread on that so we can get some feedback from the community.
  24. Hello Larry, this is great. Thank you for putting the Yeoman genarator together. Would you mind elaborating a little more on this, maybe in a new Yeoman generator thread? I think this can drastically improve our workflow with PW. Cheers Gerhard
  25. Thanks for pointing me to these options. I use these already and tried many other kinds of similar services. But none of them are like the real thing. I also like http://www.responsinator.com/. The name is just too cool. Especially when it comes to iOS-Safari specific bugs, Chrome device emulation doesn't reproduce them, like this one. When using device detection scripts, Chrome emulator doesn't return the correct user agent strings, see for example here I do test things with Chrome Dev tools but always on the real device, too. This seems the only way to make sure it is really looking as expected. Too bad, there is no real emulation for iPAd/iPhone available on Linux/Windows. Cheers Gerhard
×
×
  • Create New...