-
Posts
11,191 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Hi @MikeB, Sorry that you are seeing those errors. I can't figure out why here at the moment. I could add a check to make sure that $value is an object before the code on lines 140 and 145 is processed, but I would like to be able to replicate what you are seeing first. Presumably you are getting this error when saving a page with this template in the admin? Is the phone field in a normal template, or is it part of repeater, or some other combined field situation? Let me know more and I am sure this will be an easy fix. PS - I am on the road at the moment, so forgive me if my responses are delayed.
-
I am not completely sure either, but here are a couple of links that mention the concept: http://research.microsoft.com/en-us/people/xingx/tic1.pdf http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=1407778&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D1407778 http://link.springer.com/chapter/10.1007%2F978-3-540-74784-0_17 Without really having read these, I think an example might be serving up smaller images for mobile devices, or maybe he is talking about AWD vs RWD? Maybe I need to read some more, or maybe Guy will chime in and explain!
-
regarding Multiple templates or parents for users
adrian replied to adrianmak's topic in General Support
-
Thanks for the kudos Peter: http://significatojournal.com/bliss/an-exaltation-of-creativity-and-bliss/the-significato-journal-is-now-a-mobile-first-responsive-website/
-
Here's an article that is mostly about Concete 5, but makes some comparisons with PW - maybe some ideas in there! http://www.spiria.com/en/blog/websites/concrete-5-top-user-friendly-cms Note that Guy also wrote a dedicated PW post: http://www.spiria.com/en/blog/websites/processwire-light-powerful-elegant Not sure if that has been posted here before or not.
-
Assign edit roles to pages according to its template
adrian replied to wheelmaker24's topic in General Support
Sorry, no time for a detailed answer, but this might be helpful: This hooks into the check for whether a page is editable. Currently it is preventing access (returning false) for any page with the "mytemplate" template. You could modify this to check for certain users/roles. $this->addHookAfter('Page::editable', function($event) { if($event->object->template == "mytemplate") { $event->return = false; } }); You might also find some useful code/ideas in these two modules: http://modules.processwire.com/modules/admin-restrict-branch/ http://modules.processwire.com/modules/page-protector/ Hope that helps to get you going! -
It's still there for me. Remember this will only be on the main module config settings page, not the settings tabs for individual pages. Also, note that once you have protected the homepage, this shortcut is no longer available - it doesn't have any purpose in this case.
-
@ottogal - I just tested here to confirm it is still working as expected with PW 3 and everything seems to be fine. Unfortunately I am traveling at the moment with very limited internet access so I don't really have much time to help you at the moment. Is it possible you also have some other modules that are impacting access permissions? I would try testing on a clean PW install to see if you can narrow down the issue. I'll check back in again when I can to see where you're at.
-
It sounds like you are using the PageProtector module. It only prevents users from viewing pages on the front-end. I can't tell if that's what you want or if you expect them to also not be able to view and edit them in the backend? Also, you say that you selected all roles, except the member role. Do the members also have one of the other selected roles? Including "guest"?
-
Hi @paulkoan - welcome to the forums. Can you please let us know the version of PW you are running. Could you also right click and inspect element and show us the classes attached to the button. Any chance you are adding any custom css via "AdminCustomFiles" or some other way?
-
You don't appear to be saving the page anywhere, so do this: $p->save('textJSon'); after you set the $value
-
Hi Peter - have you seen this: https://github.com/plauclair/WireMailMailgun
-
Based on line 112 having the word "include" on it, I am guessing it might be related to this: https://github.com/ryancramerdesign/ProcessWire/issues/1739 although I would have thought that your error message would have been from site/assets/cache/FileCompile/site/modules/ServicePages/ServicePages.module
-
You'd know the line numbers from any error messages that Tracy has reported. You can of course always enter line #1 for some scenarios. Maybe it would be nice if I had a trigger for inserting at the last line as well? But, agreed it is probably a little obscure as a feature - I'll see how much I end up using it and see if others find a use for it.
-
Thanks for your writeup also @matjazp - great to have this stuff documented! I have committed a fix for the blank line number issue you were having. Please let me know if it works now. New Feature I have just added a new feature - it's a bit experimental, and I am not sure just how useful it is so would appreciate feedback. It provides the ability to insert debugging statements (actually any code you want) at designtaed lines in the compiled template at runtime. I see this as useful if you want to quickly debug something on a live site without having to edit the files on the server. In this example I am inserting two barDump (bd) statements into the home.php template file at lines 61 and 63 and noting which one is before the variable is iterated and which one is after. The code for the home.php file looks like this: And this is the result in the dumps panel: Obviously the scenario and the inserted debug statements could be quite different, but hopefully you get the idea. Note: Any lines of code inserted like this are only executed for superusers, so you could even use this as a way to insert lines of code that affect the output on the page without it affecting other users and guests. Also, be sure to remove any statements when you are done debugging, because the template file is re-compiled every time the page is loaded when this field is populated.
-
Awesome writeup - thanks @tpr!
-
@matjazp - thanks for the info on the changes to list() in PHP 7 - I hadn't seen that yet, although from reading about it, I don't think it actually affects that code. No problem at all - I assume the only places where this is affecting you are the links to the template file from the PW Info panel (both in the template info section and the icon at the bottom)? Are there any other locations with links without line numbers that I haven't thought of? Awesome - care to share any tips for setting it up? Did you work with this file: https://github.com/adrianbj/TracyDebugger/blob/master/tracy/tools/open-in-editor/open-editor.js Thanks!
-
Hi everyone, Thanks to prompting from a good friend who is doing his first site with PW, I have added the ability to completely lock/prevent changing of the page name. This is achieved by a new option: "Automatically rename the name field to match the title" - this is checked by default as this is the whole reason this module was created. But now by unchecking this, you can revert to PW's default behavior. Why not just uninstall once the site is live you ask? Good question The reason is that now you can use the "Prevent Manual Changes" options along with this to make it impossible to change the name of the page. The default PW behavior allows all site editors to change the name - but if you want to prevent this, you can now do it easily. You can also add superusers (and other roles) to the list of roles that are exempt from the "Prevent Manual Changes" option. Anyway, hopefully others will find this useful as well.
-
Ok, the latest version now correctly modifies the editor path to the file in the errors panel, as well as dump() and barDump(). Thanks again @szabesz for helping so much to figure this out - sorry we got so sidetracked along the way
-
Great - thanks for confirming that the paths are correct for dump() and barDump() The class not found error will be because of the template being the ProcessWire namespace. If you are doing that, then you'll need prepend a "\" to your calls, eg: \Tracy\Debugger::dump('Test \Tracy\Debugger::dump'); \TD::dump('Test \TD::dump'); and then they'll work fine.
-
Oh, I see - I have been running in StrictMode, so haven't been noticing that - there is another location that I need to add that hack to change the path. I'll get that fix committed shortly. @tpr - is this the case for you also? Do the links from dump() and barDump() calls get converted properly?
-
Thanks! I am wondering what links are actually showing the compiled file? Can you show a screenshot of the link you are trying to click on? Here are some examples showing it working as expected: Link from a dump() Link from a barDump() I am starting to think you are talking about other links, but I am not sure what!
-
Is $loc always 0 ? If so, then that's the problem. I get it 0 sometimes - when the first result of findLocation() is a module file. But when it's a template file, $loc returns 7 At least from this: [0] => .../site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireInfoPanel.inc I can see that the path in $file is matching something that the next line can remove the "/site/assets/cache/FileCompiler" component to make it the path to the original file. Can you please clarify that $loc is always 0? What if you force it to 7 on line 100? Thanks again for your help with this!
-
list() populates the $file variable from the result of findLocation(), or NULL if $loc returns false. I am not sure what's going on, but if your edit links are to the compiled file, then it would suggest that $file is being populated. Could you maybe check the value of $loc and self::findLocation() before that list() call please?
-
Hey guys, I am not sure what is going on. To make this work I have made a small tweak to the Tracy core (hopefully only temporary as I have asked them about a way to publicly modify the filepath) - you can see it here: https://github.com/adrianbj/TracyDebugger/blob/master/tracy/src/Tracy/Dumper.php#L111 Would you mind taking a look at that and debugging why it might not be working - just find out what $file contains before and after that str_replace I can imagine on Windows I probably need to replace all the "/" with DIRECTORY_SEPARATOR but it sounds like @szabesz is on a Mac so what I have should work? Thanks to both of you for helping out with this.