Leaderboard
Popular Content
Showing content with the highest reputation on 02/24/2016 in all areas
-
Hey guys, here's a video demonstrating the Live Preview feature of ProDrafts. This feature should be available to ProDrafts users this week. Please view the larger + HD version so that you can see it better.5 points
-
I just wanted to mention how great I think it is to use Horst's ALIF module (https://processwire.com/talk/topic/11666-alif-admin-links-in-frontend/) in conjunction with Tracy. The user switcher alone makes it invaluable! You'll notice that I disabled the Debug Mode indicator in ALIF because I have one in Tracy. I have also just added a new option to hide the panel labels which makes the debug bar much more compact and visually appealing: Here's the version with the panel labels which is the default just so you initially know what's what! Note that for positioning of ALIF, I am using Bottom, Right, and 23px for the value for Top | Bottom setting.4 points
-
It is probably because it's used by a small fraction of businesses. Way under 1%. It's not a big enough name yet for it to appear in many job ads I think. But one day... The job ads that would be applicable for someone who knows ProcessWire would be the ones that either don't list a preferred CMS at all, or if they list a CMS they put "or similar" - I've seen plenty of those. "WP or similar" which is your opening to go to an interview and open their eyes to the endless possibilities and lack of security flaws (in ProcessWire, in case you thought I was talking about the other one ). I think that dev agencies looking for new staff tend to ask here, as that's far more useful. We've seen it happen a few times before, and that's only the ones we hear about on the forums.3 points
-
Hi all It's been long overdue, but I have approved all pending profiles (well, except one where they were just trying to advertise some database app that had nothing to do with ProcessWire whatsoever!). @rick - it would be nice to do this. I will add it to my list of things to do. Just today I added a manual link in the Dev Directory admin to check the user's "sites using PW" against isit.pw to save me some time so I can certainly see the benefit of automated checks for existing members in the directory too. Can you let me know if that user's website link is still broken please? @incognito.ms - apologies, I was way behind on directory approvals and your profile has now been approved. @Sephiroth - think of it this way, you have the Nigerian market all to yourself then at the moment There are more planned updates to the directory in coming months, and I appreciate everyone taking the time to submit so many sites for verification. I would suggest you all list your sites in the Sites Directory as I can see one or two that aren't there. I appreciate this isn't always possible due to client confidentiality though, but more exposure for your skills where possible can't be a bad thing3 points
-
This morning, I finally had time to install this module. I am blown away to it's usefulness and wish I had made time to look at this a whole lot earlier. Great work, @horst!3 points
-
I don't share the warm fuzzy feelings I get when I use people's modules nearly often enough, so I just left a comment on the module directory page. The short version is that it's saving me from having to create custom modules for a lot of places where I'd want to output some custom, processed output when editing a page and it is streamlining some of the steps I need to perform when approving entries in the dev directory, so thanks for this!3 points
-
2 points
-
Wednesday is my designated "Discovery Day" in my development lab, where I set aside time to properly look at third party modules. I just installed your implementation of the Tracy Debugger. Thank you for taking the time and effort to make this possible within ProcessWire. This is a great asset.2 points
-
Alternatively you can import via use statement use Dotenv\Dotenv; $dotenv = new Dotenv(__DIR__);2 points
-
(Added by Soma) Note that this module is deprecated. The newer and more maintained version is found here: https://github.com/somatonic/Multisite/ You can get the current dev version here https://github.com/somatonic/Multisite/tree/dev (Original Post) Just pushed simple multisite module to github: https://github.com/a...ultisite.module What this module does? It allows you to run multiple sites with different domains run from single install, using same database. While you can easily do "subsites" like www.domain.com/campaign/, this allows you to turn that into www.campaign.com. This is nice stuff, when you have multiple simple sites, that all belong to same organisation and same people maintain. How to use it? Just create page with name like www.campaigndomain.com under your homepage, then edit this module through modules menu and add same domain there. If your domain resolves to same place where your main domain, it should just work. Please notice that if you have editing rights, it allows you to browse the site from www.olddomain.com/www.campaigndomain.com/, but users with no editing rights are redirected to www.campaigndomain.com (this is because session cookie is otherwise lost). Any problems? Not any real problems, at least yet known. Of course think twice when deciding should the site have own install instead of this. There are few benefits, like getting data from other sites, one admin view for all sites etc... but it can easily get out of the hands: number of templates, fields etc.. It is harder to maintain for sure. Isn't there multisite support in core? Yes, kind of. It is very different from this. It allows you to run multiple pw-installations with shared core files (/wire/ folder). This is totally different: this is single pw-installation which has multiple sites running from different domains. This is basically just a wrapper with one config field for this little snippet Ryan posted here: http://processwire.c...ndpost__p__5578 (so most of the credit goes to Mr. Cramer here). What it also does is that it manipulates $page->path / url properties to have right subdomain value.1 point
-
Visual Page Selector Released 31 March 2016 https://processwireshop.pw/plugins/visual-page-selector/ As of 04 January 2018 ProcessWire versions earlier than 3.x are not supported ******************************************************* ORIGINAL POST ******************************************************* Introducing VPS, a commercial visual page field selector. This is a pre-sale closed-beta version. This post is WIP and will be updated now and then. ############################ Many ProcessWire users use the 'one image per page' principle to manage and reuse images across their sites. This works fine. However, for site editors who mainly work with images, especially for larger sites, it is sometimes difficult to remember the pages where particular images reside. This module helps to solve this challenge. Harnessing the awesomeness that is ProcessWire, VPS provides a rich editing experience, enabling editors to search for, view, select, add, remove and delete page-images easily, in an easy to use and friendly interface. ProcessWire Lister is the workhorse behind the lightning-fast searches. Editors will be able to search for images by their descriptions, names, partial names, page names, templates, etc. Current Features Single-image mode Full search Batch add/Remove/Delete Image/Delete Page in page fields Image Browser Selectable pages as per page field settings + Lister filters Grid and List View Draggable sorting Responsive (almost fully ..iframes!) Planned Features Multi-image mode (there are times you want to group similar images in multi-image field in one page; e.g. the back, front and side of a car photo) Configurable CSS on the fly resizing vs real image resizing (image resizing can quickly hog memory) Other as per feedback from beta testing FAQs When will this be available? Soon. How much will it cost? Reasonably priced. Announcement soon. Where will I be able to buy this from? At all fine stores that stock quality ProcessWire products Do we really need another page field/inputfield select? See links below. What type of licenses will be available? Soon to be announced. Can I beta test this? Thanks for the interest but all available slots have been taken. Video (excuse the video quality please - too many takes....) Screens Previous Discussions https://processwire.com/talk/topic/10927-wishlist-select-pages-by-thumbnail/ https://processwire.com/talk/topic/4330-get-image-from-other-pages-via-images-field/ https://processwire.com/talk/topic/417-extending-image-field/?p=6982 https://processwire.com/talk/topic/7073-profield-table-and-gallery/ https://processwire.com/talk/topic/3200-image-management-concerns-is-processwire-suitable-for-me/ https://processwire.com/talk/topic/425-file-manager/ https://processwire.com/talk/topic/10763-asset-manager-asset-selector/1 point
-
Finally, I got spared some time to work on a project I have been meaning to do for a while. This follows on from this request and other discussions about the pros/cons of an ApiGen for ProcessWire. I am all for such docs as long as two conditions are met: (i) That it is clearly indicated who the target audience is; and (ii) that the docs are regularly updated. I think this project meets both. I have created a GitHub project and project pages for hosting regularly auto-updated PHP ApiGen Docs for ProcessWire 3 (master and dev) as well as ProcessWire 2.8 (master). We also have ProcessWire 2.7 (master and dev) docs but these are not updated since this version of ProcessWire is no longer active. The whole doc-generation process is automated including auto-pushing changes to GitHub. The current cycle is: ProcessWire 2.8.x Master branch docs: updated once at the beginning of every month ProcessWire 3.x Master branch: updated once at the beginning of every month ProcessWire 3.x Dev branch: updated once weekly, every Friday Docs are generated for all .php and .module files under /wire/core/ and /wire/modules/. Currently, this is all done via my home PC. I am on a Windows machine so nothing could really go wrong... . Barring the unforeseen, these docs should be roughly in step with the latest ProcessWire commits. Now running on a remote server. Tools used Windows PowerShell (move over wget! ) wget Git-Bash Windows Task Scheduler (there's your cron right there ) cron Pear APIGEN Scripts: PowerShell, Bash Script, VBS and Batch files A couple of stress balls I hacked together a dark theme for this project, sublime-text default look. The CSS still needs some work, all help appreciated, thanks. If anyone would like to create an alternative theme, we could incorporate a theme switcher. Feeback, thoughts, suggestions (e.g. text in READMe, etc)? Credits to Ryan for writing such well-commented code...otherwise this project would not have been possible. From the READMe1 point
-
Hey, The Form API has CSRF protection build in, but if you for some reason don't want to use the API you can however use the CSRF protection. Its very simple but it took some time for me to find out, so i figured i share my findings with the rest. What is CSRF? First you need to create a token and a token name you do that as following: $tokenName = $this->session->CSRF->getTokenName(); $tokenValue = $this->session->CSRF->getTokenValue(); Very simple. Now what you want to do is create a hidden input field like this: $html .= '<input type="hidden" id="_post_token" name="' . $tokenName . '" value="' . $tokenValue . '"/>'; Now this will generate something that will look like this: You are done on the form side. You can now go to the part where you are receiving the post. Then use: $session->CSRF->validate(); This will return true (1) on a valid request and an exception on a bad request. You can test this out to open up your Firebug/Chrome debug console and change the value of the textbox to something else. Basicly what this does is set a session variable with a name (getTokenName) and gives it a hashed value. If a request has a token in it it has to have the same value or it is not send from the correct form. Well I hope I helped someone.1 point
-
So this is basically a recreation of a menu tutorial from W3Bits, tweaked to include the Advanced checkbox hack. Demo. Even the Advanced hack itself was tweaked: apparently this bit is causing issues with Safari, so I removed it: @-webkit-keyframes bugfix { from {padding:0;} to {padding:0;} }I found this particular configuration to work quite nicely. A previous menu I tried had a problem with the menu items staying expanded between media query breakpoints, when resizing the browser. Below is the CSS for the menu. You will notice that it is mobile-first: /* Menu from http://w3bits.com/css-responsive-nav-menu/ */ /* Note: the tutorial code is slightly different from the demo code */ .cf:after { /* micro clearfix */ content: ""; display: table; clear: both; } body { -webkit-animation: bugfix infinite 1s; } #mainMenu { margin-bottom: 2em; } #mainMenu ul { margin: 0; padding: 0; } #mainMenu .main-menu { display: none; } #tm:checked + .main-menu { display: block; } #mainMenu input[type="checkbox"], #mainMenu ul span.drop-icon { display: none; } #mainMenu li, #toggle-menu, #mainMenu .sub-menu { border-style: solid; border-color: rgba(0, 0, 0, .05); } #mainMenu li, #toggle-menu { border-width: 0 0 1px; } #mainMenu .sub-menu { background-color: #444; border-width: 1px 1px 0; margin: 0 1em; } #mainMenu .sub-menu li:last-child { border-width: 0; } #mainMenu li, #toggle-menu, #mainMenu a { position: relative; display: block; color: white; text-shadow: 1px 1px 0 rgba(0, 0, 0, .125); } #mainMenu, #toggle-menu { background-color: #09c; } #toggle-menu, #mainMenu a { padding: 1em 1.5em; } #mainMenu a { transition: all .125s ease-in-out; -webkit-transition: all .125s ease-in-out; } #mainMenu a:hover { background-color: white; color: #09c; } #mainMenu .sub-menu { display: none; } #mainMenu input[type="checkbox"]:checked + .sub-menu { display: block; } #mainMenu .sub-menu a:hover { color: #444; } #toggle-menu .drop-icon, #mainMenu li label.drop-icon { position: absolute; right: 0; top: 0; } #mainMenu label.drop-icon, #toggle-menu span.drop-icon { padding: 1em; font-size: 1em; text-align: center; background-color: rgba(0, 0, 0, .125); text-shadow: 0 0 0 transparent; color: rgba(255, 255, 255, .75); } label { cursor: pointer; user-select: none; } @media only screen and (max-width: 64em) and (min-width: 52.01em) { #mainMenu li { width: 33.333%; } #mainMenu .sub-menu li { width: auto; } } @media only screen and (min-width: 52em) { #mainMenu .main-menu { display: block; } #toggle-menu, #mainMenu label.drop-icon { display: none; } #mainMenu ul span.drop-icon { display: inline-block; } #mainMenu li { float: left; border-width: 0 1px 0 0; } #mainMenu .sub-menu li { float: none; } #mainMenu .sub-menu { border-width: 0; margin: 0; position: absolute; top: 100%; left: 0; width: 12em; z-index: 3000; } #mainMenu .sub-menu, #mainMenu input[type="checkbox"]:checked + .sub-menu { display: none; } #mainMenu .sub-menu li { border-width: 0 0 1px; } #mainMenu .sub-menu .sub-menu { top: 0; left: 100%; } #mainMenu li:hover > input[type="checkbox"] + .sub-menu { display: block; } }Below is the markup outputted using mindplay.dk's method. I found it impossible to output with MarkupSimpleNavigation or MenuBuilder. The homepage is added as the first top-level item. Notice the onclicks that make it work on iOS < 6.0. The clearfix class cf for the top ul is important. Otherwise the element will have no height (got bitten by this..). <nav id="mainMenu"> <label for='tm' id='toggle-menu' onclick>Navigation <span class='drop-icon'>▼</span></label> <input id='tm' type='checkbox'> <ul class='main-menu cf'> <?php /** * Recursive traverse and visit every child in a sub-tree of Pages. * * @param Page $parent root Page from which to traverse * @param callable $enter function to call upon visiting a child Page * @param callable|null $exit function to call after visiting a child Page (and all of it's children) * * From mindplay.dk */ echo '<li><a href="' . $pages->get(1)->url . '">Home</a></li>'; function visit(Page $parent, $enter, $exit=null) { foreach ($parent->children() as $child) { call_user_func($enter, $child); if ($child->numChildren > 0) { visit($child, $enter, $exit); } if ($exit) { call_user_func($exit, $child); } } } visit( $pages->get(1) , function(Page $page) { echo '<li><a href="' . $page->url . '">' . $page->title; if ($page->numChildren > 0) { echo '<span class="drop-icon">▼</span> <label title="Toggle Drop-down" class="drop-icon" for="' . $page->name . '" onclick>▼</label> </a> <input type="checkbox" id="' . $page->name . '"><ul class="sub-menu">'; } else { echo '</a>'; } } , function(Page $page) { if ($page->numChildren > 0) { echo '</ul>'; } echo '</li>'; } ); ?> </ul> </nav>Edit: fixed the end part, thanks er314.1 point
-
What it measures is "user time used" (that is what PHP's "getrusage" function returns). We grab the amount of user time on page init() and the again when everything has finished loading and average the usage across this time period. So I guess the short answer is "Average".1 point
-
For those icons cstevensjr marked "Fantastic!", I would change the hover state, for example scaling up the icons. The current solution seems more like a bug. #someID a { transition: transform 0.12s; } #someID a:hover svg { transform: scale(1.4); } I guess you got the idea.1 point
-
In the "Custom PHP Code" snippet there are $page and $pages as local variables, but as the code is evaled in the module itself you can access all other api variables by using the class specific "syntax" like $this->templates or $this->fields.1 point
-
If you can't get that to work, you could try adding a dedicated field to the content tab and adding a save hook to take it's value, sanitize it as a page name and then use it to populate the page name. I am also curious as to your reasoning for this - if it's to make it easier for editors to remember to update it, then maybe you should just install https://processwire.com/talk/topic/7724-page-rename-options/ - even if it's only installed during development of the site, and then uninstalled once live to protect URLs from changing automatically?1 point
-
If you pull develop again, it's now possible1 point
-
This looks so great! Thanks Ryan! Are there any plans to support Repeaters and PageTable (if possible)? I use these quite extensive for building pages with different content blocks. Sometimes i even don't have a textarea directly in my page template, only in a PageTable block. Thanks!1 point
-
This should IMHO be filed as a bug. The problem here is that Pagefiles::cleanBasename doesn't account for this kind of URLs without a trailing filename. It simply splits the string at the last dot in the URL when it should only look for dots after the last path separator (and perhaps also account for a reasonable maximum extension length, but that's another thing). This is the relevant code: $dot = strrpos($basename, '.'); $ext = $dot ? substr($basename, $dot) : ''; It should (untested) be sufficient to change it to: $slash = strrpos($basename, '/'); $dot = strrpos($basename, '.', $slash); $ext = $dot ? substr($basename, $dot) : ''; if(strlen($ext) > 10) $ext = substr($ext, 0, 10); // Not sure what a reasonable default would be here1 point
-
How many entries do you have for both fields? Maybe some jquery is easier than ajax..1 point
-
1 point
-
@steevooo If it is just about storing local configurations you can also use config-dev.php in your sites folder and put this file in the .gitignore https://processwire.com/api/variables/config/1 point
-
@Ivan Gretsky: In most cases I use a little capistrano script to deploy my projects. There is a release folder which keeps the latest five (for example, configurable) releases. The latest release is a symlink to a folder named current. Furthermore there is a shared folder, which keeps environment specific stuff like configs, files, caches, logs. These folders and files are also symlinks. I don't have to create the symlinks manually, capistrano does this for me. ls -lah current -> /var/www/project/releases/20160222114746 releases shared ls -lah current/pulic/site/assets active.php cache -> /var/www/project/shared/public/site/assets/cache files -> /var/www/project/shared/public/site/assets/files index.php logs -> /var/www/project/shared/public/site/assets/logs sessions -> /var/www/project/shared/public/site/assets/sessions Pretty much all of my projects are running on a nginx server. So I can't help / compare with my .htaccess / vhosts config, because I don't use them1 point
-
Heythere, to run the XML sitemap module from pete you'll have to add 3 more lines to your config: location = /sitemap.xml { try_files $uri $uri/ /index.php?it=$uri&$args; } Otherwise you'll get an 404 error. Cheers from austria!1 point
-
bad weather, lot of time... here you find the german lang pack for PW devns https://github.com/Manfred62/pw-lang-de-devns1 point
-
Using Hashids you can accept encrypted page IDs in a querystring, decode them for use in selectors. Why would you want to do this? In my case I have a private calendar feed where each calendar is a page, but i don't want people seeing the page IDs and then possibly guessing another person's calendar id. 1.) include the hashids class, either with the composer or in my case i'm using the old version which is 1 php file (you can find this in the wordpress plugin version). 2.) Depending on which version you use, the method is different; read the docs to see which version you need; my code is relevant to the old 0.1.3 version which is good enough for this application. include('./classes/hashids.php'); $hashids = new hashids('your_unique_salt_here'); if($input->get->cal_id) { // the cal id coming in is a text hash ID: $cal_id = $sanitizer->text($input->get->cal_id); // decrypt the hash ID to the integer $cal_id = $hashids->decrypt($cal_id); // Look up the calendar: $calendar = $pages->get($cal_id[0]); if( !$calendar->id ) exit('Calendar not found.'); // at this point you would execute your actions, e.g. render your calendar feed etc.. exit(); } You would also need a way to generate your links wherever you are sending or displaying them, with the hashed ID. $calId = $hashids->encrypt($calendar->id);1 point
-
First of all, thanks for sharing this. Hash ID's have their benefits, and your method is a nice example of getting started the easy way A hashed ID is essentially password authentication, though without the need to type in a username. For use cases that require more security, one should consider not using this method alone, but, for an example, combining it with another GET param (which would be a username, constant API key, or something similar) and perhaps making the salt unique on a per-user / per-calendar basis. Additionally detecting multiple attempts for different ID's from one client and issuing a cooldown period (a ban) automatically would make sense, to prevent malicious attempts to gain access to calendars, which might contain very private data. Just my five cents1 point
-
i can verify that the "users" template doesn't work the same way as regular templates: i have a "student" role when i put "roles=student" as the custom selector, the field seems to work perfectly: it shows all users with the "student" role, and shows nobody else however, when i'm trying to save the page, i get this message: Error saving field "student" - Page 1017 is not valid for student if i use custom php (when of course i can't use autocomplete) it works perfectly with all of these: return wire("users")->find("roles=student"); return wire("pages")->find("roles=student"); return $pages->find("roles=student"); // which, incidentally, is the same that the custom selector is supposed to resolve in short, it must be something about the custom selector validation code; if i find some time i'll look some more into it1 point
-
Ryan, have you thought about making the store something that module authors can publish their commercial modules at? You then take 10% or so. This would make it the goto-store for commercial modules, and authors would not have to come up with custom solutions selling their modules.1 point
-
1 point
-
Hi Michael, I have not seen any fields like that, but as an alternative you could try using a "page" type field. It would create a new page for each tag, but has a nice friendly interface for the user to manage them. 1. Add a new page in your tree called "Tags Collection", and make it hidden. 2. Create a new field called Tags and make it a "page" type. 3. On the input field settings, make the "Parent of selectable page(s)" the Tags Collection page 4. For the "Input field type" try one of : Select Multiple, asmSelect or PageListSelectMultiple (I prefer the asmSelect) 5. Check the “Allow new pages to be created from field?” to allow the user to easily add new tags directly from the field1 point
-
I had some time at hand and nothing else to do, so I went ahead and translated some more. All 70 language files translateable as of PW 2.2.2, to be exact. Someone please double-check these. I'm sure they're far from perfect, and I'll gladly accept any suggestions for better translations or hints to typos. I'll also continue to refine some of the translations, but after this little bulk translation marathon, I need a break. I also put them in a GitHub repo: https://github.com/y...wled/pw-lang-de1 point