Leaderboard
Popular Content
Showing content with the highest reputation on 02/24/2015 in all areas
-
I wouldn't find anything wrong with a link or button linking to a donation page. In fact I encourage it if it keeps you producing modules to enhance PW. In fact, the latest dev branch that has the imaging cropping tools made me want to donate something to Ryan.2 points
-
Wish that wasn't necessary, but adding support for some of the "more advanced" features (like binary file versioning) to pre-2.4 PW just didn't seem feasible. Hooks that these features require aren't there, etc. All in all I just felt it was better to leave this module as-is (in case someone stuck with pre-2.4 PW needs limited version control features), fork it as a new VersionControl module for later PW versions, and get on with it2 points
-
Almost done; mainly waiting for an answer about this: https://processwire.com/talk/topic/7870-asmselect-pagefield-modify-selected-options-order-in-select-dropdown/?p=886092 points
-
This error means, that there is somewhere some field, which has two entries with the same id, but the id should be unique. In your case this id is "41-0". FieldtypeMulti means it has to be a multi value field. In my cases it's mostly the fault of some custom module, but could be anything else, too.2 points
-
Well if you use the Page Auto Name module and put "id" in the Pattern field, you'll see that it successfully renames the page to the ID of page, so you could use that, or you could make use of the same hook they use, which is: before Page::save - https://github.com/conclurer/PageAutoName/blob/master/PageAutoName.module#L114 but you could also use saveReady, like mr-fan describes above. Page creation in PW is normally a two step process - first create the title and save - this automatically generates the name and id, and then you add other field content, and/or simply publish or save as unpublished. You need that initial save to have the id generated.2 points
-
Try this: $gallery = $page->f_multi_image; foreach($gallery as $image){ echo "<img src='{$image->getCrop('gallery')->url}' alt='{$image->description}' />"; }2 points
-
or you use simply this little snippet in your admin.php: <?php //ignore /** * change page name on publishing a post and add the created date to the name */ $pages->addHook('saveReady', null, 'buildUrl'); function buildUrl(HookEvent $event) { $page = $event->arguments[0]; if($page->template != 'aktiv') return; //for this template only if($page->id && $page->isChanged('status') && !$page->is(Page::statusUnpublished)) { $result = wire('db')->query("SELECT status FROM pages WHERE id={$page->id}"); list($status) = $result->fetch_row(); if($status & Page::statusUnpublished) { // page is about to be published $dateCreated = date("Y-m-d", $page->created); $page->name = $page->title."-".$dateCreated; $page->message($page->created . $page->name); } } } it changes the url only until the page is published...i use this with the awesome module from adrian: http://modules.processwire.com/modules/page-rename-options/ so user could 1. setup a page change the title == changes the name until he publish the page 2. snippet run and change the output that is needed....finish pageurl is protected and stays forever and ever.... ....the modules mentioned are good as well...but i like more and more the power of a few lines of code in PW regards mr-fan2 points
-
Menu Builder As of 29 December 2017 ProcessWire versions earlier than 3.x are not supported Modules Directory Project Page Read Me (How to install, use, etc..) For highly customisable menus, please see this post. If you want a navigation that mirrors your ProcessWire page tree, the system allows you to easily create recursive menus using either vanilla PHP or Soma's great MarkupSimpleNavigation. In some cases, however, you may wish to create menus that: 1. Do not mirror you site's page tree (hirarchies and ancestry); and 2. You can add custom links (external to your site) to. That is primarily where Menu Builder comes in. It is also helpful if you: 3. Prefer creating menus via drag and drop 4. Have a need for menus (or other listings) that will be changing regularly or that you want to allow your admin users to edit. The issue of custom menus is not new here in the forums. The difference is that this module allows you to easily create such menus via drag and drop in the Admin. Actually, you can even use it to just create some list if you wanted to. In the backend, the module uses the jQueryUI plugin nestedSortable by Manuele J Sarfatti for the drag and drop and is inspired in part by the WP Custom Menu feature. Please read the Read Me completely before using this module. For Complex or highly-customised menus, it is recommended to use the getMenuItems() method as detailed in this post. Features Ability to create menus that do not mirror your ProcessWire Page Tree hierarchy/structure Menus can contain both ProcessWire pages and custom links Create menu hierarchies and nesting via drag and drop Easily add CSS IDs and Classes to each menu item on creating the menu items (both custom and from ProcessWire pages) or post creation. Optionally set custom links to open in a new tab Change menu item titles built from ProcessWire pages (without affecting the original page). E.g. if you have a page titled 'About Us' but you want the menu item title to be 'About' Readily view the structure and settings for each menu item Menus stored as pages (note: just the menu, not the items!) Menu items stored as JSON in a field in the menu pages (empty values not stored) Add menu items from ProcessWire pages using page fields (option to choose between PageAutocomplete and AsmSelect [default]) or a Selector (e.g. template=basic-page, limit=20, sort=title). For page fields, you can specify a selector to return only those specified pages for selection in the page field (i.e. asm and autocomplete) For superusers, optionally allow markup in your menu titles, e.g. <span>About</span> Menu settings for nestedSortable - e.g. maxLevels (limit nesting levels) Advanced features (e.g. add pages via selector, menu settings) currently permissible to superadmins only (may change to be permission-based) Delete single or all menu items without deleting the menu itself Lock down menus for editing Highly configurable MarkupMenuBuilder - e.g. can pass menu id, title, name or array to render(); Passing an array means you can conditionally manipulate it before rendering, e.g. make certain menu branches visible only to certain users [the code is up to you!] Optionally grab menu items only (as a Menu object WireArray or a normal array) and use your own code to create custom highly complex menus to meet any need. More... In the backend, ProcessMenuBuilder does the menu creation. For the frontend, menus are displayed using MarkupMenuBuilder. Credits In this module's infancy (way back!), I wanted to know more about ProcessWire modules as well as improve my PHP skills. As they say, what better way to learn than to actually create something? So, I developed this module (instead of writing PW tutorials as promised, tsk, tsk, naughty, naughty!) in my own summer of code . Props to Wanze, Soma, Pete, Antti and Ryan whose modules I studied (read copied ) to help in my module development and to Teppo for his wonderful write-up on the "Anatomy of fields in ProcessWire" that vastly improved my knowledge and understanding of how PW works. Diogo and marcus for idea about using pages (rather than a custom db table), onjegolders for his helpful UI comments, Martijn Geerts, OrganizedFellow, dazzyweb and Mike Anthony for 'pushing me' to complete this module and netcarver for help with the code. Screens1 point
-
Hi @icreation, thanks for dropping in all relevant things: original image, scaled image variation and issue description. But, however, I have no good message for you. The GD-Image-Library that is shipped with PHP for image handling cannot handle smooth transients from opaque to transparent. Also if the image looks like it would only have hard cuts between full color and full transparent areas, it isn't that way. Have a look to my screenshots to understand what I try to say (as a none native english speaker / writer). Especially look at the red dot from the colorpicker and the values for RGB in the info palette: here it shows the values for blue (46, 172, 250) . here in the transparent area it shows nothing . but here, almost 4-5 pixel away from the color area, it shows the exact RGB values like in the blue area (46, 172, 250). Obviously this area has a transparency from nearly 100%, but only nearly. In fact it has only 98 - 99% transparency what let the GD-Library struggle with it. --- I don't know how comfortable your client are with image manipulation in regard of understanding this. The graphics look professional though. If they could try to cut them without that smooth area maybe it will be better. Or you / they could try to export the graphics to GIF instead of PNG. Additionally to that you can tweak the imageSizerOptions for those images to render with these values: $options = array( 'defaultGamma' = -1, 'sharpening' = 'none' ); $image = $image->size($width, $height, $options); Hope that helps a bit.1 point
-
1 point
-
@alan Yeah, agreed, SSH is nice and works well in an ideal world. It is the way to go if it's an option. However, many clients are using shared hosting so SSH is not an option. For these sites storing passwords in plain text files is not great. I can't understand why programs with massive uptake like filezilla still do this, it's a major negative IMO. I would definitely recommend anyone using filezilla check out winscp.1 point
-
+1 that muzzer (plain text passwords). But then I finally understood and began doing SSH connection by certificate not password. I believe this is generally thought by security people to be the safer option (by some large degree). Then ST3 (and other stuff like Terminal and Transmit.app) work like magic - you don't need to enter a password and it connects! When I got it working I was grinning ear to ear. This means your site config files in ST3 for SFTP no longer state any password at all and connection works automatically. Safe. This is one of the web pages that I read en-route to finally understanding how to do this passwordless connection, in case it helps.1 point
-
ST3 and sFTP plugin is nice but one thing I don't like (and reason I no longer use that plugin) is that it stores passwords in plaintext files. If your computer gets compromised the all your sites are open slather. I've been hurt by this before using filezilla (also stores passwords unencrypted). I now use winSCP with an encrypted masterpassword, seems to work nice. Just my 2 cents....1 point
-
This module provides simplified (no fancy diff etc. features available, at least yet) version control for text type fields. Originally introduced in another post as a proof of concept, I'm now considering it stable enough to deserve a thread of it's own here. Just so that you know: I've tested this module in multiple ProcessWire installations, three or four different versions in total running on two different platforms, but it still hasn't seen too much real world use. Any information you folks can provide me about how well (or badly) it worked (or didn't work) for you would be considered extremely helpful! So, what does it do? When editing pages, fields with old revisions available show up with a new icon in their header bars. By hovering that icon you get a list of available revisions and by clicking any one of those the value of that particular field is reverted to that revision. No changes are made to page until you choose a revision and save the page, which means that you can keep switching between revisions to get an idea what's really changed without inadvertently causing any content to change. How does it work? Behind the scenes hooks provided by ProcessWire are utilized to catch page edits. If text fields (such as FieldtypeText, FieldtypeTextarea etc.) selected at module configuration to be tracked were changed, their values (along with some metadata) are saved to two custom database tables. See attached screenshots for better idea about how this thing works. Please note that before you've selected at least one template + field combination to be tracked via module settings nothing will be saved to database! Getting started Module is available at GitHub: https://github.com/teppokoivula/VersionControlForTextFields. Here's a direct download link if that's what you prefer. Installation instructions etc. are available at README.md. If you've got any questions, feel free to post them here or PM me!1 point
-
Alternative for Process Dashboard is the AdminCustomPages module... http://modules.processwire.com/modules/process-admin-custom-pages/ with this one you could assign a normal php template to a backend page and do what you want without creating a processmodule...so you could easy use something like this example: https://processwire.com/talk/topic/9136-preconfigured-lister-in-custom-admin-page/#entry88364 to get some content or use other options to get pages by role via api and save them. regards mr-fan1 point
-
Ditto @onjegolders—I remember when I re-re-returned to try Sublime Text 2 and finally got past the "what's all the fuss about?" negative reaction and realized how wonderful it is. ST3 (the ver I am on now) plus that fab SFTP plugin (plus a few other fab plugins (of which there are lots)) is the best editing+transmit experience I have ever had. I still use Transmit for times when I want to visualize what I am doing (weird drag/drops of config files etc) but almost all my SFTP traffic is now handled inside Sublime Text with this plugin. While a post about what plugins are good could go on for ages one I must just note quickly is called Project Manager. It makes the popup list of Projects work brilliantly. OK, will stop swooning over Sublime Text and get back to my accounts :/1 point
-
Just started using this because the Transmit plugin doesn't support ST3. Despite initially being put off by all the techy options, it's very powerful. I can sync local with remote, pull down remote files and edit them. It even has filediff capability. Consider me impressed.1 point
-
Hi Steve, Would you be able to share some code how you went about this? Thanks. I am trying to add extra html inputs to the <span></span> that wrap selected asmSelect values. However, not sure this would work in an asmSelect that is called as an input in a Process Module? Have never really understood Hooks comprehensively... Edit Or maybe I should just extend the InputfieldAsmSelectmodule and use my modified jquery.asmselect.js...Any other ideas welcome, thanks.. Edit 2: No, I think hooking into the Class is better/cleaner in this instance..1 point
-
YES! I fixed it On the course-page, where I set the cookie, and the session variable in the first case, I linked to the subscription page where in turn I wanted to call the cookie. I figured out that on pretty much all the pages within the site Chrome kept the cookie alive, except for the subscription page. I saw al links inside my site ended with a slash, checked the code and saw that the link I made didn't end with the slash. Also, very weird but I didn't add a domain to the cookie creation, and the course page created a www.domain.com instance while the subscribe page seemed to be looking for a .domain.com instance, adding a domain to the cookie fixed this as well. I added it and now chrome keeps the cookie alive Pretty weird that this make so much difference, and that Firefox and Safari don't take the trailing slash into account1 point
-
This topic about teams and players (with history) also might be interesting to you BernhardB.1 point
-
As explained here in some detail, Version Control is the improved and extended successor to Version Control For Text Fields.1 point
-
If you're cloning the team and player pages to be archived, these maybe get cloned to a subtree /2014/… . The problem is, the team pages' pagefields do still point to the original player pages, as the field just saves the id. So you'd need to have some way to also change the pagefields to point to their newly cloned playerpages. Something like this. // $page = teampage foreach($page->players as $player){ $page->players->remove($player); // Get the same player but the archived one. $archived_player = $pages->get("name=$player->name, has_parent=$page->parent"); $page->players->add($archived_player); } $page->of(false); $page->save("players"); If you're comfortable with building small modules I would even suggest just packing all the logic in a Process module, where you just choose the year to be archived and press a button and everything is getting moved and changed automatically. It would at least be more fail save, than doing it by hand somehow.1 point
-
Check if your new database is really consistent with your old one. You should migrate database tables only. Write permissions are ok ? Make sure that the files/folders in the assets folder are writable. What about your root .htaccess file, rewrite base, etc. ? You can find classical migration problems solved many times before in the forum. https://processwire.com/talk/topic/4199-exporting-importing-database-error-access-denied-for-user-user-namelocalhost-to-database-database-name/ https://processwire.com/talk/topic/3113-how-to-transfer-processwire-from-local-installation-to-online/ https://processwire.com/talk/topic/8792-403-forbidden-when-saving-homepage/ https://processwire.com/talk/topic/1211-impossible-to-login-after-migration/1 point
-
@Fokke Thank you! Great post. I was looking in all the wrong places until I read your post.1 point
-
OK, we are on. I have resumed work on this and taken a newish approach. Hope to post something by end of play tomorrow...1 point
-
One more: Loop pages in ProcessWire without building a $pageArray. This is useful for when a find() would return too many results to keep in memory. $selector = "template=pages_template"; // as an example while (1) { $p = wire('pages')->get("{$selector}, id>$id"); // get page with id bigger than previous if(!$id = $p->id) break; // assign current page's id to $id or break the loop if it doesn't exist // do stuff using $p as the current page wire('pages')->uncacheAll(); }; This served me well when I had to modify thousands of pages in one go. Works great with bootstrapping from the terminal because it doesn't affect the viewing of the website.1 point
-
@dazzyweb, I just saw your discussion, sorry about that! Well, instead of adding the feature natively, we could just as well have a link in the top-left menu where documentation/support links are. Leave it up to the dev to create his own donation process if they want.. I think that'd be plenty!1 point
-
@Macrura: I like your suggestion so updated the module with an option to use SORT_NATURAL on the options of the select. // Natural Sort (NOT checked) image_1.jpg image_12.jpg image_21.jpg image_4.jpg // Natural Sort (checked) image_1.jpg image_4.jpg image_12.jpg image_21.jpg1 point
-
ok, whoever uses this and wants to test drive the purging module, here it is: https://github.com/gurkendoktor/processwire_purge_fcgi_cache in branch develop Just install it and you're good to go. I will prepare a README later. Looking forward to feedback or if it makes any sense for anyone except me. Known issues: * You will see errors if the page has not been cached yet * You will see errors if no page at all has been cached * The UI is still a bit of a mess1 point
-
1 point
-
There is also a plugin for sublime text http://wbond.net/sublime_packages/sftp1 point
-
Thanks Arjen! This is the sort of stuff that PW was designed for, and I think is also the most fun stuff to develop with it. There is almost always a way around any pitfalls. Please keep us up to date with how your projects go and with any questions you run into along the way.1 point