Leaderboard
Popular Content
Showing content with the highest reputation on 02/06/2016 in all areas
-
This week we have another new ProcessWire 3.x version for you that includes several updates and optimizations. We’ve also greatly expanded upon the field rendering with template files, with lots of info covered in this post. https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/6 points
-
http://processwire.com/blog/posts/happy-new-year-heres-a-roadmap-for-processwire-in-2016/#what-else-is-coming-for-processwire-3.x-in-20163 points
-
3 points
-
$portfolioPage->asmSelect->getNext($current); $portfolioPage->asmSelect->getPrev($current); $portfolioPage->asmSelect->first(); $portfolioPage->asmSelect->last();2 points
-
There's a new article about processwire on t3n, which is a quite well-known german tech. magazine: http://t3n.de/news/processwire-cms-675223/2 points
-
Subfield addressing is implement by the Page class itself, so you're out of luck if you pass in anything else. If your properties are all tied to $page, it should work. Though, in any case, getting $page->body already calls wirePopulateStringTags implicitly when it encounters a replacement tag, so your tags will already have been replaced/emptied when you pass it to your own call to wirePopulateStringTags. I'm not sure what problem you're trying to solve, but if it's about giving editors an easy means to include loosely related information in the HTML they enter, without needing to code themselves, it may be worth looking at the Hanna Code Textformatter, which lets you define your own tags and assign the PHP code that generates the replacement value.2 points
-
JqueryFileUpload This module is a ProcessWire implementation of the awesome Blueimp jQuery File Upload plugin. Server-side, the module provides a custom uploads' handler enabling you to perform various tasks with ease. The module is an interface of the feature-rich Ajax File Uploads widget provided by the jQuery File Upload plugin. The module is completely customisable and can be used both in the front- and backend (e.g. in a third-party module). Please read the README carefully and completely before using the module Release Status: Stable. Module Download: http://modules.processwire.com/modules/jquery-file-upload/ Issues tracker Project page: GitHub Security The module has been written with security in mind and makes no assumptions about any client-side validation. Instead, the module provides robust server-side validation of uploaded files. Server-side, no Ajax requests are honoured unless specifically set via configurable options server-side. This means that client-side requests to upload, delete and list files are not executed unless allowed server-side. By default, files are uploaded to a non-web-accessible (system) folder and files previously uploaded on the server are not sent back for display unless that setting is enabled. However, developers are still strongly advised to implement any other feasible measures to guard against malicious uploads, especially if allowing frontend uploading. For instance, developers can use native ProcessWire checks to limit access to the widget (e.g. only allowing uploads by registered/logged-in users). Demo A short video demo can be found here (and below )(CSS is WIP! ). In the backend, you can see it in action within the (upcoming) module Media Manager Features Fast Ajax uploads. Client and server-side validation. Client-side image resizing (highly configurable options). Beautiful touch-responsive image gallery preview. Audio and video previews pre-upload. Chunked and resumable file uploads (currently client-side only; server-side handling planned). Drag and drop support. Copy and paste support (Google Chrome only). Progress bars. Cross-domain uploads. Single or multiple uploads. Delete uploaded files. Documentation On GitHub. Have a look at the long list of available options. License Released under the MIT license @Credits: Sebastian Tschan @Thanks: Pete and BernhardB for the idea. Please test and provide feedback. Thanks!1 point
-
1 point
-
For a minute there I thought you were kidding. Never heard of this German GEMA & SME thing. I have just quickly read up about it. Well, I could try upload the video to Vimeo (would that work?) or you could do me a favour and watch the YT one behind a proxy ...that's not illegal, or is it? Edit: There's also the 'original' demo at Blueimp1 point
-
Do you have the demo without/or different music? The German GEMA and SME had YouTube blocking the video for Germany.1 point
-
Hi Jannis, Is that you want this <li class="has_children"><a href="#">Über uns</a> appear like a headline ? with no link? I think it would be a good idea to give those 'headlines' their own template like 'ueberschrift' or so. Then you could proceed similar to what I posted here using a hook.1 point
-
i'm running a site in production on PHP7, no problems. depends a lot on the modules you use i guess. core should be no problem at all.1 point
-
Perhaps just a missing $destinationPage->save(); after the foreach?1 point
-
<div class="pagination"> <?php $portfolio_pages = $pages->get('/portfolio/')->projects; $prev = $page->prev($portfolio_pages)->id ? $page->prev($portfolio_pages) : $portfolio_pages->last(); $next = $page->next($portfolio_pages)->id ? $page->next($portfolio_pages) : $portfolio_pages->first(); ?> <div class="left-arrow"> <a href="<?php echo $prev->url; ?>" title="Previous Project"><?php echo file_get_contents('assets/static-images/left-arrow.svg'); ?></a> </div> <div class="all-projects"> <a href="<?php echo $config->urls->root; ?>portfolio/" title="All Projects"><?php echo file_get_contents('assets/static-images/all-projects-icon.svg'); ?></a> </div> <div class="right-arrow"> <a href="<?php echo $next->url; ?>" title="Next Project"><?php echo file_get_contents('assets/static-images/right-arrow.svg'); ?></a> </div> </div> $portfolio_pages is a PageArray. $page->prev/next looks for the position of $page in the PageArray, then returns the preceding/following page. In case of the first/last item, where there is no such, it returns a NullPage object with an id of zero. So you can check for that id and get the last/first item in the PageArray instead.1 point
-
It's not for ASMselect but something similar should work after adjustments: // prev-next Pages are NullPages if current is first or last $prevPage = $page->prev->id ? $page->prev : $page->siblings->last; $nextPage = $page->next->id ? $page->next : $page->siblings->first; // use $prevPage->url1 point
-
$portfolioPage is the page object for the portfolio page, asmSelect needs to be changed with the fieldname of your asmselect field. Then replace all prev/next/last/first calls in my last example with the new calls.1 point
-
<?php $prev = $page->prev->id ? $page->prev : $page->siblings->last(); ?> <div class="left-arrow"> <a href="<?php echo $prev->url; ?>" title="Previous Project"> <?php echo file_get_contents('assets/static-images/left-arrow.svg'); ?> </a> </div> <?php $next = $page->next->id ? $page->next : $page->siblings->first(); ?> <div class="left-arrow"> <a href="<?php echo $next->url; ?>" title="Next Project"> <?php echo file_get_contents('assets/static-images/right-arrow.svg'); ?> </a> </div>1 point
-
Just read the blog post - wonderful! I have said it before and it stands repeating - one of the great things about PW (and there are many) is that updates and new features make so much sense. This field template/page template pairs is sooo powerful. Of course we could already do all this with includes and such, but one great strength of this being built in to PW is future maintainability. Someone (either someone else or me) looking at a template of mine in a couple of years would need to figure out how all these template partials are organised. Now, there's a standard way and it's documented here.1 point
-
1 point
-
I was thinking about splitting this into two modules. One that's responsible for the forum setup and topics and another for the comments. The comments module would be a page-based comments module. This would then give the option to use either Ryan's Comments Fieldtype, or this page-based version with the main forum module for topic replies. Edit: Since I released the source code, there's not been any feedback, so I assume my code is bad. For that reason, I'm going to commence with my above suggestion and split the module into two manageable pieces of code, starting with the comments module. This thread can now be deleted as I will no longer be releasing it as HermodBB.1 point
-
I'm really happy with NuSpheres PhpED on Windows! If you create an project it also knows more of it as you or I ever will, It has all sorts of Tooltips and Popuplists with classes, properties, functions, that also contain links to the files wheere they live, etc. It has a pane called Code Navigator which shows this list(s) of the current opened file with synchronized focus, means: it highlights that method where your cursor in the editor pane currently is. It has an own live debugger that can be embedded as a php extension in apaches webserver, also on remote machines, that can be controlled with little browser extensions or else. It supports remote editing via sftp or ftpes, ssh, terminals, it has a DB client that fastly displays information of mysql or sqlite databases and it has much more what I currently have not tested. Its memory consumption is not low but around 0.5 GB when I have opened 1-3 projects simultaneous. Downside is, it is not free. But it is worth its costs.1 point
-
In case you haven't noticed, you can shift+click to select a block of code lines, or ctrl+click to select multiple lines. Also, the left side menu just doesn't list the classes, but functions and interfaces as well. Really cool. I have been trying to find a way of displaying the full version numbers of each branch with the docs but haven't found way. For now, if you want to know the version, just scroll or search for the Class ProcessWire. and look at the constants summary table.1 point
-
Not sure if wireshell does allow for that, but if not you could go that way. > php -a php> include "index.php"; php> $pages->find("template=some_template")->each(function($p){ $p->setAndSave("field", "value"; });1 point
-
If someone does need feature x of y he can nowadays just pull in the composer package y-x anyways, at least most of the time.1 point
-
This is a website about a label I had in the past. After a long pause it was time to set the former label website up again (with a new look) by popular demand. The whole site was set up in less than 2 months in my spare time: setting up everything, creating templates and loading the data page by page. 2 languages (with a main emphasis on German) and everything's fully responsive. Thanks to Processwire and UIkit no problem. - Ryan, thank you for this wonderful CMS. This is only the beginning. If people are using it (and it looks like that) I will expand this thing with videos and more. https://www.chrom.de1 point
-
Solved it myself ... Finally managed to set up hooks: function myItemString(HookEvent $event) { $child = $event->arguments('page'); // current rendered child page // any logic with $child possible here /** * Überschriften */ if ($child->template->name == 'menue-ueberschrift') { $event->return = "<span> $child->title</span>"; }; /** * active */ if ($child->template->name == 'standard') { if ($child->id == wire('page')->id) { $event->return = "<span> $child->title</span>"; } }; } // setup the hook after on ___getItemString($class, $page) method $nav->addHookAfter('getItemString', null, 'myItemString'); /* Render Navigation Markup adding options, too---------------- */ echo $nav->render() Seems to work so I guess it's ok. And I've learned something new Cheers Hanna1 point
-
Yes, but HHVM is also a JIT compiler to PHP like V8 for JavaScript. Yes, in fact it does. I'll make a tutorial the next days.1 point
-
and that this one is not going to hide somewhere.... https://github.com/ryancramerdesign/ProcessDatabaseBackups (should work great for normal sites) since it works from the API you could setup a cron or lazycron to get it automatic (maybe send the backupfile via mail to get the db to a second place away from the webspace?) regards mr-fan1 point
-
Ryan, Just implemented this for the 3rd or 4th time now — I've been meaning to say thanks. Dead simple, and works like a charm.1 point
-
Pete is on the right track, but I think this is what you want instead: $pete = $users->get('name=pete'); or this also works: $pete = $users->get('pete');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