-
Posts
11,214 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Thanks @mel47 - that explains it - it's because you are running your site in a subdirectory: /24h/ Could you please confirm that: d($urls->root); in the Tracy Console panel returns: /24h/ Once I know that I'll be able to fix this.
-
Also, check out the Performance Panel in Tracy to show the time between named breakpoints. https://processwire.com/blog/posts/introducing-tracy-debugger/#performance-panel
-
Multiple posts on this - lots of options amongst these. https://processwire.com/talk/topic/11337-resolved-hiding-parent-url-error/ https://processwire.com/talk/topic/3275-hide-parent-page-from-url/ https://processwire.com/talk/topic/9692-hidemask-a-parent-page-from-front-end/ https://processwire.com/talk/topic/5448-remove-parents-from-url/ http://processwire.com/talk/topic/1799-routes-and-rewriting-urls/
-
I am worried that there won't be any 404 responses to any requests to your site though. It still feels like it's the wrong solution to whatever the problem is, but maybe I am not understanding the use case.
-
Settings Train (module preview)... all aboard!
adrian replied to Macrura's topic in Module/Plugin Development
Wow - I totally agree - they are beautiful. Lots of the FA ones really are pretty poor. -
Maybe it would help to know a little more about your scenario. Perhaps you could try Page::viewable - it checks to see if a template file exists?
-
You can hook: ProcessPageView::pageNotFound
-
Settings Train (module preview)... all aboard!
adrian replied to Macrura's topic in Module/Plugin Development
Agreed! While I love the idea of this module and especially the easy setup of option type fields (checkbox, ASM, etc) without needing to point to somewhere for the source of the options, I would like to be able to define the options via PHP when I want. Maybe the approach I have taken in AdminActions might work ok here as well, eg: $fieldOptions = array(); foreach($this->wire('fields') as $field) { if ($field->flags & Field::flagSystem || $field->flags & Field::flagPermanent) continue; if(count($field->getFieldgroups()) === 0) $fieldOptions[$field->id] = $field->label ? $field->label . ' (' . $field->name . ')' : $field->name; } return array( array( 'name' => 'fields', 'label' => 'Fields', 'description' => 'Select the fields you want to delete', 'notes' => 'Note that all fields listed are not used by any templates and should therefore be safe to delete', 'type' => 'checkboxes', 'options' => $fieldOptions, 'required' => true ) ); -
Hi @Robin S - thanks for those reports/ideas. I have added a new $title variable to actions. This is optional, but recommended. I have fixed the annoying "Actions" title on hover. But, regarding having new actions automatically enabled for superusers, I am not so sure. I purposely don't enable any actions for anyone by default. There are a lot there and there will potentially be many more in the future. My thought is that the list could become overwhelming and many/most devs might actually prefer to just enable those that they will use on a semi-regular basis. That said, I am willing to hear more arguments from others in support of this Cheers!
-
Nice. How about some radios for more focused searches? API reference - site:processwire.com/api/ Forums - site:processwire.com/talk/ Blog - site:processwire.com/blog/ Yeah, I was thinking about doing that - just implemented:
-
A couple more options for searching the PW website more easily: 1) New search feature in the ProcessWire Info panel in TracyDebugger https://processwire.com/talk/topic/12208-tracy-debugger/?do=findComment&comment=153342 2) Custom search for Alfred (customizable Spotlight type app for Mac) Simply type "pw" and then your search term: These are the settings to configure Alfred to do this search: https://www.google.com/search?q=site%3Aprocesswire.com%2F {query} You might also want to consider adding the following: pwapi : https://www.google.com/search?q=site%3Aprocesswire.com%2Fapi%2Fref%2F {query} pwblog : https://www.google.com/search?q=site%3Aprocesswire.com%2Fblog%2F {query} pwtalk : https://www.google.com/search?q=site%3Aprocesswire.com%2Ftalk%2F {query}
-
New Search ProcessWire website feature in the ProcessWire Info Panel. For updates to old Tracy installs, you will need to manually enable this feature in the module settings. It is on by default in new installs. Any term you type in the box will take you to a Google site search for the PW website, eg a search for Tracy will take you to the results for a site:processwire.com/ tracy Hopefully you guys find this useful!
-
What about this in your ready.php file: $this->addHookBefore("InputfieldCheckboxes::render", function($event) { if($event->object->id != 'Inputfield_roles') return; $optionsWithTitles = array(); foreach($event->object->options as $id => $name) { $roleTitle = $this->wire('roles')->get($id)->title; $optionsWithTitles[$id] = $roleTitle != '' ? $roleTitle . ' ('.$name.')' : $name; } $event->object->options = $optionsWithTitles; }); In this screenshot I have only added a title to the "Editor" role:
-
Hi @mel47 - yeah, that's confusing to me too. I know what's stopping them from being displayed, but still not sure exactly why - I am thinking it might be a Windows path issue at this stage. Can you please post a screenshot of the Server Request section expanded. If it's easier, just the bottom half of it will be fine, from SERVER_NAME onwards. I am sure it will be a simple fix, but I need to know what some of those values are returning for you. Thanks!
-
Thanks for noticing that - it should be fixed in the latest version. Because there are settings for this module on every page (Settings tab), saving the page was saving the settings. Now I check to see if there are any changes before saving. Please let me know if it works as expected for you.
-
This is very strange and timely @Guy Verville - I just upgraded to High Sierra and my homebrew AMP stack broke. After getting everything working again, I was also getting a 404 for the admin page. Turns out I didn't have the mod_rewrite apache module loaded. Not sure if that's what is going on for you, but definitely something to check.
-
Examples of large sites, particularly government, desperately needed
adrian replied to Margie's topic in Getting Started
Best of luck with the project Margie! If you happen to need any help from a marine scientist come web developer who speaks Strayan, just let me know ? -
Hey @kongondo - I am actually just playing around with VSCode right now and autocompletion for PW seems weird. Some of the wire functions outside of class scope show up, eg: but that's not all of them, and nothing in any of the PW classes shows up at all. VSCode seemed to index my entire project folder, so I think it should have everything. Any tips you have discovered for this? PS @abdus - I took a quick looks at PHPStorm, but it seemed really sluggish (even after indexing had finished) - did you do any tweaks to get it snappy enough to work with?
-
Just an FYI - in the Console panel you can now do mixed HTML/PHP without needing to add a php closing tag first. <p>Welcome to the <?=$page->name?> page!</p> File-based snippets (Snippet Runner) can be plain html, plain php, or mixed html/php, but they must have an opening php tag as per normal PHP requirements. The Console panel does not require an opening PHP tag (although having one will still work). You can use mixed html/php as per the example above, but for a pure HTML file you will need an initial ?> before the HTML to make it work, eg: ?> <p>Welcome to this page</p> Plain html in the Console seems like a pretty uncommon use case, so hopefully this gives us the most flexibility without too much weirdness.
-
Sorry about that - I am not seeing that, but I see where it's coming from. Please try 4.6.5 and let me know. PS Don't forget to enable the new Request Info panel which now contains most of the info from the old version of the PW Info panel
-
I've just made a few more tweaks so that now you can have mixed html and php in your snippet file. For example this: <p>Welcome to the <?=$page->name?> page!</p> will return: This might come in handy for testing snippets of template code if you use a direct output approach, or markup regions, or anything else where you are embedding php into HTML tags. The only downside is that now pure PHP snippet files must start with a php open tag. I think this is a quite acceptable compromise as I couldn't imagine writing code in my editor without it. You can also do this with the Console Panel, but you have to start the snippet with ?> to close the automatically added PHP tag, eg: ?> <p>Welcome to the <?=$page->name?> page!</p> This is because the Console Panel always adds an opening PHP tag if it doesn't find one - I think this is best here because it's nice to not have to manually add when doing a quick code test. Anyone have any thoughts on these new abilities - does anything seem illogical?
-
@Robin S - please try the latest version which supports declared namespaces in both Snippet Runner and Console panels.
-
Yeah, it is certainly up there Glad it's working well for you. The focusing of the Run button was initially to help with helping target the eventListener for the keyboard shortcut, but I found what I think it a better way without having conflicts if both the Console and Snippet Runner panels are open at once. Even after figuring this out, I decided to keep the focus of the Run button as a visual reminder that loading != running. Let me look into this - should be a pretty simple fix.