Leaderboard
Popular Content
Showing content with the highest reputation on 03/30/2017 in all areas
-
Hi @mvdesign. So sorry that I could not respond earlier. I decided to make an introduction video for this module to help people that are trying to use it. But then, I never made a screencast video before, and on top of that, the last time I spoke english was 2011. So I had to take dozens of try-outs till I got something watchable. So here is the video. It shows how you would create/update pages with this module. The video is far from OK, so I will probably record another one after I get some feedback. Until then please refer to this video to learn about how the module works.11 points
-
Hi-- to follow up, I was able to finally track down the web designer (using my internet super-sleuthing skills) and request that he add a staff member as a superuser-- a member of our IT department. He did so without a fuss. I appreciate everyone's input and willingness to help-- even Pwired....5 points
-
Thanks @adrian! I rerecorded the video many times before I could make it watchable. Trust me, you wouldn't say the same thing for the very first ones About the field access rules. Yeah that's true. By default the behavior is the opposite to the one in ProcessWire. I think it would be better for security if the module initially treats everything private. But I get what you mean. In cases where you have dozens of fields in one template, it would be too tedious to configure access for each of them. That's why there is an option to reverse the behavior in the advanced section of the module configuration. You can learn more about it here. This option basically makes all fields without Access rules available to the public and you can restrict access by enabling rules only to couple ones.4 points
-
It should work if you do this: $buildings = $pages->find("template=building-entry"); $allTowns = $buildings->explode('addressBuildingTown'); $uniqueSortedTowns = sort(array_unique($allTowns)); IIRC this notice is new to PHP 7. Google it and you will get some explanations as to what's going on. EDIT: Oops - not sure when you made your edit to show what works, but somehow I didn't see it2 points
-
Thanks for the explanation and for the "Grant Field Access" config option. I definitely see your logic behind treating access the other way around. I guess I was just considering the situation where you have a regular web site where you want to be able to use the PW API as well as GraphQL. In this situation I would have no problem with all fields being accessible, so great that option is available!2 points
-
awesome screencast, nurguly. easy to follow, well explained and well spoken. it helped me a lot to get a better understanding what your module does and what could be done! i'm curious what will be built on top of this2 points
-
+1 Also, normally a public query interface should not serve all data by default, as that would allow for pretty easy data harvesting.2 points
-
Fantastic video @Nurguly Ashyrov - really well put together and great English - I don't know how you come across so clearly given that you haven't spoken it in 6 years! I am really excited to start using this module. The one thing I noticed which seemed a little weird to me was that by default the skyscraper-editor (or guest) user didn't have access to fields until you enabled field level access control and explicitly gave them view access (~35:10 min mark in video). By default in ProcessWire, anyone can view a field if field level access control is turned off. Only once it is turned on are any restrictions applied. Does that make sense, or did I misinterpret something? Thanks again - this is going to be so very useful!2 points
-
Variables declared in _init.php are available in all templates, but php scoping rules still apply when trying to access a variable inside a function. Remember, even if you tried to access $body (defined in _init.php) in a function elsewhere in _init.php, you still wouldn't be able to.2 points
-
The $field argument supplied to $page->save() must be a field name or field object. But in your example $files is neither of these (it will be a Pagefiles object).2 points
-
I think it's just about PHP variable scope. When you use PHP's built in "include" it is including the contents of the file directly, but when you call a custom function to do the include (eg wireIncludeFile(), or your own custom function), then the $body variable doesn't make it through, which is why wireIncludeFile() and wireRenderFile() have the ability to pass variables in an array.2 points
-
http://caniuse.com/#feat=css-grid The CSS standard Grid Layout will soon be usable in the stable versions of the leading browsers. It should hit Chrome and Firefox in March. It is in Safari tech preview, but no clear date. MS Edge is working on updating support. I guess support in mobile browsers will follow. 2017 is the year to use it on sites, where it is OK to experiment with bleeding edge stuff. A complete guide to the system on CSS Tricks Learn by examples (includes video tutorials) Rachel Andrews summarizing use cases for Grid, Flexbox and Box Alignment in a single article on Smashing Mag (note: heavy with Codepens) News on all things CSS Layout curated by Rachel Polyfill support is unfortunately dragging behind with no contributors stepping up to help Fremy1 point
-
That's an entry from the "caches" DB table so you can either empty that table, or ignore if the error didn't prevent the other tables from importing.1 point
-
Hi guys so currently am writing a detailed tutorial about creating Modules, I have never created a module because i don't know all the classes and interfaces required, so this is like a detailed research for me, this is how i learn things by writing articles. However I might make some mistakes so i decided to make it on Google Docs to get comments and feedback, before posting on my website and Processwire tutorial site, this is going to be one heck of a detailed tutorial. Here is the link I will be updating it https://docs.google.com/document/d/1VA_WK-5qbnq3Ux_EOW3p92IcjbAcVZJ0aewIiFxmv2Q/edit# However I wanted to get a clear picture of the following Process Class and ConfigurableModule i noticed some modules require it and some don't My interpretation is that Modules with admin setting pages uses ConfigurableModule and Process are modules who require access to $this->pages and that sort Thanks all1 point
-
1 point
-
So I figured it out and here is my complete code if it would help anyone else. //get the pages you want $items = $pages->findMany("template=item"); wire()->addHookAfter('Pages2JSON::getValue', function($event) { //get the host $host = wire('config')->httpHost; $value = $event->arguments(0); if(!is_object($value)) return; //check if field is an image, images or file type if($value->className == 'Pageimage' || $value->className == 'Pagefile') { //append the host to those values $urls = array("url" => $host . $value->url, "description" => $value->description); $event->return = $urls; } }); header('Access-Control-Allow-Origin: *'); header('Content-Type: application/json'); echo $items->toJSON(); exit(); Thanks again for the great plugin.1 point
-
sounds like a namespace issue - are all of the files related to this all namespaced?1 point
-
Oh no problem at all @ottogal. Just tried moving the appended region code above my top.php and it worked as @Robin S predicted. Not sure why I didn't just try that before In any case, thanks for the help. I see myself using markup regions with all my sites going forward. So much cleaner that other methods.1 point
-
Thank you both! It looks like it was $p->of(false); . I have next to no idea how the Output Formatting works. To the docs!! All my best!!!1 point
-
Does this work? $p = $this->storagePage; $p->of(false); $p->pdfStorage_files->add($path); $p->save('pdfStorage_files'); return $p->pdfStorage_files; Not sure if your problem is the missing $p->of(false) or trying to save the $files pagefile object instead of the "pdfStorage_files" field name. PS - what @Robin S said1 point
-
1 point
-
Well, it's been a long time coming, and not sure if it's exactly what you had in mind, but I just added a new "Git Info" panel that displays Git branch, latest commit message, etc for your site (assuming you have it under Git version control). This is just the first version. My goal is to add color coding of the icon (like many other panels) to get your attention. I am looking for feedback on this though. I could either make it possible to configure different colors for different branches, or else I could try to match the branch name against the subdomain / extension, eg. dev.mysite.com, staging.mysite.com or mysite.dev, mysite.staging, etc and color green if they match and red as a warning if they don't. Anyone have any thoughts on the best approach? On another note, I just had to do quite a bit of work fixing the "Versions List" feature on the ProcessWire Info panel - two recent Tracy core updates broke this functionality and I just noticed. Also, it looks like Github changed the way they handle line breaks inside <details> tags, so also had to tweak that, but I think everything is working again now!1 point
-
1 point
-
What @LostKobrakai said, but if you really want to do it, you can make use of these in the module info: 'permission' => 'page-view', 'permissionMethod' => 'permissionCheck', permisssionCheck() may look something like this: public static function permissionCheck(array $data) { $user = $data['user']; $wire = $data['wire']; // if in admin/backend, then require "my-custom-permission" permission if(strpos($wire->input->url, $wire->config->urls->admin) === 0 && !$user->hasPermission('my-custom-permission')) { return false; } // else in frontend, so allow full access to call actions via the API else { return true; } }1 point
-
Now all major browsers except Edge ship with Grid Layout support. You can let Microsoft know you want it by voting in Uservoice. The votes do matter:1 point
-
Awesome, thanks! Must admit I get a bit downhearted sometimes about my progress. What I do is read over my old posts, then I realise that I've actually learned hell of a lot over the last 6 months and am already making things more complex than I did previously (and actually writing php and javascript). Although my age doesn't help, that over the hill feeling creeps up on me quite a lot when I see people half my age programming all sorts of things I can't even understand a few lines of. Not stopping though, enjoy it too much.1 point
-
Thanks for coming back on this Francis. Code like this is really necessary. Backing up websites and databases takes time. Yes I know this can be done with services provided from your hoster and this works all fine. But I dont want to put my bets on just the hoster. I dont know about you guys but considering the countless hours of work I want second backups on my portable hdd. At night I want my computer to make those second backups with code or scripts.1 point
-
Let's focus on solving the problem without making too many assumptions.1 point
-
I have submited the Spanish es-ES for ProcessWire 3.0.x 100% Translated, if not, let me know. Pull requests, contributors,... are all welcome. http://modules.processwire.com/modules/pw_spanish/ Enjoy. .a1 point
-
i usually use a custom module and put all of my custom admin stuff there, e.g.: public function ready(){ if($this->page->process == "ProcessPageEdit"){ $this->addHookAfter('ProcessPageEdit::buildFormContent', $this, 'mySpecialThing'); } } public function mySpecialThing(HookEvent $event) { $form = $event->return; $field = $this->modules->get("InputfieldMarkup"); $field->markupText = "<h3>My Special Thing</h3>"; $form->prepend($field); } // end function1 point
-
$page->created …will give you the unix timestamp, or you can use PHP to format it however you want: <?php echo date("F j, Y, g:i a", $page->created); // October 10, 1974, 11:28 pm http://www.php.net/manual/en/function.date.php1 point