-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
I haven't been following this closely for a while, but perhaps an SQL query would be helpful? SELECT COUNT(id) FROM `pages` WHERE (pages.templates_id=29) AND (pages.title='My Page') AND (pages.status<1024) GROUP BY pages.id You might find this snippet helpful. It will generate an SQL query from a find selector. I just modified the returned result to be a COUNT instead.
-
Hi @ukyo - thanks for sharing this, but I must admit I am little confused. I am honestly not really sure what you are trying to achieve - no offense intended - I am probably just missing something here Can you please explain how: <?php $str = "You can visit our <a hre='{pages(1):url}'>{pages:get(1):title}</a>"; echo processString($str); ?> is any better than using the API variables in a string like this: <?php $str = "You can visit our <a hre='{$pages(1)->url}'>{$pages->get(1)->title}</a>"; echo $str; ?> BTW, pages(1) and pages->get(1) are the same thing. The other thing you might want to take a look at is the tag compiler: https://processwire.com/blog/posts/processwire-3.0-alpha-2-and-2.6.22-rc1/#new-module-file-compiler-tags which is not really what you are doing, but it's sort of related.
-
Just a quick FYI - you can get Tracy's debug bar when logged out two different ways. If you are on a local dev machine, check the "Force Guest Users into Development Mode on Localhost" option. The other way if you are on a live server is to use the User Switcher to logout. Hope that helps you get data you may want while logged out.
-
Good to hear it's working again. I hope that splitting up of that info across the PW Info panel and this new Request Info panel is proving ok for you. As I mentioned above, I wanted to make the relevant info also appear in the AJAX bar, but didn't want doubling up of links to the PW admin and other things that don't change, hence the need for this change.
-
Thanks @mel47 - can you please test the latest version and let me know how it goes for you?
-
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?