Jump to content

adrian

PW-Moderators
  • Posts

    11,097
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. Yup, you can temporarily add it to a page, or you could bootstrap a special file for running scripts like this, or you could use the "Save and Test" option in Hanna Code, or even my Code Tester module.
  2. I don't think this module can do that. But this small script can foreach($pages->find("template=people, title*=heart") as $p){ $p->of(false); $p->color = 'red'; $p->save("color"); } EDIT: Actually I don't think this module seems to be working. Does it require some table editing module/script to also be installed? I see that it requires MarkupAdminEditableTable - problem is that it doesn't seem to be initiating it? This is all I get:
  3. This is what I use on a site. This was the second site I did with PW, so no guarantees that it is the most efficient way, but you can see how I am handling whitelisting with arrays. <?php if($input->get->filter_save || isset($input->get)) { // Search selector builder $search_string = ''; $current_field = ''; foreach($input->get as $field_name => $field_result){ if (is_array($field_result)){ foreach($field_result as $f_value){ $input->whitelist($field_name, $field_result); if($current_field == $pages->get($f_value)->template){ $search_string .= '|' . (int)$f_value; } else{ $search_string .= ',' . $pages->get($f_value)->template . '=' . (int)$f_value; } $current_field = $pages->get($f_value)->template; } } else{ if($field_name == 'search' && $field_result != ''){ $search_string .= 'title|headline|summary|body|notes%=' . $sanitizer->selectorValue($field_result); $input->whitelist('search', $sanitizer->selectorValue($field_result)); } elseif($fields->$field_name->type == 'FieldtypeDatetime' && $field_result != ''){ $search_string .= ',' . $field_name . '=' . $sanitizer->selectorValue($field_result); } } } $search_string = trim($search_string,','); } else{ $search_string = ''; }
  4. I wonder if the Add Field dialog on the templates page could be enhanced to use the field's tags as optgroup dividers in the select field. I can see that might be useful if you have a lot of fields.
  5. I am really not sure if this is the issue or not (in a hurry), but I have this same approach working, but I had to do this: $pagination = $filter_results->renderPager(array('arrayToCSV' => false)); See Ryan's post about it here: https://processwire.com/talk/topic/3472-enable-pagination-for-search-results/?p=38214 EDIT: I think you are also missing whitelist. Read about it here: https://processwire.com/talk/topic/1883-how-to-use-input-whitelist-with-checkboxes-or-any-array/
  6. I still don't think you are using things correctly - you shouldn't be adding content to any of the categories. You should be adding posts under the BlogPosts parent and assigning categories to these posts.
  7. Sorry - you mean a PW "page", rather than a new actual post - my fault You should see a "Create New" option when assigning categories to a post. EDIT: Scratch most of that - there isn't the ability to have sub-categories - is that what you are after?
  8. But Rezepte is a Category which is linked to a page field for selecting categories to assign to blog posts. You don't want to add pages/posts under there at all - it would mess everything up
  9. I see that Hani has merged Nico's fixes so should be all good: https://github.com/Hani79/Processwire_FieldType_Select_Drop_Down/commit/d2f3a15da5690b535b908dc7fe4644201ebd6eed
  10. Ryan explains why here: https://processwire.com/talk/topic/3543-register-users-and-add-page-same-as-username/?p=35151
  11. I have fixed the issue initially reported by @Raul and noted again by @lisandi. Attached is a working version. Please let me know if you still have any problems with it. FieldtypeTemplates.zip
  12. lisandi, Firstly, welcome to the forums. This module seems to be an unusual case given that the link to the zip is not to a Github master.zip, but rather a forum attachment. I'll mention the issue to Ryan, but in the meantime, you can simply download the module from the first post in this thread. It should be fine compatibility-wise with PW 2.4, although perhaps we need to revisit the issue that @isellsoap mentions just above. EDIT: I can confirm that the bug that prevents removal of all selected templates is still there in PW 2.4.12
  13. Impressive and an a fantastic example of what can be done with Process modules to make a completely customized backend. I predict your name will be lit up in flaming ruby red lights this Saturday
  14. Pete - do you think this is maybe related to: https://github.com/ryancramerdesign/ProcessWire/commit/c1dd1b37e529eff4e5219d1b790275fe71771936 https://github.com/ryancramerdesign/ProcessWire/issues/582 https://github.com/ryancramerdesign/ProcessWire/issues/517
  15. Hi antti, Not really sure if you are planning on maintaining this module anymore, since Fredi, but I just updated an old site that has this running to the latest PW dev version and there is an issue with the adminbar no longer being visible once you click on Edit. So if you decide not to edit the only way out of it is to hit the browser back button, or click save anyway, even though you have no changes.
  16. teppo - just a small layout bug with the tabs overlapping:
  17. Or you could use teppo's awesome Hanna Code Helper: http://modules.processwire.com/modules/hanna-code-helper/
  18. Looks like the problem is that you are overriding $body in the last line of code completely instead of concatenating - change it to a ".=" and it should work. Although I don't actually think you want that there because it would be after the results anyways. If you look at the module Readme: https://github.com/adrianbj/Process404Search Note that I recommend to put text like that in the body field of your 404 page and then use this instead at the top of your search.php file: if(isset($options['q'])){ $input->get->q = $options['q']; $out .= $pages->get(27)->body; } Note that in your case you want to replace $out with $body
  19. Why can't you make any htaccess changes on a local install? All you probably need to do is edit the .htaccess file that is at the root of your PW site and uncomment the first option: RewriteBase /
  20. Don't go renaming the wire folder. As cstevensjr says, the admin URL is not at all related to the name of that folder. The admin page in PW is just a page in the system and the URL is defined by that entry in the database that I pointed you to which is controlled by some .htaccess mod_rewrite rules. That is now a very different error to what you first received. Take a look here for help with this: http://processwire.com/docs/tutorials/troubleshooting-guide/page3
  21. You're right of course I was forgetting the scenario we were talking about here. I guess I just don't like having lots of template specific conditions in the main.php file which is why I use that method along with Ryan's approach. Too many options with PW
  22. Another approach is to put this in your main.php <html> <head> <?php echo $head; ?> </head> And then in each template file you can define $head differently, eg: $head = '<script src="' . $config->urls->templates . 'js/modernizr.foundation.js"></script> <link rel="stylesheet" href="' . $config->urls->templates. 'css/style.css" type="text/css" media="all">'; I do the same thing with a variable called $endOfBody
  23. Did you set your admin panel path to "wire" ? I think that is likely the problem. I think you might need to manually correct this. If you open up PHPMyAdmin or similar and browse the pages table - you will need to change the name field for the row with id: 2 "processwire" is the default, but you could use "admin" or pretty much anything else, but apparently not "wire"
  24. These new migration tools will be in PW 2.5, which is not too far away, although there is no definitive date just yet. Many of us are using the dev version in production so once the template side of Ryan's migration tools are ready, you might be good to go. Of course you'll need your users to be on it too, which does make it more difficult. The migrator module could still be useful for you though if you export with Home as the parent and tell your users to choose Home as the parent when importing. There is less flexibility than Ryan's tools in the fact that there is no control over the settings for the fields and templates when importing, but there is also less for the importer to do.
  25. Just an FYI for everyone here, Ryan has just fixed the continue bug, added optional support for localized dates, and also added in support for getting link and summary.
×
×
  • Create New...