Jump to content

adrian

PW-Moderators
  • Posts

    11,185
  • Joined

  • Last visited

  • Days Won

    372

Everything posted by adrian

  1. Sounds like output formatting may be off, or you have changed the Formatted Value for the field - what is that set at? Also, try this just before outputting the image and let me know what it returns. echo $page->of();
  2. Looks like the homeboximage field is not set to "1" for the Max Files Allowed setting. Either change that, or do: echo $homebox->homeboximage->first()->url;
  3. Hi everyone, Thanks to a request from @Ralf, this module now also works on the front-end. If you have setup your own login form and profile editing forms you can enable this for the front-end and specify a URL to redirect to for the user to change their password.
  4. This tutorial from soma might also be useful: https://processwire.com/talk/topic/4602-flexible-downloads-using-pages/ Also, if you're working with SVG files, these two modules might be of interest: http://modules.processwire.com/modules/image-rasterizer/ http://modules.processwire.com/modules/file-validator-svg-sanitizer/
  5. I think what you are looking for is whitelist: $input->whitelist($name, $value) Read about it under the getVars section on this page: https://processwire.com/api/modules/markup-pager-nav/
  6. New public method: TD::templateVars() templateVars() tv() Basically what this does is strip any system PW variables and returns just those that you have defined in your template file. It replicates what is output on the "Variables" panel, but lets you dump, barDump, fireLog, or log at whatever points you want throughout the execution of your template file script. Obviously if you are only interested in the changes to one variable there is no point in using this, but if you want to see how they all change, this is a nice shortcut. It is really only designed to work with PHP's get_defined_vars() Here's an example output via barDump: bd() $i=0; $x=10; bd(tv(get_defined_vars()), 'breakpoint one'); $i++; $x--; bd(tv(get_defined_vars()), 'breakpoint two'); This results in: Without tv() in there it would include all PW variables/objects and it would be difficult to see the variables you are interested in. Note that the templateVars() and tv() shortcuts/aliases may need to be turned on in the config settings if you are upgrading.
  7. Small update that enhances links from the PW Info panel Summary section - now you can have shortcuts to either view (page name) or edit (page id) each of the linked pages that are related to the current page. The children item now has: an "open tree" link (opens this page in the page tree expanded to show all children) an "edit" link (opens this page to the Children tab, which is particularly useful if you have Batch Child Editor installed). The template filename in the Template Info section uses the defined editor protocol handler to open the file directly in your code editor. Hopefully you'll all find these nice little time/click savers And page edit and template file edit buttons are also in the footer of this panel for instant access:
  8. Why did you have to comment those things out?
  9. Hi Esther, I have just been acquainting myself with Unbounce. It doesn't look like they offer a way to export their pages as HTML (https://community.unbounce.com/unbounce/topics/can_i_put_the_html_from_unbounce_onto_my_website). Sure you could view source, or use a browser downloader so that it grabs all javascript and css files as well, but it will be a but fiddly. It sounds like the correct way to go is to use CNAME records to handle serving of your landing pages that are hosted on the unbounce servers so they appear as part of your site. I'd still need to do a little more research to figure out exactly what is needed and what the options are, but it might be best to just go with what they recommend. Do you know what approach your web guy normally uses when hosting/serving unbounce pages.
  10. The init.php file needs to be: /site/init.php Have a read about this here: https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/#new-core-files-for-site-hooks PS - the hook would also work in /site/templates/admin if you only want to prevent the view link in the admin. If you want to prevent separate viewing on the front-end of the site as well, then it should be in /site/init.php
  11. Another approach would be a hook in your init.php $this->addHookAfter('Page::viewable', function($event) { if(strpos($event->object->template, 'section-') !== false) { $event->return = false; } });
  12. I thought I remembered there being something like that, but couldn't find it. Thanks for the reminder! PS And of course findIDs makes much more sense than my suggest getIds
  13. A "getIds" option might be nice. $pages->find($selector, array('getIds' => true)); It would be in a similar vane to: $pages->getByPath('/path/to/page', array('getID' => true)); but would obviously return an array of IDs, rather than a single one like with getByPath. Or maybe: $pages->getIds($selector); which has the same feel as: $pages->count($selector);
  14. I haven't read through, but since this forum is scheduled to be updated to IPBoard 4.x fairly soon, maybe there are some new options available: https://community.invisionpower.com/blogs/entry/9639-40-follow-system/
  15. Just wanted to post here to note that the issue @planmacher had has been fixed - it was actually affecting the role name and custom php code options.
  16. ProcessWire doesn't dictate any of the frontend code at all - you can write whatever HTML, CSS, and Javascript you want and simply add in the content from the PW database wherever you need. So, the answer is definitely yes, but you still may want to take the content from the landing page and make that editable by the Processwire backend, although this certainly isn't necessary. If it's the homepage of the site, then you will be putting the HTML they provide into: /site/templates/home.php - if there is no need for any php or calls for field data from the PW database, you can leave off the opening php tag completely. Hope that helps.
  17. Glad to hear it's working for you - hopefully this new approach will work in all scenarios. As for debugging debug.innerHTML - I haven't had to debug it yet - it's mostly generated by Tracy anyway. Being a JS variable, there isn't really an easy way of making it multiline without concatenation, which really isn't worth the trouble in this case. I am looking forward to Template Literals in ES6 though - we'll finally have real multiline variables for JS. But, back to your question, - if you do need to debug code like that you can use the regex find & replace option in your editor to replace \\n with \n and \\t with \t and it will be fully formatted. In Sublime Text (in case you use that), click the asterisk in the find and replace box - super easy!
  18. @matjazp - just letting you know that the latest version includes the fix for your problem. Could you please let me know if it works for you?
  19. Thanks @matjazp - that helped - I had forgotten to consider text after the last closing php tag. I have a fix that is working here. I have something else I am working on with Tracy right now so I'll commit both things fairly soon.
  20. Is your site available on the web somewhere, or just on your local dev setup? If you'd be willing to PM login details, I'd be happy to take a look.
  21. The position of the Tracy script after </html> might be a little weird - I am not sure their reasoning for this, but it's definitely a core Tracy thing, rather than an issue with this module. Take at look at their demo page and you'll notice the same thing: https://nette.github.io/tracy/tracy-exception.html As for the extra "?>" - that looks to be related to the Variables panel - I am injecting code into the end of the compiled template files to make this work. I thought my regex was handling all scenarios, but perhaps not. Could you please try clearing your FileCompiler templates cache and let me know if the issue remains. If it does, please post the last few lines of your template file so I can test here and fix it.
  22. Perhaps this module from kongondo will let you do what you need without need to add your own hooks: http://modules.processwire.com/modules/fieldtype-runtime-markup/
  23. Hi @citech and welcome to the forums. The problem is that yo can't directly call any php files inside the templates folder. There are lots of options to deal with this, but the simplest for you at this point might be to put the file outside the site folder - at the root of your site, or in a subfolder at the root.
  24. Hi @planmacher - it looks to me like your setup should work. The one obvious thing to check is that the "name" of the Projekte page is actually "projekte" - I assume it is, but it might be different. Can you confirm that first before we investigate further? EDIT: I just realized - you also need to make sure that projekte role has edit permissions on the home template that inherit down, or on the template of the Projekte page.
  25. Thanks for your efforts on this anyway Benhard!
×
×
  • Create New...