Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. what is the inputfield selctable pages defined with? $field->attr("value", $field->getSelectablePages(new NullPage)); should work?
  2. It what I wrote at first its an array not a single image so you need to get it with first(). Sorry am on mobile here. Maybe someone else care to explain.
  3. Ah youre in module so no ouputformat so an file.field is always a wirearray. Hence the Pageimages error and not Pageimage.
  4. "Pageimages::getThumb" PageImages is an array, but you need to get one image object $image->first()->getThumb() Or just change you image field to 1 max image ------ Also $this->pages->find("section_img!=''") maybe rather: $this->pages->find("section_img.count>0") since image field is an array, it's not a text
  5. The place for that would be in the PaymentModule of your choice. https://github.com/apeisa/Shop-for-ProcessWire/blob/master/PaymentInvoice.module This is just a basic example module and you would add what you need after the order save, or just create your own invoice module. I'm not sure what you mean with in template level, but that makes the least sense to me.
  6. if you have the intro-pages have a distinct template you could do something like if($page->parent->is("template=intro-page")){ // or $page->parent->is("intro-page") $children = $page->siblings->prepend($page->parent); } else { $children = $page->children->prepend($page); } Or if you know the level you could do for example: switch($page->parents->count){ case 1: $children = $page->children->prepend($page); break; case 2: $children = $page->siblings->prepend($page->parent); break; }
  7. Just remove the "advimage" from the plugins... and remove the height and width attribute from img in the "valid_elements" in the TinyMCE advanced config, and be happy
  8. They're needed for the.image resize to be working with scaling it in editor. If image has no with or height it won't work.
  9. RT @processwire: Here's the start of a new Tutorials section we're building at ProcessWire: http://t.co/LH8kuBJt0R

  10. Looks like you have no body field? You can set the default search fields in the admin search module settings. Modules -> Core -> Page Search
  11. If using init.php it can get executed multiple times if you use render() to render something in your templates.
  12. Take care what you put in the _init.php. it can get executed multiple time if you use to render() pages inside the templates. Every render triggers slay what you have in init. Just good to know.
  13. Maybe its in demo mode.. look in site/config.php
  14. Soma

    World Cup 2014

    BASIL WAS ALSO THERE.
  15. AS far as documentation goes. I'm not sure, certainly it's spare, what the future of this module is and since it's wrapped up quickly by apeisa for simple own project, there isn't much support or development going. Although I find the readme and looking at the example payment modules enough to get it up quickly. I know this doesn't apply to all. Non experienced developers may struggle. But usually I find people scare away from modules (when they shouldn't) and think there's a lot of complexity that isn't there really. It's so simple as it doesn't requires much and works with the same API as much as you would with pages and in templates. A Payment module here is the module run when you get to the /checkout/payment/ step, it either just saves the order and shows a message or redirects, or it builds a form you need for your payment provider etc . Look at the simple invoice example. https://github.com/apeisa/Shop-for-ProcessWire/blob/master/PaymentInvoice.module processPayment() is the method called once you reach that point in the checkout. This can be anything that is required to do the payment. https://github.com/apeisa/Shop-for-ProcessWire/blob/master/PaymentExample.module
  16. Strange I've never experienced a 404 there the last 4-5 setups with this module. It's done using url segments /checkout/confirmation/, checkout is a real page and confirmation the segment. Checkout modules doesn't handle a 404 so there must be something else in your case. does the sc-checkout template really have url segments enabled? It should cause the module installs the template and sets that option. If that's set I don't know. Maybe cause you run it not from the root in a subfolder.
  17. Welcome! You just include(/path/to/file.php) http://php.net/manual/de/function.include.php You could also use a php switch() instead of if else switch($page->id){ case 1001: echo "..."; break; case 1002: include(...); break; case 1004: echo someFunction($page); // maybe a function default: echo ".."; } About the approach I'm not sure and don't see the whole picture, but experiment with different ones. There's no general "this is the best". Whatever makes sense and works for you. I think outputting content by id might be ok in one case, but maybe not so convenient regarding reading/maintenance and code compatibility. I usually try to avoid it. There's so many ways to build templates and output your code in templates, and it goes far beyond this question. And there's as many different opinions on what is good and what not. But some principals may apply always. Usually I find it more convenient to use different templates for different pages as much as possible.
  18. There's no markup module that output content themself, you always need to echo it. This makes it a lot more flexible as you only get a string back and can do things with it, or use it in a own function to generate markup and send it along. For me it's bad practice/design when a markup generation method uses echo to output it directly. Not sure what you mean. I think confirmation should be the details you entered read only, then you go on with the next step (this is where payment module is run). I'm not sure what PayPal module does, but the payment module does "something" and when done showing some thank you or redirect to some other page.
  19. Where is the echo?
  20. Can you show your code? Do you echo ... ?
  21. Well you just set the fields from the other page, and the $page will still be the same page object just with new content (on runtime). $p = $pages->get("/somepage/"); foreach($p->fields as $f){ $page->$f = $p->$f; }
  22. Ohh wallpapers! I have one too!
×
×
  • Create New...