Jump to content

adrian

PW-Moderators
  • Posts

    10,912
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Is it possible that you have an .htaccess file at the root of http://wire.madaboutbrighton.net/ that is not the one that comes with PW? I see that http://wire.madaboutbrighton.net/ looks just fine, but if you add anything to that url you get the error you mentioned, so I am wondering if it is loading some other content somehow via a rewrite rule or something.
  2. If I understand correctly I don't think there is a built in way of doing this, but I have done something like this programmatically in front-end forms, so you could do the same with a hook on an admin form template. Curious though what your use case is. Couldn't you just have two page fields with the different parents? If not, one solution might be to hook on ProcessPageEdit::processInput and take the value from a text field (child_new) that would be where you'd enter the name of the new page, and then have a select for choosing which parent you want it added to (whichparent). I would actually disable the allow new pages to be create from field option to avoid confusion. Then after you have created the new page from the value of the text field, set it to blank so it can be used again. Sorry I don't have much time right now, so this should be considered pseudo code and ugly pseudo code at that, but maybe it will get you going! class NewPageCreator extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'New page creator', 'summary' => '', 'href' => '', 'version' => 1, 'permanent' => false, 'autoload' => true ); } public function init() { $this->addHookAfter('ProcessPageEdit::processInput', $this, 'addToParent'); } public function addToParent($event){ // ProcessPageEdit's processInput function may go recursive, so we want to skip // the instances where it does that by checking the second argument named "level" $level = $event->arguments(1); if($level > 0) return; $pp = $this->post->input->whichparent; if($this->input->post->child_new == '') return; //if no child_new entered, leave now $newchild = new Page(); $newchild->template = $this->templates->get("template-name"); $newchild->parent = $pp; $newchild->of(false); $newchild->title = $this->sanitizer->text($this->input->post->child_new); $newchild->save(); // Save the new child $pp->test_page = $newchild; //add it to the list of selected pages for the page field $pp->child_new = ''; //empty the child_new field - it is now in the main child field $pp->of(false); $pp->save("child_new"); } } I revised this significantly and did a little testing. This should now pretty much work, although note that field names for child_new and whichparent are hardcoded.
  3. return $page->parent; in the Custom PHP code to find selectable pages option.
  4. In case anyone is wanting to access the item link or summary, you just need to add these to the makeCalendarItem function. $a->link = $this->cleanText($item->link['href']); $a->summary = $this->cleanText($item->summary); and edit the __construct function appropriately.
  5. Hey Ryan, Just went to use this module and that break/continue error is still happening. I'll submit an issue on Github too. EDIT: Apparently I submitted an issue already - 3 months ago!
  6. Is this possibly the issue: https://processwire.com/talk/topic/6077-reduced-image-quality-of-images-added-to-image-fields/
  7. adrian

    English is Crazy

    I am sure many of you here will appreciate this: Sorry, can someone move this to pub?
  8. +1 for leaflet - it's very cool and lets you use your own map tiles too, if that's something you need. If you do ever want to go that route, take a look at mapnik for server-side generation of map tiles from SHP files.
  9. Thanks Steve, I'll see what I can do about incorporating these changes.
  10. Does this code from Nik help? https://processwire.com/talk/topic/1901-possibility-to-login-user-through-api-without-knowing-password/#entry21465
  11. There are other libraries, but this one is pretty powerful: phpexcel.codeplex.com Moved to here https://github.com/PHPOffice/PHPExcel I have used it to generate excel files from PW. Cool thing is that it also allows you to automatically generate charts from the data.
  12. You can use Video embed for YouTube/Vimeo and GetVideoThumbs together without any problems. Are you having issues?
  13. No worries - I haven't revisited this one in a while, so please let me know if you think of any improvements. I know the soma is not keen on the fact that currently you can't reuse templates as each new page field creates a new paired set of parent/child templates. So maybe I should aim to add an option for that, but I am definitely curious to hear your feedback.
  14. There is an option in the module config settings for that - it's called Redirect Type: Redirect vs Load. You'll want the load option. Just an FYI - the modules automatically adds a canonical link to the full url to help search engines.
  15. This module will get the thumbnails for you automatically: http://modules.processwire.com/modules/process-get-video-thumbs/
  16. horst - just a quick question - what about the versions of the imagick extension - are they both the same or at least both recent? The only other time I have come across colors being too bright in IM is with conversion from PDF. I really doubt it is related to the problem you are having, but it might be worth comparing the delegates.xml files between the two installations to see if there are any differences. Here is an explanation for fix for that particular issue: http://www.lassosoft.com/CMYK-Colour-Matching-with-ImageMagick Maybe it will be a lead in the right direction, even if it's not the exact problem you are having. The other things I can think of that might be worth a look is setColorspace vs setImageColorspace Also in my experience with images from PDFs I had to set the colorspace before reading the image. Maybe not an issue with ordinary images, but maybe worth investigating?
  17. adrian

    Polymer

    Looks like Angular might start making use of polymer elements, which would be really cool. Ember might be getting involved too. So much cool stuff happening - hard to decide which way to go. Throw Meteor in the mix as well and app development is starting to get really fun
  18. Hi rusjoan, Sorry you're having a bad experience at the moment, but I don't think it helps to get angry at PW. Just having a quick look, I see a couple of issues with your code. $config->paths will be empty because when you're inside a function you need to use wire('config') or $this->config depending on how you are using it in the module. This is because of PHP variable scope - there are lots of posts about this. Same goes for your use of $user and $input->get Try fixing those and see where you are at. I think there are probably more things amiss, but let us know what happens with those changes first. If you are calling the module on a use specific basis in your templates, which I think is what you are doing, then autoload false makes sense.
  19. You can definitely foreach over an array - no need to use implode. Implode is usually reserved for when you want to convert an array into a string with a particular separator between each item in the array - you could still use foreach for this as well - it's a matter of choosing the cleanest, most efficient and readable option in the given situation. If you are having trouble with the foreach, show us your code.
  20. Hey diogo - thanks for the clipmenu link - that looks pretty cool - I might be able to retire jumpcut finally An alternative to unarchiver that you might find worth a look is keka (http://www.kekaosx.com/)
  21. Does this do what you are looking for? http://modules.processwire.com/modules/process-redirect-ids/
  22. Hey Ryan - I actually get this is some cases and not others: Not sure why - not a big deal. I thought as much - just thought maybe you could store an array matching values to the variables and replace them on display. Again, no big deal - much more important things to do
  23. You can either foreach through the field: foreach($page->select_field as $selected){ echo $selected->title . '<br />'; } or implode: $page->select_field->implode("<br />", "title"); https://code.google.com/p/jquery-asmselect/issues/detail?id=46
  24. I wish you could extend me - might be preferable to a clone (that would just be scary). Too much work, not enough sleep, don't know what task to tackle next.
  25. You still need to add a ->url after that. At the moment you are referencing the entire article_secondimage. You need to add the url property. Other options include, filename, description, ext etc.
×
×
  • Create New...