Leaderboard
Popular Content
Showing content with the highest reputation on 01/31/2013 in all areas
-
I've been wanted to start this theme for a while because ever since I first heard of ProcessWire I felt it needed a really calm theme, one void of clutter and noise. While I may have taken this one to the extreme, I'm hoping some will find it's simplicity refreshing. It will be optimised for mobile devices and you can customise the colours, even the grey. I look forward to posting more of my progress!8 points
-
You can configure the behavior of when the cache is cleared. But when you save a page, the cache is always cleared for that page, regardless of any other behaviors you've set. The other built-in options are to clear all children (and everything below), clear all parents (except homepage), clear homepage, or clear site. Another thing is that even a short 5-10 minute cache is hugely beneficial. That means that your page will only be rendered a max of once per 5-10 minutes, even if it gets hit thousands of times in that period. And the shorter the cache time, the less chance someone will ever see stale data. While I think we all have a tendency to make the cache time as high as possible (like an hour, a day, or a week), the right balance is often a much shorter time period. This would especially be the case if your site involved lots of page-to-page relations that fall outside of the tree relationship. Can you explain this a little more in detail. I'm on a shared Plesk Hosting Enviroment. This is not related to the hosting environment. Instead, it means that if you have code in your template files that is performing actions based on the hostname, then ProCache doesn't yet recognize that. For instance, if you are doing anything that checks $config->httpHost in your template file, you wouldn't want to cache that page with ProCache (or the built-in page cache, for that matter). This is an example of a template file you wouldn't want to cache: if($config->httpHost == 'de.domain.com') { $user->language = $languages->get('de'); } else { // www.domain.com // keep default language } However, I will be upgrading ProCache so that it saves the hostname with its cache files so that such a template file could still be cached.3 points
-
I personally wouldn't want my view link opening in new tabs/windows, but I can see why some would. I will plan to make it a configuration option on the ProcessPageEdit module. As for how to explain the current behavior to a client, I'm not sure it needs explanation because it works the same as any other form on the web. If you are completing a form and you navigate elsewhere, your form is not still there waiting for you. So if you want to say anything, that's probably the best way to say it: it works the same as any other form you've ever used on the web... as in "don't click to a link until you've finished your form".3 points
-
@WillyC Con.sider do secure pass.phrase gyration service u.can? you perhaps kickfarter?3 points
-
hello, everyone! been an active reader in the processwire community but never felt like i had anything to contribute. ufortunately, i still don't feel up to speed to contribute much to the community but i thought i'd share a new site. i used ryan's blog profile as a base. it's still not 100% finished (probably at about 90% on the dev side) and the blog hasn't been posted to yet. any opinions/critiques, good or bad, are appreciated. http://revengeofthecakeball.com/ many thanks! alex2 points
-
ProcessWire is fast. With ProCache, ProcessWire is insanely fast! ProCache provides the ultimate performance for your website by completely bypassing PHP and MySQL and enabling your web server to deliver pages of your ProcessWire site as if they were static HTML files. The performance benefits are major and visible. Using ApacheBench with the homepage of the Skyscrapers site profile, we completed 500 requests (10 concurrent) to the homepage. The amount of time occupied to complete each of these was as follows: 29 seconds: no cache enabled 6 seconds: built-in cache enabled 0.017 seconds: ProCache enabled As you can see, the performance benefits are substantial. ProCache gives you the ability to drastically reduce server resources and exponentially increase the amount of traffic your server can handle. This is especially useful for traffic spikes. Beyond measurements, ProCache makes your website feel faster to users, respond faster to search spiders (which can help with SEO), and helps to conserve server resources for requests that actually need PHP and MySQL. ProcessWire is already very fast, and not everybody necessarily needs what ProCache delivers. But regardless of whether you need it or not, there is little doubt that you can benefit greatly from ProCache. For an example of ProCache in action, visit processwire.com or the skyscrapers site. Look in the lower right corner of the page (in the footer). If it says "ProCache", it means the page was delivered via ProCache. We did this for demonstration purposes (ProCache does not put anything in your markup unless you tell it to). More information about ProCache can be found on the ProCache documentation page. Please note There is a known issue when using ProCache with the LanguageLocalizedURL module. I hope to have this figured out soon, but for the moment you should not use ProCache in combination with that module as it doesn't appear to work in full. ProCache does not yet support multi-host capability (i.e. cache and delivery of different content per hostname), but it will very soon. How to get it Like with Form Builder, ProCache was produced as a commercial module to support development of ProcessWire. It is now available for purchase here. ProCache is in a beta test period. As a result, it's being offered with introductory pricing that may increase once we're out of that period. During the beta test period, I just ask that you let me know if you run into any bugs or issues during your use of ProCache. I also recommend that you follow the usual best practices with regard to backing up your site and testing everything before assuming it's all working. Beyond the introductory pricing, you may also use coupon code PWPC-BETA for 10% off the listed prices at checkout. This code will expire as soon as we're out of beta. When you get ProCache, you'll also get 1-year of access to the ProCache-members support and upgrades board, available here in the ProcessWire forums. Upgrades to ProCache will also be posted there for download. Disclaimer: At the date/time that I'm writing this, I think that I am currently the only one using ProCache in production use. That's why I'm providing it with the lower costs and coupon. If you are running production sites where everything must always work perfectly, you will either want to: 1) wait to install on important sites till it's out of beta; or 2) test thoroughly on a staging server or localhost before taking it to production use. In either case, always make sure you have good backups anywhere you install new modules, and always test to double check everything works how you want it to. Get ProCache Now ProCache Documentation Below are a few screenshots that show the configuration screens of ProCache. Have questions about ProCache? Please reply to this topic. Thanks for your interest in ProcessWire ProCache!2 points
-
Hopefully you are getting at least some form entries though? There are a couple things in FormBuilder that will likely keep out most spam even if you don't enable any spam prevention measures. You are right that the iframe makes it invisible to most spiders, so that's one of them. The other is that it requires a unique submit "key" for each form submission, and it must match up with the key in the form that was presented, as well as the one saved in the user's session. Most automated spam isn't sophisticated enough to maintain sessions and retain values in hidden fields. They usually just populate every field available with their spam. So it's unusual for spam to get through a FormBuilder form, even if you aren't using any spam prevention measures.2 points
-
2 points
-
Hey PW, I am only a starting developer and I am still in school and my experience with processwire is quite small but recently I've created my own module for Processwire and I kind of had to ask and copy a lot from other sources, now I want to create a small walk through tutorial for people with the same lack of knowledge as me And as a guide for myselfs in the future 1) Setting up the file. Okay, so we start of by making a new document in the Module root folder and call it Harmster.module for this example, we dont need to add the .php extension. Now every module in Processwire needs to extends the classes and methods from Processwire itselfs so we start off by typing class Harmster extends Process{ } You can also extend WireData, I don't really understand the difference but both work for me A module contains 2 standart classes, init() and getModuleInfo() init() This is kind of, or the same as a __construct() method, this always executes and is executed almost at creation. getModuleInfo() This is a method that is used to show the information in the Processwire CMS. We both need to add these to our fresh class like following: class Harmster extends WireData { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 100, 'summary' => 'Harmster module' 'singular' => true, ); } public function init() { $this->setFuel("harmster", $this); } This is where I, as a starting developer, get really excited about this little code in the init() method $this->setFuel("harmster", $this); Basically creates your class in every template you are going to use and it is callable by $harmster Woah! awesome right! Now this is where I got stuck on, I the user to configure some options in the module :\ hmm... Well I just went asking on the forums and the super nice community of PW came to help me, Wanze in this case (no emoticon because its not allowed) (Check it for yourselfs, http://processwire.c...lds-for-module/) And basically you need to implement some methods from an another object, you should replace this, class Harmster extends WireData implements Module with class Harmster extends Process implements Module, ConfigurableModule But when you add that and try to use your module you'll see you get an error, we need to add one more method to the class called getModuleConfigInputfields add static public function getModuleConfigInputfields(array $data) { } 2) Adding a configurable and usable textbox But now you want to add some input fields, now this is pretty hmm complicated For a simple textbox you put this inside the method you just made: $modules = Wire::getFuel('modules'); $fields = new InputfieldWrapper(); $field = $modules->get("InputfieldText"); $field->attr('name+id', ''some_text_field_saved_name''); $field->attr('value', $data['some_text_field_saved_name']); $field->label = "Hamsters rule!"; $field->description = 'Enter a nice sentance here if you like hamsters'; $fields->append($field); Now you've created a input field and you can use it with $this->get(''some_text_field_saved_name''); in all your methods in this class (no emoticon because its not allowed) If you're lazy Now what you've created is a configurable module, heres a I am lazy and i want to pastey (no emoticon because its not allowed) class Harmster extends Process implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } } Now if you want to add a overview page, much like the setup, pages, acces and module tab in Processwire CMS default you can easily do this by adding 2 new methods in your class, install and uninstall 3) Creating your install and uninstall So you want to get a nice overview for your module now eh? Well we can do that because Processwire is awesome like that I did this for my module Now, we need to add 2 methods to our class, ___install and ___uninstall (yes, 3 underscores) So add this to your class: public function ___install() { } public function ___uninstall() { } I think that these are kind of self explaing, the one method gets executed when the user installs the module and the other one gets executed when the user deinstalls the module. Now we want to add a page to PW CMS, but how (no emoticon because its not allowed) Thats actually really easy, $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'MailChimp'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } This is how you install a page, notice that we name the page to self::PAGE_NAME therefor you want to add const PAGE_NAME = 'harmster-module'; with the name of your module BUT BUT now everyone can look in to this module D:< i dont want that! Ofcourse you dont want that. Clients are famous for breaking everything where they put their hands on, so we need to create permissions! Now the way you make permissions is just genius and so easy, you just add this to your ___install method, $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } And you create a permission constant just like PAGE_NAME like this const PERMISSION_NAME = 'hr-view'; And of course you can create more permissions, just genius! Now what our install method should look like is this: public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } This will set a module page up for you And we create an uninstall method, this basicly reverts your installed permissions and pages. public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } Now you are might be wondering, how do i get to display content in my page :S Well, I kinda stole this from other modules and it does work, but I am open for suggestions. the method ___execute gets executed when you click on your page in the PWCMS. What i wrote in there is public function ___execute() { return $this->_renderInterface(); } and in renderInterface() i put the next code: private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } Bascily you create a form and you render the form and that displays it for you, just play around with it for a bit and you'll get into it, as i am still getting into it. I am lazy, here a copy, pastey (no emoticon because its not allowed) <?php class Harmster extends Process implements Module, ConfigurableModule { const PAGE_NAME = 'harmster-module'; const PERMISSION_NAME = 'hr-view'; public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } public function ___execute() { return $this->_renderInterface(); } private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } } I'll update this tutorial in the near future as i am still working my way up (no emoticon because its not allowed) Aww, i get an error when i save it, thats not nice. Thanks for reading (no emoticon because its not allowed)EDIT Updating this tutorial very soon, its horrible and incorrect1 point
-
IMPORTANT This is now well and truly out of date! I strongly suggest ignoring it. The Bootwire System This is a series of proof-of-concept profiles based on ProcessWire 2.3 (forthcoming) and the Twitter Bootstrap Framework They are currently using Bootstrap 2.3 and JQuery 1.9.1 Bootwire Starter Profile Version 0.5 This version if for those who just want to leap in and get their hands dirty, It includes almost no content at all, very few fields and templates and very little markup. The normal Bootstrap navigation is in place for reference. More details are in the readme. Download Here: http://stonywebsites.co.uk/Bootwire-Starter-Profile.zip Github: https://github.com/jsanglier/Bootwire-Starter-Profile ============================================================ All versions come with a Site Settings page which is a child of a Content Management page in the page directory. This is used for common elements such as site title. The Starter Version has almost nothing in it! Some additional tweaks have been added to TinyMCE and these profiles are pre-loaded with the Modules Manager, the Profile Exporter and the Page Delete module. Please use the Module Manager to ensure all modules are up to date. NEW: Now with some demo functionality in a functions.inc file. Bootwire Demo Profile Built on the starter profile, this version demonstrates some Twitter Bootstrap functionality in the context of a ProcessWire installation. The Demo can be viewed here: http://bootwiredemo.stonywebsites.co.uk/ Download here: http://stonywebsites.co.uk/Bootwire-Demo-Profile.zip Github: https://github.com/jsanglier/bootwire/ Bootwire Admin Theme I have created an admin theme using Bootstrap 2.2.2. It is functioning but should be treated as a work in progress. However, you may like it. It has its own thread here. http://processwire.com/talk/topic/2640-bootwire-admin-proof-of-concept-admin-theme/ ============================================================== Future Profiles Bootwire Blog Profile This is intended to be a basic blog system using the Bootstrap framework. I am planning to start from scratch with the blog, basically because I need the exercise. It will not be as clever as Ryan's system, but it will have the following features (er ... possibly): Category Tree Tag System In-Article gallery Media pages Alternate themes for posts Lots of global settings Manual related posts Automated related posts (okay, probably beyond me) er ,,,, some other great feature that I have not thought of yet.1 point
-
Several times now, the following has happened to me: I place a page in the tree as "/team", and I have some templates for menus etc. that go and grab that specific page, to create a list of it's children. Another team member (someone who's working on content) comes in and moves that page from "/team" to, say, "/about/team" - the template that tries to list the children of the "/team" page are now broken and listing nothing at all. ProcessWire gets around this issue by placing the actual page IDs in a configuration file somewhere - I really don't like that approach, since those IDs are just auto-incrementing numeric keys with no particular meaning. I'd like to request a simple, small new feature: an optional, unique page ID attribute. This would work much like the ID-attribute in the DOM - where only one element with the same ID is allowed in the same document, only one page would be allowed to have the same ID on a site. And where in the DOM, you can find a particular element by it's ID, regardless of where in the document it's located, in ProcessWire, you'd be able to find a page by it's ID, regardless of where in the sitemap it's located. Thoughts? Edit: a different term would need to be used, since the numeric ID is already known as the "page ID" - so maybe "page key".1 point
-
This is the third of my demos using ProcessWire, attempting to both show the flexibility of the system to local clients and to demonstrate a range of basic site approaches http://pwdemo3.stonywebsites.co.uk/ This one takes the idea of using blocks to an extreme. It allows you to create a large library of blocks with some standard customisations: You can Choose to display a title or not Choose to link the title to another page Additionally, link the image to another page Choose to display an image or not Display the image above or below the text Add a video to the text box Choose an icon from a list (and turn it off and on) Select a colour theme for the block from a pre-designed set Each page has tools to select and arrange blocks from the library - only the footer blocks are controlled globally. I have used a fairly artistic approach for this particular version, but to be honest it could be used for anything Note to self: When dealing with lots of lorem ipsum, don't hit the spell-check button.1 point
-
$_SERVER['DOCUMENT_ROOT'] would have to be the same as $config->paths->root in order for that to work. Usually they would be, but sometimes they aren't, whether due to a subdirectory install or aliases/symbolic links. You'd probably want to set it like this instead, which should work (unless I'm forgetting something): $home->template->filename = wire('config')->paths->root . 'basic-page.php'; Also, since your basic-page.php is not protected by PW's .htaccess, put this at the top: if(!defined("PROCESSWIRE")) die('No access');1 point
-
That is not an issue - most consumer laws say you are agreeing to the published price - or display price in a website - plus any additional charges that are clearly displayed. What you are suggesting is like going into a shop, picking up an item marked for ten pounds/dollars/franks/yen/ and then leaning over the counter and changing the till value to a pound.1 point
-
As you might now it, Google search engine uses <title></title> tag as very relevant source of information about your web site. Sometimes it's good to use "breadcrumbs" in <title></title> tag to define structure of categories and such. If you want to use this kind of <title></title> tag instead of regular page title, then you could do the following: <title><?php $root = $pages->get('/'); foreach($page->parents()->remove($root)->append($page)->reverse() as $parent) { echo "{$parent->title} - "; } echo "COMPANY NAME"; ?></title> Replace "COMPANY NAME" with the name of your company etc.1 point
-
You can also do this: $u = $users->add('gonzo'); if($u->id) { $u->firstname = 'Gonzo'; $u->lastname = 'Ipsum'; $u->pass = 'BamBam!'; $u->addRole('guest'); $u->save(); } else { echo "That username is already taken, please choose another"; } The benefit of using $users->add() is that it actually creates and saves the user before you populate it, meaning you can exit out earlier if there is some error. But the main reason is that some fields (like files or images) require the page you are manipulating to have an ID before you can add files. So this saves you from having to think about that. If that's not a consideration, then it doesn't really matter which approach you take.1 point
-
The posted code example looks okay to me. But I'm not sure I understand the question… What is the "drop down module"? We'd probably also want to see where $country is coming from and where you are setting $input->whitelist->country. But most importantly, what is the expected output, and what output are you currently getting? Curly brackets only necessary if you've got two "->" in there, meaning, you can do this: echo "$page->title"; but not this echo "$page->image->width"; you'd have to do this: echo "{$page->image->width}";1 point
-
This is interesting - http://docs.jquery.com/Tutorials:Safer_Contact_Forms_Without_CAPTCHAs1 point
-
Haha, yes in this case not a real problem maybe. But I see it rather as the "most stupid thing" to create and publish such a script to the not so aware folks out there in the first place. Which obviously has a security problem and will be used by common "have no idea" users. And I'm not sure about what the laws are if a user can order a thing for 0.01 and you at the end have to deliver it for that price.1 point
-
Great site josedigital! I would have never guessed this used the blog profile as a base. Nice work! I think this is pretty common. This is really only an issue if you are selling digital products with instant delivery. In a case like this site, where somebody has to create or ship something, I don't think it's a problem. There's absolutely no benefit to manipulating the values. The paid amounts are almost always in the face of anyone fulfilling orders. If someone is manipulating these things to place an order, it falls under the category of "world's stupidest crimes." They are committing fraud while creating a permanent paper trail and providing personal info like a credit card and/or mailing address.1 point
-
Thanks guys. I'll let you know when I have a first release. For now you can see a preview of the interface. http://jsbin.com/aheres/171 point
-
Mats already postet the page. To make it clear, look up "Custom Options and Markup" . $results->renderPager(array( 'nextItemLabel' => "Perto", 'previousItemLabel' => "Anterior"))1 point
-
1 point
-
The thing with multilanguage fields for images is that i.e. if you have a news site with sliders, you're probably going to write headlines on the images themselves - and if you have news in different languages... then you have to do alternate fields etc. anyways: additional field for language code works like a charm for me, as it differentiates code from content: nowhere in my code do i have to hardcode what my default language is, neither do i have to account for all languages i already have (or might have in the future) Thanks a lot for taking time to answer - I must say that the support here from both ryan himself and other moderators is just perfect. Really making things easier.1 point
-
With some conditional logic like $homepage = $pages->get('/'); if($page === $homepage) { echo "<title>Company Name - {$parent->title}</title>"; } else { echo "<title>{$parent->title} - Company Name</title>"; }1 point
-
If you use the dev version of PW you have built in support for Gravatar and webiste. https://github.com/ryancramerdesign/ProcessWire/tree/dev/wire/modules/Fieldtype/FieldtypeComments1 point
-
You are right. If you need more fields (first name, last name, image etc.), you can add them to the user template. $u = new User(); $u->firstname = "Gonzo"; $u->lastname = "Ipsum"; $u->name = "gonzo"; $u->pass = "BamBam!"; $u->addRole("guest"); $u->save();1 point
-
Wow. I just stumbled on this: http://processwire.com/api/variables/user/ It looks like I don't even *need* to know the structure behind user accounts. By using the PW API, I can generate user accounts all day long... Am I right? So. Awesome. Thanks, Ryan! And everyone else here, of course. lol1 point
-
@adamspruijt: ProCache caches URLs, and doesn't care so much what page they ultimately map to. So it works with regular pages, URL segments, page numbers, etc. It will also bypass the cache if any GET vars are present, unless you configure it otherwise. So long as the same URL like domain.com/path/to/page/ is always served in the same language, then you are good. But if you are serving different languages at the same URL, then a cookie or GET var would be the only way to bypass the cache.1 point
-
Oh, the Fins I worked with were great, but they came with a health warning. They could REALLY drink!1 point
-
Just relaunched my portfolio, of course with PW. It's a one pager but of course everything is editable via PW. Portfolio Webdesign Karlsruhe Feedback welcome.1 point
-
Hi Marty... You can use tools like ApacheBench to do this (installation instructions here. Steps 1 & 2 are all you need). Warning; if you point this at a live production server and fire off a lot of requests at it you are effectively operating a denial of service against that site for as long as the test is running, so you'd want to keep the number of requests pretty low to limit how long the site is affected ... say a hundred requests to start with... ab -n 100 -c 10 -r http://site.to.test/ If you are testing on localhost or a non-production server, feel free to wind the requests right up (that's the number after the '-n'.) There are other tools that can be used for profiling and some are listed in the answer to this server fault question.1 point
-
This looks impressive, Ryan, thank you very much for your hard work! I have to agree with the rest, the kind of performance we'll be able to achieve with this module installed is just amazing! ProcessWire just keeps getting better and better!1 point
-
Nice one Ryan! There's a couple of sites I run where this is going to get used. Noob question: How does one load test a site?1 point
-
Thanks. And if you want this title on homepage: <title>Company Name - {$parent->title}</title> And on all other sites: <title>{$parent->title} - Company Name</title> ?1 point
-
This helps greatly the future development. Whenever there are core changes on selectors (optimization, new features etc), these tests can be run and see that everything works like they should. AFAIK currently only selectors are tested, but this can be taken much further for all parts of the framework.1 point
-
Depends on the Hardware of your server. Most standard shared hosting don't allow setting to high values. When uploading big files, you should also check out the settings "max_input_time" and "max_execution_time".1 point
-
I have had several similar responses from our clients when I do the final CMS training with them. Sometimes I will also demo it during a pitch. The drag-and-drop file upload always gets a positive reaction And once I have auto image resizing implemented, the admin bar installed, and the manage pages turned off for the client, it couldn't be much simpler!1 point
-
(It's been quite hectic around here the last couple of days - sorry to keep you "waiting"). Well, it seems I lack the capability to split things into pieces more than one person can work on simultaneously.. But let's see. I did some small structural adjustments, again. At the moment I'm thinking of these separate test classes for selectors: ValidityTest - to check that invalid selectors are being reported correctly, and valid ones are accepted OperatorsTest - to have some basic tests for each of the operators (this is the part that has some content there already) SubfieldTest - to test the different kinds of subfield selectors (parent.* and fieldtypes Page, Repeater, MapMarker, Comments + those I'm forgetting atm) SortAndLimitTest - to test various scenarios with sort, limit, start and end I think these would cover most common scenarios at least. Then there are a few more special selectors probably requiring a bit different approach (count, has_parent, include, status, grant_check), especially regarding consistency between in-memory and db queries. And it may be beneficial to test with a set of very complex selectors as well as there just might be something nasty lurking around - at least after some bigger core modifications if not currently. And I think you'd like to be able to do something like that one day. I'm quite keen on trying to get some test coverage report out of the system pretty soon as well (@apeisa: yeah, that sure looks interesting - have to see if that would suit our needs). And after that extending tests to cover functions in Page(s), Page/WireArray and so on will be my target. But I guess it's better to try and nail them selectors first . So, you could basically pick any of those test classes outlined above or just wait for me to submit issues to GitHub . SubfieldTest should be pretty straightforward to do based on OperatorsTest - and there's actually a stub just waiting for you in GitHub already. ValidityTest is another one you could write at once, but that should be done a bit differently from OperatorsTest I think (there's a way to handle exceptions in PHPUnit). Anyway, I'm going to continue a bit with the operators and then head to sort & limit, unless you get there first . Sadly it seems I haven't got too much time to invest on this right now - I hope I'm able to get something done during the weekend though.1 point
-
Järjestelmä - System Epäjärjestelmä - Unsystem Epäjärjestelmällisyys - Unsystematicality Epäjärjestelmällisyydellinen - Something that is seen as unsystematicality Epäjärjestelmällisyydellistyttää - To make something/-one be seen as unsystematicality Epäjärjestelmällisyydellistyttämätön - One that hasn't made something be seen as unsystematicality / Something that hasn't been made be seen as unsystematicality Epäjärjestelmällisyydellistyttämättömyys - The act of not having made something be seen as unsystematicality Epäjärjestelmällisyydellistyttämättömyydellä - With the act of not having made something be seen as unsystematicality Epäjärjestelmällisyydellistyttämättömyydellänsä - With his/her act of not having made something be seen as unsystematicality. Epäjärjestelmällisyydellistyttämättömyydellänsäkään - Not even with his act of not having made something be seen as unsystematicality. Epäjärjestelmällisyydellistyttämättömyydellänsäkäänkö - Is it not even with his act of not having made something be seen as unsystematicality. Epäjärjestelmällisyydellistyttämättömyydellänsäkäänköhän - I wonder if it's not with his act of not having made something be seen as unsystematicality. source: http://www.finlandforum.org/viewtopic.php?f=9&t=91721 point
-
You can also use my image tags module http://modules.processwire.com/modules/textformatter-image-tags/1 point
-
There are quite a few ways to accomplish this already: // numeric id should remain same no matter what.. and if it doesn't, no other attribute could be trusted either $pages->get(1919); // like you pointed out yourself, config values are one option; you can set them in config.php or run-time $pages->get($config->teamPagesID); // you could also use your own custom field for this and define it global if you want it to always exist $pages->get('page_id=team'); // if the name of that page is very unlikely to change (and very likely to be unique), you could even find the page based on that $pages->get('name=team'); This is just my opinion, but I'm not confident that this would be beneficial enough to justify a core addition. I'd rather suggest that you turn it into a module; under the hood $pages->get() uses $pages->findOne() which in turn uses $pages->find() and since $pages->find() is hookable you could easily inject your own desired functionality there. This would, of course, require addition of that custom page_id field I mentioned above and perhaps another module / method to fill it in (and make sure that it's really unique) but that doesn't sound too complicated either. Edit: clarification about the uniqueness of name field added, thanks @Soma for pointing this out.1 point
-
Hello, How about taking away the admin rights of anyone who moves a page in that manner? Just kidding, sort of... But it would solve the problem. Thanks, Matthew1 point
-
This is possible Create a field of type "FieldsetOpen". In your template, just sorround your fields you want to wrap in this fieldset with the fieldset created. //Example for fieldset with name "fieldset_advanced": fieldset_advanced date summary fieldset_advanced_END Btw there exists also a "FieldsetTabOpen", which displays the wrapped fields in a new Tab1 point
-
It's not a bad idea (the first idea, not the second one ). The easier you make it to install a particular profile the better, but my idea (which I remember posting ages ago) was to have the PW download page a bit like the jQuery download page where you build a package. Think of it - the core and default profile are ticked for download. You can select a different profile and that's your basic options. On top of that though, there could be a list of useful modules - by this I mean the most often used/searched for (there must be some stats from the modules directory - I'm looking for them now on Google Analytics). The downloader would then fetch the relevant packages from GitHub and merge them together into one zip file on the fly. I seem to recall the biggest issue for this being how to fetch stuff from GitHub, but someone's already solved that with the ModulesManager EDIT: There is obviously some overhead to this, but this is a dedicated server after all, plus this idea makes us look quite slick, gives users what they want and puts it all together so all they need to do is install it. Version 2 is a single file they upload to their server and they do the same thing but it fetches all the files to their server and installs it based on the settings in the single file installer1 point
-
When you get 404s for everything but the homepage, that means the .htaccess file is not working. Edit your .htaccess file and paste in some garbage at the top, like "alkjaelfkjaef" and save. Now view your homepage. If you get a 500 error, your .htaccess is working (and you should look at the RewriteBase Nik mentioned). But if your homepage still works, then you know your .htaccess is not working. At this point, you need to tell your web host to turn it on. Or if you run the server, you need to add "AllowOveride All" to your httpd.conf for the account.1 point
-
1 point
-
We're planning to have JSON export/import for fields. Templates are a little different in that they have a file on the disk too. But we can still make the data structures templates portable in the same way as fields.1 point
-
I was working over this code from apeisa http://processwire.c...t__20#entry1364 and wanted to share the result with you all. Basically, this allows you to mirror the admin form from a given page to the frontend. To give some flexibility, you can fill an array with the fields to exclude —or else, the fields to include— on the output. EDIT: I forgot to tell... this works well with regular fields (text, textareas, checkboxes, radios, multiple choice, etc), but didn't manage to make it work well with images, for instance. So, here is the code: <?php // Get the page you need to edit $mypage = $pages->get('/some/page/'); // Populate with the names of the fields you want to exclude OR include (see instructions below) // Leave empty to output all the fields $myfields = array('body', 'email'); $form = $modules->get('InputfieldForm'); $fields = $mypage->getInputfields(); // If array is not empty use it to filter the fields if ($myfields){ foreach($fields as $f){ // Output all the fields minus the ones listed in the $myfields array // Instead, to output only the fields that are in the array, remove the (!) from the condition if (!in_array($f->name, $myfields)){ $form->append($f); } } } // Else, include all the fields else { $form->append($fields); } // Add save button $field = $this->modules->get('InputfieldSubmit'); $field->attr('id+name', 'submit_save'); $field->attr('value', 'Save'); $field->label = "submit herei"; $form->append($field); // Process the form // (code replaced by a new one provided by Ryan) if($input->post->submit_save) { $form->processInput($input->post); if(!$form->getErrors()) { $mypage->of(false); // turn off output formatting before setting values foreach($mypage->fields as $f) { $mypage->set($f->name, $form->get($f->name)->value); } } } include("./head.inc"); // Render the form echo $form->render(); include("./foot.inc");1 point
-
I have the Same "problem" with my host. Cant look right now but I think the solution was to look in your .htaccess for a commented line with the RewriteBase, just uncomment it so that it is like RewriteBase / Will look tomorrow at my installations.1 point