Leaderboard
Popular Content
Showing content with the highest reputation on 04/15/2017 in all areas
-
Hi Teppo, As a superuser I find the Tree menu great, but I have some roles for whom edit access is quite limited - most pages in the site are not editable by them. For those roles I think the Tree menu is less useful and it can be confusing. If you click a page in the Tree menu that you do not have edit access for you are taken to view that page in the frontend. I think that is unexpected and not helpful to the user. At the time I made the module there was no way to visually distinguish between editable pages and non-editable pages, although I think Ryan plans to fix that soon (might be done in v3.0.60). Also, although the pages shown in the Tree menu are the same as those shown in the page list, my perception is that it makes some of the pages that site editors don't need to concern themselves with (e.g. the FormBuilder iframe page, the 404 page) more prominent than they are in the page list. I could see myself having to deal with support requests from clients confused about what they see when they click these pages. I didn't think the Tree menu was worth it for those roles so wanted to selectively remove it.5 points
-
While you say that it's legitimate traffic, what kind of traffic is it? What I'm wondering is what exactly happens during that spike: are there more requests to a specific feature than usual, etc.? While a code review could definitely result in some ideas about what to optimise, usually the best and first thing you should do is properly analyse the data you have, i.e. your log files. Find out any abnormalities in the requests, see which requests were particularly slow (you should get this data from the web server logs), and see if the MySQL slow query log (if you have it enabled) contains any additional clues. As an example, one site I help maintain recently got a lot of heavy traffic all of a sudden. Turns out it was a result of a campaign where each request included a similar GET param, and that in turn made the site skip cache. Note that I'm not saying that this has anything to do with your specific case; it's just something I couldn't tell from the amount of traffic alone, but it was really obvious once I took a closer look at Apache logs On a related note, it could also be that this has nothing to do with the code itself. It could simply be that your server -- or server configuration -- is the bottleneck. That too could be a result of an increase in a specific type of request, so again taking a closer look at the logs is where I'd start from. Edit: It seems that you're running an nginx reverse proxy in front of your site, but for every request I get a response header X-Proxy-Cache: MISS. Doesn't seem that this proxy is doing it's job too well if none of the requests are served from the cache. I'm not an expert on this particular topic, but in my opinion there's something fishy about your setup5 points
-
At a quick glance, one thing you should look at is applying a limit to the selector in your search template. Search results like this could quickly become a problem, particularly if there was some kind of bot hitting the site: http://drydenwire.com/search/?query=a5 points
-
https://processwire.com/blog/posts/processwire-3.0-alpha-2-and-2.6.22-rc1/#compiled-template-files "It can be disabled globally by setting $config->templateCompile = false; in your /site/config.php file. If you do disable it, you'll likely want to add a namespace ProcessWire; to the top of your PHP template files where necessary." In practice, the simplest solution is to always add <?php namespace ProcessWire; if none other is required.4 points
-
Here's how you might dynamically create it with ProcessWire without tinkering with .htaccess files. Create a new template, call it robots, and set its URLs > Should page URLs end with a slash setting to no, and Files > Content-Type to text/plain. You should tick disable Append file and Prepend file options as well. Optionally set its Family > May this page have children to no, and Family > Can this template be used for new pages to one. Family > Optionally Set allowed templates for parents to home only. Create a new page under homepage, set its template to robots, and name as robots.txt. Create a new template file at /site/templates/robots.php, inside it you type <?php namespace Processwire; // render different robots.txt depending on your own conditions. if ($config->debug) { // use PHP_EOL to create multiline strings echo <<<PHP_EOL User-agent: * Disallow: / PHP_EOL; } else { echo <<<PHP_EOL User-agent: * Disallow: PHP_EOL; } and done. You should be able to see robots.txt at the url /robots.txt.4 points
-
Welcome Brian, There is a pro module you might be interested in that is designed for tracking performance and identifying bottlenecks: Profiler Pro There's more info about it in the blog post that introduced it: https://processwire.com/blog/posts/a-look-at-the-new-profilerpro-module/ And with purchase comes support from the man himself. Ryan says: Might be a fast way to resolve the problem.4 points
-
It looks like you need to set some headers to enable byte range requests and check incoming requests for byte ranges that client is currently at. Check out this SO answer: http://stackoverflow.com/a/1574473 points
-
Sounds like you have a good handle on how the process will work, so no reason to worry I think. I've just done something very similar so I can attest that it's quite simple to do in PW. Regarding 1 & 2: most likely you will be querying an API endpoint that will return a JSON string to you. You'll probably find the WireHTTP class useful here - that's what I used. The getJSON() method will convert the JSON response into an associative array that contains all the data you requested. Tracy Debugger will be useful for exploring this array. Then you will use some part of the data as a unique identifier (you could use the title string but there's probably some kind of reference code that will be a better candidate) and based on whether you can find an existing page with that identifier you will either create a new page or update an existing page. Then it's simply a matter of matching items in the array to fields on your page and saving the page at the end. You can use a lazy cron function to automatically query the API endpoint every 24 hours. To delete pages that are no longer contained in the JSON response you can collect all of the unique identifiers in the response and then use a PW selector to get pages not matching any of those identifiers. Those pages you delete.3 points
-
This function is no longer global but in the ProcessWire namespace in PW 3.x Maybe it's a namespace issue?2 points
-
Hi tom0360, Welcome to the forums! ProcessWire does not care what you use for your front-end. I have been using Bootstrap for a while. It's setup is just as they explain in their docs. If you are using 3.3.7 then extract the js, fonts, and css folders to your /site/templates folder. The same with 4.0.0 alpha, except they don't use the fonts folder any longer. Again, welcome. Feel free to ask any questions. There are a lot of good people here that will help.2 points
-
Greetings. I am here to share my first module. I make this module because I cannot find one to suit my need. I like SessionHandlerDB but I do not want to use mysql database to store session for performance. So, Redis seems to be the best choice. I have tried to use netcarver's SessionHandlerRedis but it lacks something I need, those are the active session checking and the easy module configuration while I do borrow some code from it (thanks to netcarver). So I take this chance to merge them together to form a new module. I am new to use github and I don't know if it is appropriate to publish another similar project, or fork from them. You may grab this from Github: SessionHandlerDBRedis I hope this could give somebody a help. Updated to v0.4 changelog: v0.3 - added ability to get forwarded IP instead of normal remote IP. v0.4 - added session lock1 point
-
This week we have ProcessWire 3.0.60, which is likely to be our next master version. We’ve also got a few more Pro module updates, as well as a major update to our online API reference… https://processwire.com/blog/posts/processwire-3.0.60-core-updates-and-more/1 point
-
@adrian, Updated and workin' great! Thanks for your efforts! ps. We need a Buy-A-Beer button in this forum!1 point
-
1 point
-
1 point
-
HI @nabo // $page - is page with store template $dayRepeaters = $page->repeater_field->find("days=friday"); foreach($dayRepeaters as $rp) { echo $rp->hours; } Does it suit your need?1 point
-
@ryanC this is a very helpful resource for image handling: https://processwire.com/api/fieldtypes/images/ CKeditor is a different story, it will strip out tags unless you tell it otherwise. I found trying to manipulate CKEditor to be a pain in the butt and I try to not use any inline stuff in there at all (no added classes/ids or anything), I've always found you can target HTML tags using CSS wherever they might be. I simply use it for bigger blocks of text that need header/paragraph combos and maybe an image inserted. You can search the forum for "ckeditor allowed styles" or "ckeditor stripping tags" (something along those lines) and there are a few posts about editing the config file to allow what you are asking for.1 point
-
1 point
-
Note: this functionality is now built into AdminOnSteroids. I wanted to hide the Tree dropdown menu for some roles, so I made this simple module. https://github.com/Toutouwai/RestrictTreeDropdown RestrictTreeDropdown Allows the Tree dropdown menu to be hidden for selected roles. Usage Install the RestrictTreeDropdown module. In the module config select one or more roles to hide the Tree dropdown menu from.1 point
-
Hi @xfroggy I'm not sure about this at all. $np->parent = $pages->get($user); // set the parent You are trying to set user page as parent for new page. Users pages can't have children.1 point
-
Thanks Sam, the first way is probably how I will be using images for now. Thanks for the tip on where the field uploaded images go to, haven't gotten that far yet but I'm sure I will have images entered that way as well. I was able to fix the broken link by entering the path correctly, but the CKEditor itself rearranges the order of tags, deletes comments etc. For example if I had a comment like <!--note for later-->, the second I hit save that comment is deleted. Also had a "width=100px" to my image code, and it was deleted also. So I got rid of it, I don't really need it necessarily.1 point
-
HI @nabo It looks like you can use subfield selectors: https://processwire.com/api/selectors/#subfield $pages->find("template=store, repeater_fied.hours=10");1 point
-
That's true for the "zip download" export option, but for the "JSON list" obviously it's not. If custom modules were skipped that would have been more "user-friendly" than aborting. I'll use the ZIP option next time though, thanks for the info.1 point
-
1 point