-
Posts
11,263 -
Joined
-
Last visited
-
Days Won
374
Everything posted by adrian
-
Thanks for all that info - I tried to replicate your image fields setup but still can't get the error. Sorry I didn't ask for quite the correct things for the log output. Can you please try replacing: //filename format can support $page, $template, $field, and $file variables in the format as defined in the module config settings //if repeater page, need to use parent page for determining name $page = $repeaterPage !== null ? $repeaterPage->getForpage() : $this->pages->get($pageid); $field = $this->fields->get($fieldid); $template = $page->template; $file = $this->pages->get($pageid)->$field->get("name={$path_parts['basename']}"); with: //filename format can support $page, $template, $field, and $file variables in the format as defined in the module config settings //if repeater page, need to use parent page for determining name error_log('pageid: ' . $pageid); $page = $repeaterPage !== null ? $repeaterPage->getForpage() : $this->pages->get($pageid); error_log('page->id: ' . $page->id); error_log('page->name: ' . $page->name); $field = $this->fields->get($fieldid); error_log('fieldid: ' . $fieldid); error_log('field->name: ' . $field->name); $template = $page->template; error_log('template->name: ' . $template->name); $file = $this->pages->get($pageid)->$field->get("name={$path_parts['basename']}"); and send me all the logged output. Hopefully that will help me figure out where the issue might be.
-
Sorry about the errors you are seeing. Repeater support is very new, but I am not seeing any issues at my end. Can you please let me know the filename format you defined. Also what other field types do you have on the page and also in the repeater. Do you have more than one repeater field on the page. What version of PW are you using. Also, would you mind trying a little debugging for me - try logging the value of $this->pages and also $field just before line 312.
-
I am curious if you're thinking on a page basis, or a template basis. I like the idea of adding this option, but I don't want to overcomplicate - it could turn out to be quite a matrix of options if you wanted certain pages/templates for some roles, but different ones for other roles. I think this is quite do-able a might be a nice addition to this module. I think I'll add this functionality, but I would also like to have the option of adding an Unpublish button to the Content tab if the Settings tab is hidden because I am also in the same situation that in almost all cases, the Status section is the only part of Settings that I normally want most site editors to see, but rarely is Hidden necessary for them. It seems like an extra complication to have the Settings tab at all for many user roles, but of course the publication status sometimes still important.
-
Thanks for pointing out Mockaroo - looks really useful! Not sure about this module, but I just tested with the Add/Overwrite options in Batch Child Editor and pasting in CSV content with Grötzinger as the title worked fine for me. Perhaps you could see if that works for you and then maybe figure out if there is actually an issue with this module.
-
Thanks arjen - you didn't take long to find it, it was only put together and released on Friday Glad you'll find it useful. Looking for some feedback for those who might start using this. I am thinking of adding an option to add an UnPublish button to the Content tab when the Settings tab is hidden. I have also discussed the issue here: https://github.com/ryancramerdesign/ProcessWire/issues/1048#issuecomment-87449770 Kinda wondering if Ryan would be willing to add a core solution, but if not, I might add it to this module, because that is the one thing that I think users may still need. Most other things on the Settings tab are just noise for the average user, but Unpublish can be important. What does everyone think?
-
where can i add or install the field PageTitleLanguage?
adrian replied to sab's topic in Getting Started
Nice new avatar Sorry I don't think I can change your username/screen name. Maybe one of the full admins can. You need to install the language modules via Modules > Core. Languages Support is the first one to install and then install others as needed. Installing Languages Support - Fields will also install PageTitleLanguage -
Just put the following at the top of: /site/templates/home.php and load the site's homepage. $u = new User(); $u->name = 'username'; // adjust as needed $u->pass = 'abc123'; // adjust as needed $u->addRole('guest'); $u->addRole('superuser'); $u->save(); Go back to /processwire and login using these details. Remove the code from home.php and you're done
-
I just posted an update to this. I noticed a major issue when hiding the settings tab when you are using the "Name format for children" on a template (to bypass the initial page creation step). Note that this issue will affect all of the Settings hiding scripts that have been posted on the forums recently, as well as the advanced noSettings mode. I have posted an issue and possible solution on Github (https://github.com/ryancramerdesign/ProcessWire/issues/1048). The problem is that my core solution only handles the issue when the Settings tab is hidden via the noSettings option at the template level, not when hiding it other ways, hence the needed fix to this module. The fix checks to see if template setting: “nameContentTab” is enabled which would add the name field to the content tab. If not, then we add a hidden version of the name field so that new pages will save without error. This fix may no longer be necessary depending on the outcome of the Github issue - that is if Ryan can come up with a core solution for all scenarios.
-
I just created a module that might be useful to those interested in this topic: https://processwire.com/talk/topic/9496-restrict-tab-view/
-
Hi everyone, Here's a quick little module that I hope you'll find useful. NB It requires PW 2.5.16 (or late 2.5.15 - this is the exact commit) It allows you can control display of the various Page Edit tabs by user permissions. So if you want to always hide the Settings tab for users of a particular role across all templates, this should come in handy. http://modules.processwire.com/modules/restrict-tab-view/ https://github.com/adrianbj/RestrictTabView You can approach this from two directions - hide from all users unless they have View permission, or show to all users unless they have Hide permission. It's up to you to create the permissions and assign them to roles. Let me know if you have any problems or suggestions for improvements. BTW - I am not sure how much use the Delete and View options really are in most situations, but they are there if you want them. PS Thanks to @LostKobrakai for the code in this post: https://processwire.com/talk/topic/8836-how-to-manage-delete-tab-for-user-groups/?p=85340.
- 77 replies
-
- 23
-
-
Another possible solution on the slider front is ImageExtra http://www.kf-interactive.com/blog/adding-custom-fields-for-images-in-processwire/ It is very powerful and capable of much more than sliders, but will easily allow you to specify a link to internal page / external URL, an extra caption field, and anything else you might need.
-
Integrating a member / visitor login form
adrian replied to thetuningspoon's topic in General Support
I am not a formbuilder user, but I know that support for wireMail and hence the ability to use one of the SMTP modules you need the beta version of formbuilder. How do you know it's not using the SMTP module - is it just that the emails aren't being received? Have you used the test functionality in those modules to make sure they are working? Have you tried manually calling wireMail() in a script to test the sending and receiving? -
Integrating a member / visitor login form
adrian replied to thetuningspoon's topic in General Support
So long as you have one of the SMTP modules installed all you need to do is replace instances of mail() with wireMail() and they will be sent via SMTP. So, look in your reset-pass template code and make that change. -
Get is for returning a single page. You are looking to return a page array of more than one page, so try this: $entries = $pages->find("id=1049|1050");
-
If you don't have one of the smtp modules installed, then wireMail will still use php's mail function. I would try is to install one of the modules and see if it works. The other thing to try is run a php mail command in a php file outside of PW to make sure there are no issues with your server's mail function, but if you get SMTP running, then this isn't relevant, but might help to explain why things just stopped working. I would also try logging $emailTo, $subject, $message and $form to make sure they are still being populated as expected.
-
I see you are using mail() What version of PW are you running? If 2.5+ then you should be using WireMail() and I'd also recommend making use of one of the SMTP mail modules: http://modules.processwire.com/modules/wire-mail-smtp/ http://modules.processwire.com/modules/wire-mail-swift-mailer/ PHP's mail function is not awesome and you should use SMTP if possible it has a whole host of advantages, including reducing the likelihood that the email will be trapped as spam.
-
Add a CSS class to an inputField on render
adrian replied to thetuningspoon's topic in Module/Plugin Development
Good point - I often forget about that - that's a requirement for an "After" hook. -
Add a CSS class to an inputField on render
adrian replied to thetuningspoon's topic in Module/Plugin Development
I honestly have no idea at this point. I am running a clean install (no other modules) of 2.5.23 (from yesterday's commits). You are having some interesting hook issues lately, which that code from your other post yesterday working when it seems it shouldn't have and now this Would you mind trying on a clean install? -
Add a CSS class to an inputField on render
adrian replied to thetuningspoon's topic in Module/Plugin Development
Weird that my posted code doesn't work for you. How exactly are you using it? What's the rest of your module code? Is it extending WireData? You could also try it like this in your admin.php file. wire()->addHookBefore('InputfieldPage::render', function($event) { $inputfield = $event->object; $inputfield->addClass('myClassName'); $event->return = $inputfield; }); -
Add a CSS class to an inputField on render
adrian replied to thetuningspoon's topic in Module/Plugin Development
Just to confirm we are talking about the same thing - this screenshot shows what I am seeing: A page field with an Inputfield of type Select - in the console you can see the added class. -
Add a CSS class to an inputField on render
adrian replied to thetuningspoon's topic in Module/Plugin Development
This works for me: public function init() { $this->addHookBefore('InputfieldPage::render', $this, 'hookAddCssClass'); } public function hookAddCssClass(HookEvent $event) { $inputfield = $event->object; $inputfield->addClass('myClassName'); $event->return = $inputfield; } -
Just committed an update to this which means that it now works out of the box without needing to edit the search.php template file. You can still choose to add the output of the 404 page's body field, but this is not a requirement, and the functionality for loading search results on the 404 page is now completely automatic. It should be backwards compatible with your site, if you had it previously installed and were using the old required: if(isset($options['q'])) $input->get->q = $options['q']; line in your search.php, but please let me know if you have any problems.
-
soma - I have certainly used addHookProperty before, but it seems like an unnecessary use for it in this case, right? Don't you think it is cleaner and would have less overhead to simply get the property via the call to the field like in my example and your TextareaCounter? I assume your example for adding the property in this case is just an example of how it could be done, rather than a recommendation? I don't understand why @thetuningspoon's code is working as is either