Jump to content

Nico Knoll

  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Nico Knoll

  1. For the url you would have to use urlSegements and do a check if a children has the name. Example: <?php // in your news template you add the following $childPage = $pages->get('/'.$input->urlSegement1.'/'); if(!($childPage instance of NullPage) { echo $childPage->render(); exit; } ?>
  2. Yeah I think you should start with the tutorial and then you come back and will realize how easy it is to do this with processwire (and maybe that my post above isn't that wrong)
  3. If your hoster allows it you can even use something like: <?php // fetch the json displayed on the service page $dataJson = file_get_contents('http://url.com/service-page/'); // transform it into a php array $data = json_decode(dataJson, true); ?> If this shouldn't work you can use file_get_contents_curl (not default PHP function but you can find it here: http://stackoverflow.com/a/8543512/4044167) instead of file_get_contents()
  4. Yes processwire supports this. But it's not really a sub-template. It's just a child-page using another template and a shared navigation which is as easy as: <?php $mainPage = $pages->get('/bio/'); $navPages = $mainPage->children()->append(mainPage); foreach($navPages as $navPage) { echo '<a class="tab" href="'.$navPage->url.'">'.$navPage->title.'</a>'; } ?> Structure could be like this: bio (using "bio" template(url for this child page would be /bio/)) - location (using "location" template (url for this child page would be /bio/location/)) - some other page (using another template (url for this child page would be /bio/some-other-page/))
  5. Use Form Builder - it's really easy to use and offers a lot of after submit actions like sending a mail and saving the data. And it's really easy and fun to create forms with it. So if you really only need a form you should use it
  6. @lostkobrakai: I removed the x if disabled and added the headline to best practice. Removed "implements Module", too.
  7. I added the code samples at the bottom. Could you guys take a look at it and tell me if I did some mistakes? http://modules.pw/
  8. @horst: - I added a json info option - added the closing } again - removed permanent - PHP and PW requirements should be included properly now What code is missing in your external config file?
  9. Are you sure you're using PHP 5.3? Because PHP 5.3+ should have finfo_open() included by default... http://php.net/manual/en/function.finfo-open.php
  10. Look at the description of how to use "Allow new pages to be created from field?": 1. Both a parent and template must be selected above. 2. The editing user must have access to create/publish these pages. 3. The label-field must be set to "title (default)". Have you specified a template new tags should use?
  11. I thought everyone could do this. I just added "Module" as a tag like in your picture...
  12. @Lostkobrakai: Added all of your suggestions @marcus: Of course! Let me know if I need to change something or if you want the source code @Craig A Rodway: Fixed it. @kongondo: It's written in PHP and doesn't use PW as backend. So I wasn't sure where to post. But probably module section would be the way to go. I moved it there now. And I removed the closing thing. @blad: Thanks!
  13. Hey, as I often just copy someone else's (sometimes my own) modules structure as a starting point for a new module I thought there has to be a better way to archive that. That's why I created the "ProcessWire Module Generator": modules.pw If something missing? Or some more wishes for options or best practices? Let me know Here's a screenshot:
  14. @Macura: Try to upload it directly into /wire/.../CKEditor (like here: http://monosnap.com/image/dETfuhFapWn79p36bIwmAsR6ANGNHc) and use the config.js to change it. Should look like this afterwards: /** * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; config.skin = 'lightwire'; }; And change the config.js in site/modules, too.
  15. I think it would be enough to have ProcessDrafts (containing all of the markup and logic that is needed to display the drafts page) and ProcessDraftsAutoload (containing all the autoload stuff and hooks)
  16. Okay - I'll do it when I'm back home from Japan
  17. What I want to archive is that you have like ten constant suggestions but still can add your own tags which should be saved but not appear in the drop down list. Maybe I have to change it a little than :/ Or is there another way to archive that?
  18. I would create them as user with no permissions (or only custom permissions). Advantage is that you can use user specific functions like $user->isLoggedin().
  19. @arjen: why don't just hide them using custom css and admincustomfiles module?
  20. Is it possible to allow users to add pages by typing in something but still only show the same pages as before in the drop down? For example I have "foo" and "bar" as pages which get shown in the dropdown. Now user1 types "lorem". So a page called "lorem" get created. Now user1 creates a new page. The drop down should only show "foo" and "bar" and NOT "lorem". Maybe if "lorem" would be "hidden" the drop down could exclude it... Could you add this as an option? Like: "make auto-created pages hidden to prevent them from appearing in the list"?
  21. @neeks: do you have debug mode enabled? Any errors? And why is autoload true? Process modules shouldn't have autoload enabled. It's better to create a "helper" module which extends wire if you need an autoload module
  22. Sounds good - could you post it as an issue on github? So I won't forget it
  23. +1 for Hanna code (maybe optionally?) using this module
  24. Nice, thank you a lot manfred! Will add some translations when I'm back home
  25. @beluga, @kamal: it's a Feature not a bug. If you set "max files" to 1 in your field config it should work without "first->". Otherwise it's not possible to know which image's url you want to receive as there could be more than one uploaded.
  • Create New...