Leaderboard
Popular Content
Showing content with the highest reputation on 07/13/2016 in all areas
-
I haven't had the chance to know PW 2.1 so bear with me Well I don't care if something should belong to the core or not. If I need a feature that I can solve relatively easily with CSS/JS to simplify my admin life, I'll do it. If it makes itself into the core I'll happily remove from the module. But it's unlikely that these feature will be part of PW within months or even years, and I need them now. Even the admin themes don't change too rapidly so I have time to fix the errors. Apart from these it's fun to play with this @grimezy download the latest from GitHub, the button and matrix repeater issues should be fixed. The latter was present in simple repeaters too and that was already covered.5 points
-
I want to add my 2 cents too. @Soma: yes it maybe error prone, and yes some of these steroids should belong into the core. In the past we have had some small modules that tweeked a single thing in the admin, fe add more button functionality for pages directly in the page tree overview, your "page is edited reminder" to avoid accidentaly leaving a page without saving, and others. Over the time, many of this was included into the core. And I believe not all would have benn incorporated without becoming a module first. So, besides all the good steroids stuff here, there are two things I additionally like on AdminOnSteroids: 1) that it collects many usefull parts into a single collection, avoiding to deal with 10+ small modules, and 2) to have the ability to see (and early use) what all can be possible. Ah, there are more: 3) for Ryan it can be a good way to just try out things, and, hopefully incorporate some into the core than. 4) I can decide for every single feature to en- or disable it. I even can install AOS and have the unchanged default admin theme. So, if there is an error (CSS/JS) I simply can disable a feature or the complete module.5 points
-
@loukote, has someone already said to you that you should grab a template, give it a document, tag and description fields? As addition to @Robin S, If you don't need to display those single document pages to the front, you don't need a template file. Just create a new template in the backend. Additionally to my addition: For those cases, doc repository, category repository, etc, I create two templates without a template file: a parent template (REPO) and a child template (ITEM) The parent template has the following setup: may pages have children: yes can this template be used for new pages: only one! allowed templates for parents: home allowed templates for children: ITEM show in the shortcut menu: no fields: only a title The child template has this one: may pages have children: no can this template be used for new pages: yes allowed templates for parents: REPO show in the shortcut menu: yes fields: a title and all what is individually needed! In the family settings of templates they are linked to each other. After setup the templates and creating the single allowed parent page in the tree, further no one can create repo items on a wrong place, and you can use the short cut dropdown in the admin for creating new entries! I propably do create the templates in two simultaneous opened tabs in my browser, because when creating the first one of them, I can not directly link to the other (as it doesn't exist yet). So I go to a second browser tab, create the other template, link it to the first one and save. After that, I can link the first one to the second one too, and I'm finished. And really, you don't need modules for such things, you simply use PW as it is to setup things individually. Simple, easy and fun! ------------------------5 points
-
Ok been trying to take on everyones comments. In doing so I've split repos into beginner and intermediate. https://github.com/benbyford/PW-starter-modules/ https://github.com/benbyford/PW-intermediate-modules In doing so I can add to them with simple and more complex modules as and when I create them (and learn a new skill). The basic ones are currently super basic, so could probably do a couple more and then stop of crucial things to learn in modeul making. Any more suggestions welcome.4 points
-
Just added a few CSS tweaks to the compact module list feature and it got really compact Since clicking on the module names loads the module settings page I added a small icon next to them, and hided the Settings button. It may take some time get familiar with this but I think it makes sense. Install and delete buttons are placed to the far right, so rows usually fit in one row now (depending on screen resolution and module descriptions). The delete button also got a reddish background color. Edit: module main icons are moved to the right within their cells, so module names align nicely to the left, making them more readable (otherwise modules with no icons caused "ragged" column)4 points
-
A view month ago, I finished a website for a local Car Dealer. It is based on handcrafted CSS with pocket grid. The dropdown menu is made in CSS, without Javascript. It also has a separate menu for tablets and one for mobile phones. On the intro page is a jssor animation. All background images are made by me. All other content is from the owner. Here are some screenshots how I designed the initial version: http://buescher-gruppe.de/4 points
-
Hey @tpr and anyone else interested in the Mail panel. I have the first version up and running locally, but thought I would post a screenshot first to get some initial feedback before committing the code. Features: If the Mail Panel is enabled, it will intercept any outgoing emails - they won't be sent out, but instead, displayed in the panel. Each email sent gets its own entry which is great if you have one sent to the user and one back to the admin (or similar). You can toggle the body in text, html, and html source versions. Any initial thoughts on the layout or functionality?3 points
-
Hello, in one of my current projects, we have a test and production stage with their own ProcessWire installations, and we regularly want to migrate template/field configuration to the next stage without migrating content as well. ProcessWire supports this via the import/export functionality in the admin GUI. However we (and some others) would like to do this as part of an automated process. There seem to have been some discussion on this topic and two existing modules that get pretty near our requirements: https://github.com/mindplay-dk/SystemMigrations/blob/master/SystemMigrations.module https://github.com/LostKobrakai/Migrations However, they try to solve more then we need and for mindplay-dk's module, development seems to have discontinued. At that point I decided to build a more simple module with reduced scope that basically just makes ProcessWire's import/export automation-ready. Thanks in advance for trying this out and any feedback! About this Module CAUTION: This module is incompatible with repeater fields and ProFields. The module enables you to transfer template and field configuration from one processwire installation to another in an automated way. Changes to templates or fields are exported to the file system immediately (so they can be added to source control together with changes in the template files) The import script is designed to run from the command line (so it can be invoked from your build/deployment tool). On invocation in import mode, a DB backup is created template/field changes from the persist directory are imported into the DB In restore mode, the import script can restore any of the DB backups previously saved How to Use Make sure the module is installed in the source and destination ProcessWire environments. After installation of the module, you should check if the module's default persistDirectory configuration setting fits your requirements. The module will automatically export all fields, fieldgroups, and templates to JSON files in the directory specified by that setting. Note that the same setting is used by the import script as well, so if you change it, make sure you change it in all affected ProcessWire environments. The JSON files can be transferred to the destination ProcessWire environment. Running the import script from the command line will import template and field data in the destination ProcessWire environment. Manual Installation Caution: Beta software - do not use in a production environment without prior testing and regular back-ups. Caution: This module is incompatible with repeater fields and ProFields. In case automatic installation does not work, get the code at https://github.com/jaromic/pw-autoexport-tf/ and follow the instructions in README.md for manual installation. Manual Uninstall Delete the following files and directories from your module directory: AutoExportTemplatesAndFields/ AutoExportTemplatesAndFields.module Download Install from the module directory, clone the repository via GitHub, or download ZIP.2 points
-
Nice we now moved from a plain module list (PW2.1) to sections for sake of overview, now you make it flat again with this module I think while it's nice to have all these steroids, it's something I'm trying to keep away from doing too much admin tweaking. Some of these should be considered in core and not via such an module. It's prone to errors and confusions once core admin changes stuff around. Not trying to drag you down. Just my 2 cents.2 points
-
Would this module be any good? http://modules.processwire.com/modules/fieldtype-select-file/2 points
-
Shortening and possibly avoiding if/else statement is such a great improvement to code2 points
-
Yes, you could do all the above. I don't know what you're after with those external databases, but in most cases I think it's not convenient to have separate models to work with. Keep in mind that working with hundreds of thousands of pages (data containers) in ProcessWire is no problem. I haven't seen real performance issues for sites with more than a million pages. On the other hand, ProcessWire is just executing PHP so if you wish to use external databases you go can go for it.2 points
-
Ooh, ooh, me first! You should grab a template, give it a document, tag and description fields There's no document library module (that I'm aware of), probably because a module isn't needed for something like this. For your task the basic item you are dealing with is a document record. This is a collection of information: URI, description, tags. In ProcessWire the 'page' is the unit that is typically used to store a collection of information. And in ProcessWire, a page isn't necessarily a complete page that visitors view on the website front-end; a page can consist of only a title field, and you will probably use something like this for your tags/categories. The broadened definition of 'page' in PW is one of the things that can be confusing at first for new users. It took me a bit of time to adjust my idea of what a page can be. So as you predicted, you would create a template to use for document records and give it the fields you need. Then you add one page per document under a chosen parent in the page tree. It's up to you whether you make individual document records viewable as individual pages on the website front-end. You might decide you don't need that and only pull in information from the records to display as part of another page (search results or category listings). A great place to start is Ryan's Skyscrapers profile: http://demo.processwire.com/ http://modules.processwire.com/modules/skyscrapers-profile/ Replace the concept of 'skyscraper' with 'document' and you'll see how PW can be used as a document library. I did exactly that for the first website I built with PW: http://ref.dunestrust.org.nz/2 points
-
I've updated the my modules replacing HotUserSwap with simple TextformatterFindReplace instead. I'm going to work on some field types next2 points
-
You could write a beginner module about Fieldtype/Inputfield which accept a simple text, save it and render its markup . As Horst said, nice initiative !2 points
-
MarkupGoogleRecaptcha Google reCAPTCHA for ProcessWire. This module simply adds reCAPTCHA V2 or Invisible reCAPTCHA to your form. How To Install Download the zip file at Github or from the modules repository Drop the module files in /site/modules/MarkupGoogleRecaptcha In your admin, click Modules > Refresh Click "install" for "MarkupGoogleRecaptcha" Official install/uninstall doc: http://modules.processwire.com/install-uninstall/ API You must create an API key prior to use this module. Goto https://www.google.com/recaptcha/admin to create your own. Next, add the API keys information to the module's settings. Usage Call the module : $captcha = $modules->get("MarkupGoogleRecaptcha"); Call $captcha->getScript(); somewhere to get the javascript used by reCAPTCHA Render reCAPTCHA in a standard HTML <form></form> by calling $captcha->render() or Render reCAPTCHA in an InputfieldForm by passing as argument your form to the render function: $captcha->render($form) Call verifyResponse() to get the result. It return TRUE if the challenge was successful. Example Using ProcessWire's form API : $out = ''; $captcha = $modules->get("MarkupGoogleRecaptcha"); // if submitted, check response if ($captcha->verifyResponse() === true) { $out .= "Hi " . $input->post["name"].", thanks for submitting the form!"; } else { $form = $modules->get("InputfieldForm"); $form->action = $page->url; $form->method = "post"; $form->attr("id+name", "form"); $field = $this->modules->get('InputfieldText'); $field->name = "name"; $field->placeholder = "name"; $form->add($field); // CAPTCHA - our form as argument, the function will add an InputfieldMarkup to our form $captcha->render($form); // add a submit button $submit = $this->modules->get("InputfieldSubmit"); $submit->name = "submit"; $submit->value = 'Submit'; $form->add($submit); $out .= $form->render(); // include javascript $out .= $captcha->getScript(); } echo $out; Example using plain HTML Form : $captcha = $modules->get("MarkupGoogleRecaptcha"); // if submitted check response if ($captcha->verifyResponse() === true) { $out .= "Hi " . $input->post["name"] . ", thanks for submitting the form!"; } else { $out .= "<form method='post' action='{$page->url}'>\n" . "\t<input type='text' name='name'>\n" . $captcha->render() // render reCaptcha . "\t<input type='submit'>\n" . "</form>\n"; $out .= $captcha->getScript(); } echo $out;1 point
-
Hi! I've been making my first modules and I've created three so far to help me learn. I would love so feedback or pull requests for improvements as I hope to write a tutorial about my work soon. In particular the third modules isn't very finished. git: https://github.com/benbyford/PW-starter-modules/ HelloUserYouSaved - adds message {your user name, page saved} in admin when a page is saved. This module shows how to implement a basic module, get and use variables, create a message in the admin RedirectAdminPages - redirect specific user role to a custom page set in the module config. This module shows how to implement module configuration, using variables saved in the admin, redirecting a user using session->redirect() HotSwapUser - Swap user on the fly in the admin or frontend of your site This module shows how users can be used in a module how to set a user permission how to install / uninstall something within your module how to create a function that can be output in the frontend of your site.1 point
-
It's likely your problem is due to a XAMPP/sendmail configuration issue rather than the module. You can rule out the module by attempting to send a test email using PHP's mail() function. <?php $subject="Test mail"; $to="myaddress@somedomain.com"; $body="This is a test mail"; if (mail($to,$subject,$body)) { echo "Mail sent successfully."; } else { echo "Mail not sent."; } I found I had to jump through some hoops to get mail working in XAMPP. Here are some notes I made for getting mail to send via Gmail's SMTP server.1 point
-
Not quite. Datetime fields are actually stored as MySQL datetime fields in the db. For the wakeupValue this always gets converted from 'Y-m-d H:i:s' string to timestamp via strtotime. Once you save the field the timestamp is converted to 'Y-m-d H:i:s' and stored in the db.1 point
-
When logged into the admin as the superuser, the 404 page appears in the page tree per usual. When logged in as a "site administrator" (a custom role), the 404 page is missing. The 404 page uses the basic-page template and hasn't been edited or altered in any way. Under "who can access this page", it shows the expected permissions (site administrators can definitely edit basic pages), and in fact, if a site administrator navigates directly to the edit screen for the page, it works fine. So it's not a permissions issue per se, it just doesn't show up in the page tree for users in that role. It is a multilingual site, and English is not the default language, in case that's relevant. Any thoughts?1 point
-
I thought that would be the case, but that's ok. Also just noticed this one also: Repeater(repeater matrix field) field cuts some of the notes/info icon. (This only happens if the repeater field is closed first. Not sure if this has something to do with the 3.x to remember open closed repeaters.) Thanks tpr.1 point
-
Very cool. I've shortened some massive if/else statements since reading this.1 point
-
Hi, being new to PW, i don't have a good overview of the existing modules so i'd like to pull your experience: is there a (simple?) document library module? The goal is to store and display documents with a description on a page, maybe sorted in categories. Nothing complex. ... I know, i know -- you say that i should grab a template, give it a document, tag and description fields. I should. Should i? Isn't there something done with some more nice tweaks that i would not think of right away. Thanks!1 point
-
if(!$pages->get("name={$item_id}")->id) { // create new page } Although you probably want to add other limiters to the selector, like a parent page or template.1 point
-
It would be good to also work on some Modules that do not 'autoload' Thanks for your efforts....1 point
-
Right now I am not particular proud of myself, because I maybe had the first occurrence of an hacked ProcessWire installation known to mankind. But not because of ProcessWire itself, but of a stupid mistake I have made. Anyways I want to share my case here: Over one and a half year ago I developed a medium sized website with ProcessWire 2.6.1 for a small community. In the process of releasing the site I had troubles with getting the installation to run on the shared hosting webspace. Because the hoster hadn't configured their file permissions correct, I was forced to loosen up the file permissions inside the site/assets-folder. Because I was desperate and wanted the installation to work I ended up setting every file and folder permissions inside the folder assets to CHMOD 777. I wasn't very happy with this solution and now I know how stupid it was, but I didn't knew better and at least the installation was running. This week I wanted to make a small change to the site and noticed something strange: There was a file called sites.php inside the root folder. At this moment it was clear to me, that my installation was hacked. I immediately downloaded the whole infected installation and compared all files with my local clean installation using a diff tool (Kaleidoscope). After comparing I noticed that inside the index.php one line was inserted which included a functions.php inside the site-folder. Also I noticed that inside the site/assets/files-folder there were several php-files uploaded with the same naming convention like the generated images variants (f.e. filename-large.jpg). So what did those scripts do? Luckily not much, that is the reason I haven't noticed this hack for a long time. The database is as far as I can tell not corrupted and the site was still working properly. All those scripts were doing, was generating spam aliases and redirecting to a medical shop site using the http host of my site. Interestingly on my research I have found out, that most of those malicious scripts were intended to infect Drupal and WordPress installations. A few of those files inside site/assets/files are explicitly targeting WordPress specific functions. If you are interested I can share those scripts for further investigation. But I am not sure if uploading those scripts directly to this board is against the board rules, so if I should upload them to a external service, I am willing to do so. Meanwhile I am confident to have cleaned the site from almost all malicious scripts (I will investigate further) and I am still removing all spam search results from Google using the search console. Also I am in contact with the hoster and try to sort things out, even if it means switching the hoster (which I would prefer). Please don't be to harsh with me. I know I have made a stupid mistake and learned my lesson the hard way, but I wanted to share this story anyway to prevent others from making the same mistake. So always make sure to secure your file permissions! Regards, Andreas1 point
-
From my experience, @Robin S's solution is definitely the way to go!1 point
-
I'm no expert in this, but the way I see it is you have a base price and then one or more 'modifiers' that act on the base price. A modifier could be a tax rate, an export tariff, an addon handling fee for a large item, or something else. You don't work out the results of these modifiers for each base price ahead of time, you just apply them using PHP math operations as needed depending on what options the website visitor has selected. I think the performance impact of basic math operations like this would be negligible.1 point
-
Rather than having two price fields... price price_including_vat ...have you considered having one price field and one VAT rate (%) field? price vat_rate And then you calculate the VAT inclusive price on-the-fly. Seems like it would be easier to maintain this way.1 point
-
A simple fieldtype might be "Name", where you enter a firstname and a lastname, which is stored separately and maybe a computed property for the fullname. I think it shouldn't hold more values, as it'll probably become complex just for the amount of fields. Also interesting might be other often extended core classes/modules like Process or Textformatter, with the latter actually being quite simple with often just a single method.1 point
-
You need a bootstrap script that should be located besides the PWs index.php. I have a template for that: After you have setup all your products, I would write a hook into the site/ready.php. Hook into before pages save, check if it is a productpage, if so, calculate the incl. vat price and populate it to the field, Ready!1 point
-
Hi @kibod , glad you like it and choose it as project starter. And yes in this profile you can have the first parent as menu, clickable.1 point
-
Hi! Very good initiative! I have skimread through the code and my opinion is: The first and second ones looks good. But to be honest, this hotswap user thing is a big security issue. Sorry! Also only for demonstration / tutorial purposes, it is better not to use hot user swapping as a thema. The audience for beginner tutorials often will be, yes, the name says it: beginners. And assumed they simply do not know about such security issues and best practices in regard of how to validate user-inputs, you should not show code like this to them. At least you would need to embedd all security relevant stuff too. But then it fastly will become to complex for a beginner tutorial. A good one would be to only pick up how to validate user inputs and how PW provides good tools for that. (type and format validation, whitelist matching, ...) With your code, everyone can login with each existing account (also Superuser) just by knowing / trying (multiple til endless!) user name(s). In regard to this, you may have a look into ALIF or TracyDebugger, how the security for this is tackled there. I hope you do not mind me my frankness. ------------- Looking to the code of the users redirect module, you can shorten it a bit. When found a matching user / role, you don't need to store true in a temporary var, break the loop and then check the temporary vars value / state, if you should redirect the current user. You simply can redirect the current user if a role matches: /* * ___renderPageRedirect * * redirect user to page if current user role found in config */ public function ___renderPageRedirect($event) { // check to see if current page = admin template page // otherwise: early return! if($this->page->template != "admin") { return; } // find roles set in module configuration and create array $roles = explode(',', $this->userRoles); // for each user in module config check to see if current user foreach ($roles as $key => $val) { $roles[$key] = trim($roles[$key]); // if current user found then redirect = true if($this->user->hasRole($roles[$key])) { // this will leave the page and code immediately! $this->session->redirect($this->redirectPage); // stop user search break; // this can stay in here, just as fallback, // if something went wrong with calling the redirect, // but normally this line will not get executed. } } }1 point
-
Thank you Flydev. I've spent several days looking for proper solution to the PW BS3 dropdown menu issue. And then today I've found this. This profile will be my based from now onward. So far it works good, looking forward to build something great out of this. Once again TQVM.1 point
-
Yeah, TED Talks is stand-up comedy show... It has very little to do with "Ideas worth spreading". Thanks for sharing anyway, the first few minutes were really funny, then I got bored, skipped the end, and came back here to have a lot more fun in the ProcessWire "/talk"1 point
-
Hello folks I made this simple tutorial of explaining my methodology when creating a PW system. https://medium.com/@clsource/understanding-processwire-templates-fields-and-pages-201aecd0a1a4#.osipvjevk1 point
-
@cmscritic Mike, great to hear from you. I'd be very interested to know a little more about the holes in the PW offerings that compelled you to look at WP; there obviously are some, or you wouldn't have made the call to switch. I've never personally used WP, but I know people that like the theme-ability (is that a word?) and the large number of extensions that are available for it. It's also very popular with a large section of online entrepreneurs. I don't think we should get too emotional about folks' decisions to switch, as there are obviously a wide choice of tools around, but I would like to understand what is missing from the PW eco-system - and where possible, without detracting from Ryan's design decisions for PW - plug the gaps through well designed modules and site profiles. Thanks for all you've done in promoting PW and hope we can get you back to using it soon.1 point
-
Hi Barido, Welcome to the ProcessWire forums. I think there will be a number of solutions you can choose from. A few that occur to me are below. 1. Without using any modules and just working with the default Pages tree, you could use either the Published/Unpublished state or the Hidden/Unhidden state of the job page to switch a job from Active to Inactive (or vice versa). These states can be set directly from the Pages tree without needing to open the page for editing, as shown in the screenshot below. If inactive jobs need to be shown on the website front-end then the Hidden/Unhidden state would be the one to go with. In your templates you can test for the hidden state using the $page->isHidden() method. 2. You could use the Batch Child Editor module to toggle the Published/Unpublished or Hidden/Unhidden state. 3. You could purchase the Lister Pro module. This module has a number of cool features, one of which is the inline editing of page fields directly in the page list. So if you wanted to use a checkbox field in the job page to store the active/inactive state you could toggle this field via Lister Pro.1 point
-
It's a real shame that your site got hacked, but this is definitely something we can learn from, so thanks for sharing it. Shared hosting and lax file permissions are an easy way to get into trouble, but I'm still quite curious about how exactly the site was hacked. From what you've mentioned here (uploaded files, etc.) it kind of sounds like the login credentials might've been compromised, or did you perhaps have something on the front-end that could've caused that? Of course if it really was an "inside job", i.e. if the site was attacked by another user on the same shared server, the files inside /site/assets/ could've been planted there manually. Did you have anything else installed on the same hosting account, another site or web application or anything? If you do find out anything else, please let us know, but just in case: if it turns out that this was actually a result of a flaw in the system itself or perhaps a third party module, please let Ryan know of it before posting to the public forums. I'm extremely confident in the security of the core and have a lot of trust in most of our third party modules, but there's no guarantee that nothing will ever go wrong.1 point
-
@cmscritic Hey Mike, The fact that you can drop in and share with us so much about your reasons for the move says a lot about you. I like that; I respect that. As others have said, we've also gained a lot as a community from your collaboration with Ryan: Hanna Code, the awesome CMS Critic development write-up, and who knows how many people have found ProcessWire because of your site . So, thanks for the ride... Best wishes for the future.1 point
-
I thought I'd chime in and answer some questions first and foremost as I saw people chatting about this here. We initially moved because we wanted to add some functionality that would have cost too much to develop. My biggest issue myself is that I am not a developer (i'm a tinkerer) and I wanted more advanced product pages, etc. Yes, they could for sure have been built in processwire but I felt that for someone like myself who is not a code guy, I was too limited by the product as I simply don't have the time to learn enough PHP to code and hiring a developer to do work i could theoretically do myself with wordpress seemed like a waste of money. So those were the initial motivations for moving. Now that we've moved, however, the whole "grass is greener" effect has faded and I have some regrets, however, the extra functionality has allowed us to make more sales and bring on new customers that we didn't have before. So it's a catch 22 for me. I'll expand more on this further down. I don't think this is a fair statement, frankly. The initial point of our website was to view things from an end users point of view, not that of a seasoned developer. Our reviews don't go into how easy it is to code with something but rather how easy it is to use, how functional, etc. These are the things most of our readers want to know as we tend to get a lot of traffic from those who are looking for software but don't have a development background. Yes, this grade sucks. Part of the issue for me is again, I'm not a developer so we clearly need to work on things. This is good to know, please do tell me what specifically you feel is missing so we can fix it. ProcessWire is an awesome product and Ryan did a ton for us. Ideally, I would have loved to have simply paid him to make everything we have now work on PW. If that was a possibility and the cost wasn't too high, I would have gone that route. Sadly, it just isn't feasible sometimes and I often look for alternative ways to compensate those who work for us. Before our move to WP, the intent was to search out vendors who were willing to take on the task of building our site on their platform in exchange for an agreed upon advertising term. In other words, they build our site on their platform (which is a bonus as then their product gets noticed more, as was the case for processwire) and in exchange, we offer advertising for an agreed upon term as the form of payment. With the case of PW, however, this didn't work and we needed to pay for the development costs up front which, while worth it since Ryan is so awesome.. tend to get costly when every tweak needs a developer. If I'm able to find someone with a development house who wants on the advertising in exchange for work method, I may be able to pull off a move back to PW but until then, I may have to search out other alternatives. Fortunately, there are plenty of companies that are interested in doing this but I'm picky so moving is a decision that I need to consider deeply. Normally I wouldn't share these kinds of details to this extent but I feel I owe this community, which we've been part of for a long time, an explanation. So here's the pitch: If there's anyone out there who wants to take on the task of making what we need a reality and getting long term advertising for their business in exchange, drop me a line. Until then, the search for an alternative may continue as WP simply seems to be causing too many issues and bloat (I should have seen this coming granted but hey, nobody's perfect and a critic isn't always right). Thanks for reading Mike1 point
-
A really great article from @M.O.Z.G highlighting his migration from WP to PW. It talks about structuring and retrieving data, multi-language output, creating your own module, and debugging using Tracy. Thanks for a great writeup - really nice work! http://mozg-studio.org/blog/migration2pw/ I have to include this quote from the article1 point
-
@pwired : I will send an email to @kongondo about processwireshop.pw! Thanks for suggesting that. ---- A small trick to make the navbar/dropdown working on mouseover instead of click event: In js/script.js add : $(document).ready(function(){ $('ul.nav li.dropdown').hover(function() { $(this).find('.dropdown-menu').first().stop(true, true).delay(200).fadeIn(200); }, function() { $(this).find('.dropdown-menu').first().stop(true, true).delay(200).fadeOut(200); }); });1 point
-
LostKobrakai's example uses the ternary operator, which isn't the easiest thing to get your head round when used simply, and can very quickly get out of hand. (Nested ternaries, anyone?) <?php $news = $pages->find("template=news-item, sort=-post-date"); foreach ($news as $new){ if ($new->body){ echo" <div class='uk-width-1-1 news-headline-wrap'> <i class='uk-icon-newspaper-o uk-icon-justify'></i><a href='{$new->url}'>{$new->title}</a> </div> "; } else { echo" <div class='uk-width-1-1 news-headline-wrap'> <i class='uk-icon-newspaper-o uk-icon-justify'></i>{$new->title} </div> "; } } ?> Just add a couple of curly brackets as above and you're good to go. Looks like Kongondo and I were in synch there.1 point
-
Thanks for the report. I commited an update that fixes this. I hadn't thought about it and was runnning php 71 point
-
1 point
-
@jordanlev: I wonder, if this recent improvement would make your reporting use-case fast: http://processwire.com/blog/posts/processwire-3.0.6-brings-pages-upgrades-and-link-abstraction/1 point
-
It's rarely I build 'websites' with ProcessWire, most projects I've done this year are of the type application, tool or generator. It has taken a while before I recognised that the admin area is full of potential and could be easily used as starting point. The starting point in the admin is really well designed. You have the ability to hook, to build process modules where you want it, gain access access to or forbid. Easy implementation of Ajax, the ability to use Inputfields, Fieldtypes breadcrumbs tables etc etc and a wide variety of caching possibilities... The thing about everything is a page is a plus. Pages are API wise very well designed, you can use it and take advantage of it or drop it when you don't want to use them. When I have the option to use pages I will do it the pages way. If it makes more sense to go the plain SQL way you could go that way. But I do remember I mistakenly chosen SQL ones where pages were a way better fit.1 point
-
Thanks for the tips, you will be pleased to know I managed to figure it out! : <?php /** * Search template * */ $out = ''; if($q = $sanitizer->selectorValue($input->get->q)) { // Send our sanitized query 'q' variable to the whitelist where it will be // picked up and echoed in the search box by the head.inc file. $input->whitelist('q', $q); // Search the title, body and sidebar fields for our query text. // Limit the results to 50 pages. // Exclude results that use the 'admin' template. $matches = $pages->find("title|body|sidebar~=$q, limit=50"); $pagination = $matches->renderPager(array( 'numPageLinks' => "5", 'nextItemLabel' => "Next", 'previousItemLabel' => "Prev", 'listMarkup' => "<ul class='MarkupPagerNav'>{out}</ul>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>")); $count = count($matches); if($count) { $out .= "<h2>Found $count pages matching your query:</h2>" . "<ul class='nav'>"; foreach($matches as $m) { $out .= "<li><p><a href='{$m->url}'>{$m->title}</a><br />{$m->summary}</p></li>"; } $out .= "</ul>"; } else { $out .= "<h2>Sorry, no results were found.</h2>"; } } else { $out .= "<h2>Please enter a search term in the search box (upper right corner)</h2>"; } // Note that we stored our output in $out before printing it because we wanted to execute // the search before including the header template. This is because the header template // displays the current search query in the search box (via the $input->whitelist) and // we wanted to make sure we had that setup before including the header template. include("./head.inc"); echo $out; echo $pagination; include("./foot.inc");1 point