Leaderboard
Popular Content
Showing content with the highest reputation on 04/01/2015 in all areas
-
1. Make a module like this: https://processwire-recipes.com/recipes/extending-page-save-process/ 2. Use this to move pages: $level_nesting = count($page->parents); if($level_nesting > 1 && $level_nesting > $deepest_nesting){ // $deepest_nesting should be 2 in your case // Move the page one level higher // -2 because of eq counting from 0 and moving one level up $page->parent = $page->parents->eq($level_nesting - 2); } 3. Make this aware of users / roles or whatever you need. 4. (opt.) Leave a notice for the user about what has been done. Edit: small improvement by adding "$level_nesting > 1" Edit 2: Use only the family settings for templates as long as you don't need nesting of the same template.3 points
-
wireshell 1.0.0 is out See Bea's post -------- Original post ----------- Now this one could be a rather long post about only an experimental niche tool, but maybe a helpful one for some, so stay with me Intention Do you guys know "Artisan" (Laravel) or "Drush" (Drupal)? If not: These are command line companions for said systems, and very useful for running certain (e.g. maintenance, installation) task quickly - without having to use the Admin Interface, first and foremost when dealing with local ProcessWire installations. And since it has a powerful API and an easy way of being bootstrapped into CLIs like this, I think such a tool has a certain potential in the PW universe. It's totally not the first approach of this kind. But: this one should be easily extendable - and is based on PHP (specifically: the Console component of the Symfony Framework). Every command is tidily wrapped in its own class, dependencies are clearly visible, and so on. ( Here was the outdated documentation. Please visit wireshell.pw for the current one )2 points
-
Version Bump to 1.1.2 Correct page-check behaviour (was using name, now using URI) Use commitJumplink in CSV importer No schema changes2 points
-
Hi pwFoo, Check the section "Do I want my hook to apply to all instances of a class, or just one?" here https://processwire.com/api/hooks/ It's possible to attach hooks to "single" objects.2 points
-
Hi marc1n, I'm not sure what you mean by that... Where are you importing data from? And what warnings are you getting? Edit: An import will only save page IDs if you're importing from ProcessRedirects. If you're importing from CSV, then it won't. Perhaps I should add that functionality in? So if a destination URI matches an existing page, we should set it to use the ID instead... Is that what you're referring to?2 points
-
2 points
-
OnTopic: Stunning site and great designs. You're very talented. Great to have you here! On SPAs: We also did a "single page Website" with transitions recently (going to make a post on this somewhen in the near future). The transitions are based on a codrops experiment. For the URL-part we used History.js, every page is a "real" page but only renders it's content if it's loaded via ajax. This way even users without JS can view every page. I think this is the "cleanest" way to do "SPAs".2 points
-
Here is my proposal. The HTML is in attachments. There are multiple ways how to install the module. Installing from directory (recommended) -------------------------------------- If the module is uploaded in the official *ProcessWire Modules/Plugins Directory* (http://modules.processwire.com), you can use this method. 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Go to the *New* tab and expand the *Add Module From Directory* section. 3. Enter the *Module Class Name* (can be found in the module's detail page, e.g. FieldtypeMapMarker). 4. Click the *Download and Install* button. Installing from URL ------------------- If the module is not in the official *ProcessWire Modules/Plugins Directory* (http://modules.processwire.com), but the module ZIP is accessible from URL, use this method. 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Go to the *New* tab and expand the *Add Module From URL* section. 3. Enter the *Module ZIP file URL* (can be found in the module's detail page, e.g. https://github.com/ryancramerdesign/FieldtypeMapMarker/archive/master.zip). 4. Click the *Download* button. 5. The downloaded modules are now listed on top of the page. Click the install button next to any of the new modules that you want to install. Installing from upload ---------------------- If the module ZIP file is not accessible from web or you have it already downloaded, you can upload the file. 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Go to the *New* tab and expand the *Add Module From Upload* section. 3. Select the *Module ZIP file*. 4. Click the *Upload* button. 5. The uploaded modules are now listed on top of the page. Click the install button next to any of the new modules that you want to install. Installing manually ------------------- If any of the above methods isn't suitable for you, you can install the module manually. 1. Place the .module file in your /site/modules/ directory. If the module contains more than one file (like supporting .css or .js files for example), it should be created in it's own directory under /site/modules/ with the same name as the module (.module file). For instance, the FieldtypeMapMarker module and supporting files should be placed in /site/modules/FieldtypeMapMarker/. 2. Log in to your ProcessWire admin and go to the *Modules* page. 3. Click the *Check for New Modules* button. 4. New modules are now listed on top of the page. Click the install button next to any of the new modules that you want to install. *Note: All third party modules should be placed in /site/modules/. You might also notice that ProcessWire keeps core modules in /wire/modules/ – You should avoid installing your modules there, as that location is reserved for core modules.* How to uninstall a module ------------------------- 1. Log in to your ProcessWire admin and go to the *Modules* page. 2. Find and click the module name that you want to uninstall. 3. Expand the *Uninstall* section, check the checkbox. 4. Click the *Submit* button. 5. It is now safe to remove the module's files from /site/modules/ if you want to. how-to-install.html2 points
-
I have set up a new repo in GitHub with german translation files for ProcessWire modules. https://github.com/Manfred62/pw-modules-lang-de This is a small collection of module translations. Most translations are only "nice to have", because they are for admin use only. Some modules for the use of user/clients or output on frontend are more important to be translated. If someone has translated (german) other modules and like to share them in a central place, post the files here the forum. Then I will upload it to the repo. Afterwards it will be easier to keep them up to date (via forks and pr's). List of translated modules: BatchChildEditor (by mr-fan) CroppableImage DynamicRoles FieldtypeCropImage (Thumbnails) LanguageInstantInstall ImageExtra MarkupWeather (by mr-fan) MarkupYahooWeather ModulesManager ProcessBlog (by mr-fan) ProcessDiagnostics ProcessWireUpgrade RestrictTabView SchedulePages (by mr-fan)2 points
-
Just checked in a first beta version of a new module I'm working on. Feel free to test out and see what's up with it. Pollino (beta) A simple poll module for ProcessWire This module makes it simple to setup polls for your website. It is based on a simple page setup to create the polls. So each poll is a page, and its children are the answers. Pollino will create the templates and a PollinoPolls page in the root to start with. You can add fields to the templates as you wish and later use hooks to modify the output of the poll. This can be useful, for example, to use images as options or just some custom markup etc. It provides some API to render the poll form and the result. These methods are hookable and it's easy to customize the output if needed. It can be rendered on any page and even multiple on the same page. Pollino takes care of saving the votes and preventing multiple votes. It comes with some configuration settings to choose what method to use to prevent from multiple votings: using cookie and an expire time or by IP and optionally also the UserAgent with and expire time or by logged in User Pollino isn't 100% plug'n'play but it provides a solid foundation and comes with some premade theme and output for you to start. It takes care of the boring stuff and lets you concentrate on the front-end stuff and styling. That's what matters after all. It does support multilanguage, as all strings are translatable in the module. Also since it's using simple pages and templates you're free to add or change fields to make its output multilanguage without much hassle. ----- Read more and download https://github.com/somatonic/Pollino Online Demo I setup a little demo here to see using https://lightning.pw http://titanium-x77.lightningpw.com/ Have fun.1 point
-
Just wanted to share a simple bash script I've been using lately to make installing ProcessWire a little faster. Feel free to modify it to your taste! Just copy everything into a simple text file, I call mine "preparepw". Optionally, set this file to executable (chmod -x preparepw) and put it somewhere into your path to be able to load it as a regular command without the need to call it from sh ~/preparepw for example. To run, first cd to where you want to install PW's root, e.g. /sites/mysite/ then call the script. It will create a /sites/mysite/wwwroot/ directory containing all of PW's files from current master, set the required permissions and rename htaccess. It has an option to set the directory that, when unset, will default back to ./wwwroot. (e.g. preparepw public would install PW in ./public/). #!/bin/bash # Version 2.0 INPUT=$1 if [[ -z $INPUT ]]; then INPUT="wwwroot" printf "Directory option not set, installing into ./$INPUT/...\n" else printf "Installing in to ./$INPUT/...\n" fi # Select a version printf "\nWhich ProcessWire branch do you want to install?\n" options=("master" "dev" "devns") select BRANCH in "${options[@]}"; do test -n "$BRANCH" && break; echo ">>> Invalid selection, please try again"; done printf "\nDownloading ProcessWire $BRANCH branch, please hold on...\n" # Get ProcessWire master and prepare files if [ "$BRANCH" == "master" ]; then curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/master.zip -# -L fi if [ "$BRANCH" == "dev" ]; then curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/dev.zip -# -L fi if [ "$BRANCH" == "devns" ]; then curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/devns.zip -# -L fi unzip -q processwire.zip rm processwire.zip if [ "$BRANCH" == "master" ]; then mv ProcessWire-master $INPUT fi if [ "$BRANCH" == "dev" ]; then mv ProcessWire-dev $INPUT fi if [ "$BRANCH" == "devns" ]; then mv ProcessWire-devns $INPUT fi chmod -R u+rwX,go+rX,go-w $INPUT mv $INPUT/htaccess.txt $INPUT/.htaccess cd $INPUT # Prompt for site profile printf "\nWhich site profile will you be using?\n" select d in site-*/; do test -n "$d" && break; echo ">>> Invalid selection, please try again"; done mv $d site/ rm -rf site-*/ # Set permissions chmod 777 site/assets chmod 777 site/modules chmod 666 site/config.php printf "\n" read -p "Press [Enter] once you've finished the installation process to remove the install files..." rm install.php rm -rf site/install printf "\nInstallation files removed.\n" printf "\nDirectory \"$INPUT\" all set for ProcessWire. Have fun! \n"1 point
-
Does it make any difference in your frontend if you try this: $menu_pages = $settings->main_menu_pages->sort("sort");1 point
-
1 point
-
Thanks Martijn - not sure why I was using insertAfter there - just matching where it would be if it was visible, but since it's hidden it doesn't matter. I have committed a fix. Also just so everyone knows, I will get to all your suggestions for making this more configurable - just waiting on Ryan's thoughts on some of those issues regarding a core fix or not.1 point
-
Hi Adrian, found a little issue on line 111. When the page has no title, a fatal error is thrown, Never the less, thanks lot the module.1 point
-
I don't know what exactly you mean by "current" but you can add methods to each class: http://processwire.com/api/hooks/#add_new_method Maybe you can just use a parameter to determine what should be executed. Edit: Thinking a little more about this. What about this. function myHookFunction($event){ if($event->object->name !== "YOUR_FIELD") return; }1 point
-
@adrian I've had an opportunity to try out the updated module with a repeater containing a table field. It works!1 point
-
thanks for the update (MarkupWeather). Will wait until Nikola is ready. BTW: there's an error in your pr (german string inside): instead of: $out .= "<div class='location'><h3>Aktuelles Wetter in... must be: $out .= "<div class='location'><h3>" . $location[0]['city'] . "</h3>...1 point
-
One thing to keep in mind, I believe there can be some differences (where sorting is involved) between MariaDB and MySQL.1 point
-
So problem solved the Module gets a PR on github and here i put the complete de_DE language file for the module...now Backend translated, too. regards mr-fansite--modules--markupweather--markupweather-module.zip1 point
-
While look deeper and deeper inside Processwire and hooks I'll have a new reduced FormHelper testing branch... FormHelper TESTING branch extends InputfieldForm. So you can use the pw form api with some extensions. How FormHelper could be used. // Load FormHelper module and also set wire('fh') variable $fh = $modules->get('FormHelper'); // Create a (first) form $form = $fh->create(); // Add some fields to the PW form object // Add default sanitizer $field->fhSanitizer = 'text'; // Add preprocess and processed callbacks $field->addHook('fhCallbackPreprocess', function($event) { // called before form processing }); $field->addHook('fhCallbackProcessed', function($event) { // called after form processing }); // Your callbacks need more arguments than $event or $this (class inside the callback is written)? Set additional arguments as array $field->fhCallbackArgs = array($arg1, $arg2); // access arguments via $event->arguments // process form // adds submit button, callback execution, CSRF check + reset and processInput() // error handling, also WireUpload errors if ($form->fhProcessForm()) { // true = submitted without errors // false = submitted with errors // null = not submitted // Get value sanitized (fhSanitizer) echo $form->fhValue($fieldname); // Get value sanitized with given sanitizer echo $form->fhValue($fieldname, 'pageName'); // Get raw value and ignore fhSanitizer setting echo $form->fhValue($fieldname, false); } Submit button is added in the beginning of the fhProcessForm() method. Get the submit button to modify it previously... // Get submit button $submitBtn = $form->fhSubmitBtn; Missing features will be moved to FormHelperExtra (if needed) pwImage plugin InputfieldCKEditor stuff (hidden page id field...) form by template / type "Field" fields with a hidden storage page to get file uploads working without saved page ... FormHelper testing branch https://bitbucket.org/pwFoo/formhelper/src/2a7e7261cf347622a82612d381cabdc63bed4c08?at=testing *UPDATED*1 point
-
1 point
-
1 point
-
You may want to take a look at Philipp Reiner's "First Steps" video that goes through the process of working with a HTML template for use with PW. The main part for the HTML template stuff starts around the 14:44 period. I would suggest you look at the entire video and other PW related video content on the ProcessWire website.1 point
-
1 point
-
Hi Richard, Back when I initially commented on this I had a frontend system for users to edit their profiles. I went that route initially because I didn't want the majority of users to have access to the ProcessWire admin. I quickly abandoned that approach. I found it was easier to create a base level of access to the PW admin that is just for profile editing. Everything else (including the page tree) is hidden. From there I add back the page tree and other resources based on roles. We have 7-8 internal business applications that run on one install. It works really well actually. I can leverage all the power and simplicity of the admin to create things pretty quickly. It's definitely a lot more efficient that creating frontend versions of them. If you really need something that is isolated from your regular PW install, then you could always do what you mentioned above. Setup a separate install and use it like an intranet. You could probably customize the admin theme to make it look/feel a lot like the front end of your site. You could pull in the profiles from one install to the other via services pages module, or some custom JSON. I think there is a relatively new pages to JSON module that looked pretty robust from what I remember. The other option is the full scale frontend approach. It's not that complicated really. User pages are the same as any other page. I think there are some examples floating around the forums already. I'll dig around here and see if I can find the old frontend system I built.1 point
-
Hi marc1n, Welcome to the forums. I highly recommend looking at Jumplinks. Mike Anthony took this module and fed it some steroids.1 point
-
Building one right now. For what Helder did, you could use a pliugin like this http://www.bytemuse.com/Pagify The one I'm building is a bit more complex because the url and the title are updated according to the real url and title of the page using html5 pushstate. In my case I'm using this technique http://rosspenman.com/pushstate-jquery/ There's also this one http://weblinc.github.io/jquery.smoothState.js/ I didn't use because it didn't fit my needs for this site. but looks great.1 point
-
Version Bump to 1.1.1 Using minified JS (manual call) Refactor SQL object Various other changes/fixes No schema changes (And GitHub is under attack - boy, how I battled to commit the changes... Finally slipped through after about 20 minutes of trying.)1 point
-
Net magazine is doing a CMS poll. Seems like you can vote multiple times which could make the poll a bit misleading. https://docs.google.com/forms/d/1QH9axSE7sS1B56KSxzVVzwE9Hg0gPiSNSvMy_ZFqRMM/viewform https://twitter.com/netmag/status/5785948525244170241 point
-
Hi guys, after a long pause on this project, I relaunched few days ago the new version of lymeta.com a website offering free high resolution photos, royalty free under creative commons zero license. Anyone can submit a photo and participate. I made a very simple design, flat and responsive, hope you like it. Cheers.1 point
-
So, https://github.com/ryancramerdesign/ProcessWire/archive/dev.zip isn't working?1 point
-
@Teppo, about ApiGen... I for one totally love it....but not the ProcessWire hosted one. I have rolled out my own locally hosted one, which I update regularly with the latest PW dev. It has been especially invaluable to me as a module developer and also as someone curious to find out how PW works and also just for learning to use PEAR . I can quickly and systematically go through PW cross-referenced code, reading Ryan's comments, finding out what extends what, inherited properties/methods, class properties and methods, etc. I have set it up to document not only .php files but also .module ones - so, the whole package. GitHub doesn't even come close IMHO - unless am missing something?. As stated previously elsewhere, my greatest influence as a developer has been through studying existing modules, notably by Ryan, Soma, Wanze, Pete, Antti and yours, and more recently others including Adrian. ApiGen has helped me 'decipher' Ryan's and Soma's advanced use of PW methods - quickly and efficiently (but I also use Grep a lot if I am looking for something specific). But I agree - this is something I would only recommend for advanced developers and has to be used with the full knowledge about 'Public vs Private API' as stated in the link to Ryan's comments... This has been written in a hurry so there could be mistakes1 point
-
Sorting by subfields is now supported (see https://github.com/ryancramerdesign/ProcessWire/pull/862). It was my first contribution, so I'm pretty proud1 point
-
I just committed big refactoring to Fredi, which fixes all the known bugs and simplifies a code a lot. I haven't tested this yet on other pw versions than latest dev, so be careful when testing. It "should" work pretty universally, since now it uses ProcessPageEdit instead of own custom processes. So image/file uploads and reordering (tested) and repeaters (not tested...) should work also.1 point
-
Now you only have to convince Ryan to use this for Hanna Code, so we don't need to have two big ace installations1 point
-
A module that uses the db-ip.com IP Geolocation service to fetch geolocation information when given an IP address. I wrote this quickly to help anyone who might be stuck with the #VATMOSS mess and need a way to geo-locate a customer's IP address. You will need to register with db-ip.com in order to get an api key but they have a pretty generous daily-query allowance even for the free key (2000 lookups a day.) Here it is on github. And in the module repository.1 point
-
Hi All, I have spent a decent amount of time over the last two days (starting yesterday on American Thanksgiving) rebuilding my main personal business photo site with Processwire. For now this project is still being developed on a local install of MAMP. I did not wake up yesterday with the intension of starting this project - but I just went for it... Going back a few months: I discovered Processwire by accident. I was not really looking for a new CMS to replace my weapon of choice, namely MODx. Processwire seemed intriguing, but to be honest I had serious reservations in the beginning. After some initial tire kicking my conclusion was "this looks like a really interesting alternative, but this system is for advanced developer geeks with skills, it might never be the playground for you..." Initially my commitment to Processwire was an awkward stop and go experience. But I stuck with it. I asked some basic questions that just screamed "newbie alert" but the constructive and helpful responses were rewarding. I began to take notice and found that overall the Processwire Forum was simply first class. I know my way around markup HTML, CSS and pushing pixels around. But I can't write scripting code like PHP to save my life. I thought this was going to be a deal breaker - but I stuck with it. Fast forward to today: I am amazed at how much I got done! I am taking an existing MODx site and converting/improving all the dynamic elements from MODx to Processwire. Along the way I am streamlining the markup, the CSS, the logic, while adding more efficient Processwire building blocks than I thought possible, all without needing to fire off "help me" requests to the Processwire forum. I am also improving my CSS skills and I am even beginning to feel less intimated with working with PHP code. I guess you could call this the Processwire "aha" moment. It just feels good! I am really enjoying working with this system. There is so much in the Processwire arena that is still a mirage in the sand, but I think that with time I will add more and more knowledge. I guess that is it. I really appreciate the help and encouragement from you all... Cheers, Max1 point
-
I'm not exactly sure what you're thinking "combine" means here, but this field does exactly what the description says; it grabs data from other fields, mashes it all together into one big blob of (JSON) content -- and that's just about it. One very simple (yet sometimes very practical) use case is if you've got, say, 15 different text fields and you need to find pages that contain value "john doe" in any of those. Instead of doing this: $john_does = $pages->find('field1|field2|field3|field4|field5|...|field15%="john doe"'); .. you can create a cache field, select all of those fields to be cached in it, and then do this: $john_does = $pages->find('my_cache_field%="john doe"'); Not only does this look clean, in certain situations it can wildly improve query performance.1 point
-
Pages will definitely scale quite far. But there is certainly more overhead with a page than there is with a plain DB table. As a result, when you are talking about storing huge quantities of data, I would keep your pages to represent the visible URLs on your site. If each row of data isn't going to be related to a unique URL in your page structure, then there really isn't a technical need to store it as a page. Though if you don't need infinite scalability, you may still find using pages for that data to be more convenient. But since it sounds like you do need near-infinite scalability, going to the DB sounds like a better choice. ProcessWire Fieldtypes are designed to represent simple and complex structures in this way, while still letting you use the API admin interface to handle it all. However this does require developing your own Fieldtype and Inputfield to manage it (which actually isn't too difficult). If you don't need an interface and/or PW API access to manage it, you can also just go straight to the $db object as if ProcessWire wasn't there. But this isn't as nice or fun as having your data still be connected with ProcessWire.1 point
-
Great solution, thanks for posting this Pete. I figure I should follow-up and post the route that I use too, though this one depends on the server running unix. It creates rotating backups off your non-web-accessible home directory with a cron job, and then a cron job on your machine (or another server) copies the backups over every day. 1. Login to your unix-based web account (SSH or FTPS/SFTP) and create a directory off your non-web-accessible home directory where the backups will be stored. I call mine /db-backups/: mkdir /home/your-account/db-backups 2. Create a file in your home directory called .my.cnf (starting with a period). This holds your DB connection information. Place the following into that file, replacing "mysql_username" with your database username, and "mysql_password" with your database password: /home/your-account/.my.cnf [client] user=mysql_username pass=mysql_password If working on a shared server or some environment where other accounts can get into your files, make sure that .my.cnf file isn't readable by anyone else. i.e. type "chmod og-rwx .my.cnf" to remove (o)ther and (g)roup read/write/execute access to it. 3. Create another file in your non-web-accessible home directory called db-backup and paste the following in there. Update the first two lines in the script to point to the directory you created in step 1 (DB_BACKUP) and the name of the database you want to backup (DB_NAME). /home/your-account/db-backup #!/bin/bash # modify the following to suit your environment DB_BACKUP="/home/your-account/db-backups" DB_NAME="your-db-name" # title and version echo "" echo $DB_NAME echo "----------------------" echo "* Rotating backups..." rm $DB_BACKUP/$DB_NAME.5.sql mv $DB_BACKUP/$DB_NAME.4.sql $DB_BACKUP/$DB_NAME.5.sql mv $DB_BACKUP/$DB_NAME.3.sql $DB_BACKUP/$DB_NAME.4.sql mv $DB_BACKUP/$DB_NAME.2.sql $DB_BACKUP/$DB_NAME.3.sql mv $DB_BACKUP/$DB_NAME.1.sql $DB_BACKUP/$DB_NAME.2.sql echo "* Creating new backup..." mysqldump $DB_NAME > $DB_BACKUP/$DB_NAME.1.sql echo "----------------------" echo "Done" Note: I found this code somewhere else online a couple years ago and don't remember where to properly credit it. 4. Save the above and make it executable: chmod u+x db-backup If you are connected via SSH, test it out to make sure it's working by typing: ./db-backup It should create the first backup in your ./db-backups/ directory. 5. Setup a daily cron job to execute that file: /home/your-account/db-backup … most web hosting accounts have some ability to setup cron jobs in the control panel. 6. Now your server is keeping rotating backups in your account. Next I'd recommend going further and copying them to another machine, automatically every day. How you do this depends on whether you are going to use SFTP/FTPS or SSH (with rsync). Its preferable not to use regular FTP since it's not secure. In my case, I've setup a cron job on my OS X desktop to copy over the files to my computer every day. It executes a file that looks like this: #!/bin/bash /usr/bin/rsync --archive --rsh=/usr/bin/ssh --verbose user@domain.com:db-backups/* /Users/ryan/Backups/db/ That copies those rotating backups to a /Users/ryan/Backups/db/ directory on my computer. In order for the above to work, you'd have to already be using SSH with your account and have your SSH keys assigned so that you can connect without typing your login/password. If anyone is running a similar setup, I'll be glad to tell you how to do that. But I know there are other ways to automate this task and the approach you use here kind of depends on the platform and whether you have SSH access on the server. This setup is pretty bulletproof, but I'd like to have some module in PW in the future that will let it do all of this for you – Automatic backups from one server to another.1 point