Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. What exactly is the problem? If you may do a redirect after form processing, the post var is lost.
  2. No, PW doesn't have to go through all pages, it's DB query. Field "published" is brand new and for timestamp of the publish date. If a page is published or not is in status and it's a bitmask.
  3. No you use $pages->find("template=basic-page, status=unpublished"); Respectively $pages->find("template=basic-page, status=published"); But since $pages->find("template=basic-page"); returns only published pages anyway that are not hidden and above, a status=published makes no sense.
  4. Thank you. I'll have a look when I get to it.
  5. $child->image->url If this only does give you the path to the folder, your image field is multiple and not a single image field. If you change your field to only allow 1 image, then this would give you the full url to the image.
  6. If you only want to allow one page you should also configure to only allow single page. Currently you have a single select but the field is multiple.
  7. Or you can use adjustName=>true option in the save.
  8. PW runs the actions not the PageAction module. It sends each item to the action().
  9. PageActions are run either in one step or if more than hundreds in batches. You could batch millions of pages without running into timeout or memory issues.
  10. Sorry there's no example CSS. Definately something I try to add. Write your CSS with using the css classes the module gives you by default. . Often not much is needed. Also you can change the class names and use various tpl options too to add your own. I mostly use the default and give the "outer_tpl" => "<ul class='main-menu'>||</ul>" as a starting point.
  11. Then in that case you would simply need to tell the module what root your menu has. Default is "/". (third argument) Most common is for example use the $page->rootParent() as the root. ($page->rootParent() will always return the root level page of the current page even if on a root page itself) echo $tree->render($options, null, $page->rootParent());
  12. @surffun it's the "collapsed" => true, option.
  13. This could look like this in a template $arrayData = array( "success" => 1, "products" => Array( Array( "id" => 1, "type" => 6, "name" => "product1", "title" => "Product1", ), Array( "id" => 2, "type" => 5, "name" => "product2", "title" => "Product2", ) ) ); class MyData extends WireData {} $someData = new WireArray(); foreach($arrayData['products'] as $prod){ $p = new MyData(); foreach($prod as $key => $val) $p->$key = $val; $someData->add($p); } $someData->sort("-type"); foreach($someData as $r) echo "$r->title<br/>"; $result = $someData->find("title=Product1"); foreach($result as $r) echo "$r->title<br/>";
  14. I used quicksilver.js on the cheatsheet.processwire.com not sure that's what you're looking for. http://ejohn.org/blog/jquery-livesearch/
  15. You could use the custom attribute options argument for radios, checkboxes etc in the addOption(). $field->addOption($key, $value, array("class" => "customEmoClass")); The rest is CSS and or JS. So you could do it like this. The label can be empty, and the $value would be the attr array. $evaluationVals = array( 'sehr_befriedigend' => array("title" => "sehr befriedigend", "class" => "smily1"), 'befriedigend' => array("title" => " befriedigend", "class" => "smily2"), 'mittelmaessig_befriedigend' => array("title" => "mittelmässig befriedigend", "class" => "smily3"), 'unbefriedigend' => array("title" => "unbefriedigend", "class" => "smily4"), ); foreach ($evaluationVals as $key => $value) { $field->addOption($key, "", $value); }
  16. Note: New version 1.0.6 with a hotfix for CKEditors in inline mode not getting recognized anymore due to core and jquery changes it seems. http://modules.processwire.com/modules/form-save-reminder/
  17. In Sublime Text i can do this by quick search "inputfield.php@___"
  18. Sorry for not replying. I was too busy, not only with updating this module. There's now a new dev version that fixes issues and improves some things. https://github.com/somatonic/Multisite/tree/dev For example the biggest change is that the configuration is now set in the config.php via an array in $config->MultisiteDomains $config->MultisiteDomains = array( "dev.domain.com" => array( // domain name can be used to map to root page "root" => "www.domain.com", // page name for the root page "http404" => 27 ), "dev.domain2.com" => array( "root" => "www.domain2.com", "http404" => 5332 ), ); This allows for different domain configurations on a dev and live stage, and since it's not in DB (via the module config) it can be easily transfered with a dump without worrying to overwrite or change the settings. Also there's no need to change the domain "root" pages name, as it's not directly coupled to the requesting domain. So you only change the array keys (=domain). Since the whole concept is all a pretty hack, I found that it comes with some complications that can't be solved in a elegant way. So for example the biggest issue is that you can't crosslink pages via the RTE Link plugin, since it doesn't know about Muiltisite. So you'll end with wrong URL's when for example link from a page of one site to a page of another site. If that's an issue it's still possible to copy the ProcessPageEditLink.module and modify the root parent for the page tree select. I'd be glad to help out with an example there. Further, the structure of a multisite install needs to be - Web (PW root page, I call it always "Web" since it isn't the homepage anymore) - www.domain.com (primary site home) - 404 Page - www.domain2.com (a second site home) - 404 Page ... I think I heard people were using a different structure in the current old version like: - Homepage (main site home) - About - Projects - 404 Page - www.domain2.com (second site home) - 404 Page - www.domain3.com (a third site home) - 404 Page ... But this wasn't ever recommended and it can lead to complications. ---- Again since this module is pretty much a hack, I'm not officially supporting and releasing this module. Use at your own risk. We use it in various projects now and while it works fine with all it's little drawbacks, the new version is little more solid. I would rather like to see if there's a way for a more integrated and supported way in the core. But not even sure how this could work out. Ryan may has some ideas or maybe thinks this isn't something PW could support. - Note that there's multisite core support, but it's for different DB's and "site" folders, but that's a different case altogether. Take care Soma
  19. Maybe this helps: https://processwire.com/talk/topic/9346-not-all-specified-templates-are-editable-only-includehidden-is-allowed/
  20. Usually it works if you just set the "$entryPage->titel" to the value, but think it only works with the ID. Depends if you use the "ID" or the additional "value" options (id=value|title) If using value: foreach ($options as $option) { $field->addOption($option->value, $option->title); } foreach ($entryPage->titel as $value) { $valArray[] = $value->value; // array of values selected, not key=>title } $field->attr("value", $valArray); Using ID foreach ($options as $option) { $field->addOption($option->id, $option->title); } $field->attr("value", $entryPage->titel); // just passing the field (only when outputformatting off) If that doesn't work just make an array using id. foreach ($entryPage->titel as $value) { $valArray[] = $value->id; }
  21. I discovered this by chance and wondered why it never got answered. So here it goes: PageTable field is just holding a PageArray. You'd then use $a->remove($key) where $key can be the key or a page object. Then save the page. // remove page $item from PageTable $page->pagetablefield->remove($item); $page->save();
  22. I think you could check with a <?php phpinfo() ?> to see php mods something like mod_security.
  23. Make sure your post url ends with a slash.
  24. Sound more like some security module installed on you server.
  25. There are no alternatives afaik. Fingerprint is sometimes too much security and creates more problems than it solves.
×
×
  • Create New...