-
Posts
10,912 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
Oh I see - if I understand correctly I think module might help you out: http://modules.processwire.com/modules/page-edit-field-permission/
-
I think you might have found a hidden feature there Actually not hidden - the instructions mention you can do that - the ability to create multiple templates with space separated names But Nico is saying to use the Label field - this is collapsed by default and only available once the template has already been saved.
-
I have done something like this for a form where the user can choose from a bunch of options, but if they choose "other", they can add an option to a text field. When the form is submitted, the value from this field is added to the page field (and selected for their submission) so that it will be available for the next user filling out the form. Sounds like you need another level of control though if you want a front-end user to be able to edit the contents of the page field - is that the scenario you are after?
-
There is the label field of course - you can make this quite long and it is used when selecting a template for a page. Is that enough?
-
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.
-
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:
-
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 = ''; }
-
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.
-
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/
-
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.
-
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?
-
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
-
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
-
user related fields per template - what is secure?
adrian replied to bwakad's topic in General Support
Ryan explains why here: https://processwire.com/talk/topic/3543-register-users-and-add-page-same-as-username/?p=35151 -
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
-
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
-
Gallery: A photo album module (preview)
adrian replied to kongondo's topic in Module/Plugin Development
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 -
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
-
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.
-
-
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
-
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 /
-
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
-
A different way of using templates / delegate approach
adrian replied to Soma's topic in API & Templates
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