Leaderboard
Popular Content
Showing content with the highest reputation on 02/19/2015 in all areas
-
smile of my week....i like to share: http://saijogeorge.com/css-puns/ have fun mr-fan4 points
-
You might also find this useful: echo $fieldtypes->implode('<br />', 'name'); It will list out the names of all installed fieldtypes, both core and those from site modules that you have installed.4 points
-
The other half of the images update is now in place on the dev branch. This enables you to edit images directly from the images list that you see when editing a page. When you hover an image or image thumbnail, you'll now see an edit icon appear in the upper left corner of the image. Click it and a modal opens. From there you can crop and resize, and replace the original image, or save it out to an entirely new image (copy). When cropping and then replacing an image, it will also attempt to re-create any size variations to reflect the new crop. This update also includes tweaks and improvements to what was posted last week. I'll cover this all in more detail in Friday's blog post, likely with a short screencast too. But wanted to go ahead and mention that it's there now if anyone is interested in testing it out. If you do test it out, do a Modules > Refresh in your admin after installing the latest dev version. This will make it update the versioned JS/CSS links to ensure your browser isn't still serving older versions. Though sometimes it still takes quitting/reopening the browser or clearing the browser cache. Please let me know how it works out for you.4 points
-
Hey, I don't mind necroing my posts if it coincides with my resurfacing on the forums The thing is, you all assume it's just about the speed of the site — the "staticness" of the content. But in my case — which I admit might be far from yours — is that I often deal with tiny, even time limited websites, like website for an event. They usually have just a few, maybe five totally different pages, are active/online for limited time, and I am probably the only person interacting with it. So when you take all of that into account, having both the data and the templates in the text editor, and not having to deal with neither database nor any kind of administration immensely speeds up my workflow. When adding a 'field' is a question of one YAML line versus multiple clicks in (even well designed ProcessWire) administration, there really is no question.3 points
-
I'm not sure you need the $k => $p where you have it. It should work with this: <?php foreach($page->children as $child): ?> <div class="mask"> <img src="<?php echo $child->images->first()->url; ?>" /> <h2><?php echo $child->headline; ?></h2> <?php echo $child->body; ?> <a href="<?php echo $child->url; ?>" class="info"><?php echo $child->title; ?></a> </div> <?php endforeach; ?> If I'm understanding you correctly, this should get you most of the way to where you want to go. I'm not a php expert and I haven't tested this, but I think that's right. Let us know if that works.2 points
-
Yep, this is what I do. Make sure to tell it to generate docs from .module files as well, not just .php2 points
-
Another thing you might be interested in is using ApiGen to generate docs for core. PW is fairly well documented in code apart from some places, and you'll find most of what you need there.2 points
-
Just to drive the point across further, recently I've been forced to maintain a bunch of WP sites (medium-high complexity) that are simply unmaintainable clusterfucks of modules inherited from other agencies… PHP directly into fields and the like… Just this week, I've found ~5 SQL injection vulnerabilities in extensions that look like they are rather popular in the WP community, bunch of totally ugly code, no comments to be found. This is what happens when people think WP saves costs, it just simply doesn't! To be fair, WP can be used to do great stuff, but it's a rarity unless you throw an insane amount of $ in it. /vent off2 points
-
I found out this week that Google still has the "basic" calendar feed open. We know the "full" calendar feed has been gone since November, and I hadn't read anything about any of them still being open. So I have no idea if the basic one was re-opened, or if it's always been open, but it's there and fully accessible. Maybe this is common knowledge, but it's news to me–I found out about it just experimenting with Google's URLs. It's a much bigger pain to pull the data from than the "full" one since most of the data is not structured, so it has to be parsed out with regular expressions. But I went ahead and updated this module to support the basic feed, as it has all the data that we need in it. It's now ready to use in the latest update (v2.0.0). It looks like the "basic" feed also accepts all of our date and keyword queries too, which is great. As far as I can tell, it returns this module to a fully functional state with all features working once again. I'm guessing that because we have to parse the data with regex's that much of it may not translate to Google calendars in other languages than English, so that's something to be aware of. But if anyone comes across any examples I can always see what might be necessary to add support.2 points
-
You see, this is talking MY language. I never understand how people communicate without having a mention of food somewhere in the argument - it just aint natural!2 points
-
yes i like wp for.install exploit script , irc bots , pharmz , game servers etc without wp i wolud have.to get my own hosting2 points
-
This module adds page to Admin -> Setup -> Redirects where you can add 301 redirects (inside your site or to other domains). Screencast: http://www.screencast.com/users/apeisa/folders/Jing/media/e29abcca-5ef0-44dd-ac9a-2cc70f53d2c6 (I have Chrome with Instant on so it previews pages before hitting enter.. but I'm too laze to record another screencast. Also there is sneak preview to my upcoming admin theme...) Download & Installation: https://github.com/apeisa/ProcessRedirects/archives/master, unzip all the files to /site/modules/ProcessRedirects/ folder, check new modules from bottom of the modules page and hit install on ProcessRedirects. More information and "tutorial" how this was done can be found from here: http://processwire.com/talk/index.php/topic,167.msg1071.html (and like you can see, most of the code came from Ryan's hands, I just wrapped it all together). Hope you guys find this useful. Not tested yet on many servers, so all the feedback is more than welcome. ProcessRedirects5.zip1 point
-
... got lost in crone Here is another one ... cronjob for database backup. All Informations here: github: https://github.com/kixe/CronjobDatabaseBackup PW Modules: http://modules.processwire.com/modules/cronjob-database-backup/1 point
-
I did another quick module, which plugs something I always kinda missed in ProcessWire. It's just a raw overview over the access management from the templates. Nothing fancy, but useful. The visible roles and the visibility of system templats can be setup in the modules settings. I'll add this to the modules directory later. But for now it would be great to hear if anyone is missing anything or if someone does have a better idea how to name the module. 12.03.15: Renamed the module and fixed wrong information for superusers and inherited rights from the required guest role. GitHub: https://github.com/LostKobrakai/ProcessAccessOverview1 point
-
since everyone is trying to make themes based on their own wishes and needs, I tried to have a view from our clients: what do they really need? how often? what should they see and what not...? so I ended up with a really clean theme. the trash page will not be shown in the page tree. I'll move it in the right bottom corner. some footer informations are not necessary to be visible all the time (eg. pw version, copyright). I want to hide them behind a button. I often see people looking for a "back button" because they don't want to use the browser back button (don't know why - maybe just my view?). some ideas for other features (like custom colors)? let me know what you think. thanks1 point
-
I am continuously bombarded with Wordpress this and Wordpress that, from all directions on how it is the best cms and the go to cms out there. It is starting to get a little silly. I can hardly read an article or visit a page without the mention of the holiness of Wordpress. It seems to have become some sort of mantra. Of course i don't agree. But it got me thinking. Are they all wrong? Are there any circumstances or reasons that anyone would use Wordpress over Processwire for a particular project?1 point
-
Aldus PageMaker? You're showing your vintage Marc.1 point
-
Are you talking about me? If so: It would certainly be a intersting thing, but I've a degree in design not computer engineering. While I'm indeed enjoying coding I'm more the one to imagine things and rant on bad ui or ux decisions and less the one to build complex backend systems.1 point
-
Not sure if this is a new bug or not - I haven't seen it on other sites, but I just installed it on a new site and with HTML minify turned on, certain spaces are being removed. This works as expected: <strong>Lesson Rating: </strong>Excellent But if the code is generated like this, the space between ":" and "Excellent" is removed: <strong>Lesson Rating:</strong> Excellent1 point
-
I've seen her tweets about this. It looks great as a small enhancement, but most of the time when I need autocomplete I also need multiselect. So no star for me.1 point
-
1 point
-
one is missing.... .processwire { position: absolute; transform: scale(auto); right: 100%; color: #fa5732; } Edit: forgot the color..1 point
-
1 point
-
Run "php -i" from the command line. It will list all installed modules, and even more, it will give you the location of the php.ini file used by the php cli - it's not neccessarily the same as your webserver module uses. So on linux, running php -i | grep php.ini or on windows php -i | findstr php.ini will give you a line reading "Loaded Configuration File => PATH/TO/php.ini". Make sure that this file also loads all required modules. It might also be worth it to make sure that the php executable you start in fact belongs to the same installation as the library loaded into the webserver. With the popularity of bundles like [X|W|L|M]AMP I've often seen the path still pointing to outdated older php installations while the server used a far newer version.1 point
-
I don't know if you can fix this, but currently it's hard to get the cropping box to the edges of the image, as the borders sometimes doesn't notice the drag end if you're releasing the mouse outside of the image. Top / right seem to work fine, but bottom and left edge don't get it for me. One can always drag the whole box down to the edge, but it would still be nice to have this working in all variations. Edit: @Ryan I can see that you don't want to duplicate stuff. But it would really be nice to have a single interface for editing image variations. This could even include variations generated by the api to be editable instead of just predefined sizes from CroppableModule and/or RTE images. Also now there are two seperate cropping UI's, which could each borrow a thought or two from each other, aside from the fact that just one interface would be easier for the user. Secondly editing api variations would even enable advanced stuff like using the picture element with automatic cropping for different imagesizes, while having the ability to author the crop for e. g. the mobile view afterwards, like showing a tighter crop. With CroppableImage this would only work for fixed aspect ratios.1 point
-
There's also another way of pulling calendar information from Google - but you have to have an API key to do so. I have a non-Processwire site (still on the task list of one to convert) where I pull Google Calendar data. This is a snippet of what I recently ended up with once I realized that the full calendar feed was no longer working. // GET NEXT FOUR UPCOMING EVENTS // maxResults = 4 // timeMin = current timestamp in ISO8601 format $url = 'https://www.googleapis.com/calendar/v3/calendars/[EMAILADDRESS]/events/?key=[APIKEY]&timeMin=' . date('Y-m-d\TH:i:s\Z') . '&maxResults=4&singleEvents=true&timeZone=Los_Angeles&orderBy=startTime'; $calendar = json_decode(file_get_contents($url), TRUE); $events = array(); foreach ($calendar['items'] as $item) { if (array_key_exists('dateTime', $item['start'])) { // has a specific beginning time $events[] = array( 'title'=> $item['summary'], 'start'=> strtotime(substr($item['start']['dateTime'], 0, -6)), 'end'=> strtotime(substr($item['end']['dateTime'], 0, -6)), ); } else { // an all-day event with no specific beginning time $events[] = array( 'title'=> $item['summary'], 'start'=> strtotime($item['start']['date']), 'end'=> strtotime($item['end']['date']), ); } } return $events; Who knows if Google will eventually close off the basic feed or not, so at least there's a bit of an alternative approach here if they do that.1 point
-
1 point
-
Yes this is default enabled on all image fields. I don't see any reason to have it disabled. Comments manager is only in the core dev branch. Once that becomes the new master, I'll likely remove the latest comments module from the directory. No plans to integrate at present. The crop feature added here is something entirely different from CroppableImage, and predefined crops are really the specialty of CroppableImage, which does a great job of it. The crop feature added to the core is more about getting the main/source image right, like for clients that don't have any image editing tools on their computer. It's particularly helpful in having some control over whatever variations might be created on the front-end of your site. For example: we are building a company directory and people upload various sizes of images for different people and sometimes people's heads get cut off in some variations. I'm using a square thumbnail on the listing page, and client uploads a tall portrait image. Head gets chopped off on the square thumbnail. Now the client can see "oh there's a problem there" and fix it themselves rather than calling me. That likewise fixes it for any other variations that might be generated from the same source image. No accounting for any of this is necessary in the site's code. Now I could use CroppableImage too, but I don't need this level of control for most of the images in the scenario I described, and don't want to make any changes to my site's front-end code to support it. Just want to give the client the ability to fix their own problem images when they pop up. Not looking to replace CroppableImage, which is already awesome and a great tool to use when your need calls for predefined crops.1 point
-
1 point
-
That's just part of the stylesheet in AdminThemeReno. It doesn't do that in AdminThemeDefault. We can ask Renobird about maybe changing it. I don't mind the uppercase myself, but it does seem maybe a little large when it's displaying anything other than a short title. It wasn't coded to retain align classes through cropping, but I suppose it could. I'll look into it. That was actually fixed about an hour ago (https://github.com/ryancramerdesign/ProcessWire/commit/bdf74054b3da06b1b354189381ed8c2f191b857a). I'd never seen it myself till I uploaded this version to a client site and tested it out, and then suddenly got that error for the first time. Getting those plugin.js files out of your browser cache can be a pain though. You may have to clear your cache or quit/reopen the browser. Just tested and it doesn't. Looks like CroppableImage overrides the methods where this stuff is generated in InputfieldImage. However, it would likely be as easy as Horst just adding a single edit link to the output of CroppableImage.1 point
-
Sometimes I can't edit an already inserted image. Does that happen to you guys too? CKeditor. I think this is or was the case since quite a long time. I get a JS error. Does this also work with the Croppable image field as it is extending the Image field? I figures it wouldn't work on a cropimage.1 point
-
Recently completed a bunch of ModX to PW conversions and a couple new smaller sites in PW. Some highlights: http://www.edibleisland.ca http://www.claddaghestates.com http://tofinofishingclub.com Currently working on a massive ModX to PW conversion of a Food Industry related site that has over 50,000 pages and a lot of custom functionality. Also working on a new membership site in PW. Front-end membership functionality in PW is driving me crazy and is PW's weak spot (IMHO), but that's another topic. Working on a smaller oil industry related site. Lastly and more exciting is a large web app conversion I'm doing from ModX to PW. More of a complete re-write really. It's exciting to be able to leverage the power and ease of PW where before I was handcuffed by ModX when I first built the app. And if all that wasn't enough, I'm still squeezing in the cracks smaller ModX to PW conversions. Lots on the go!1 point
-
1 point
-
I mentioned this a while back here https://processwire.com/talk/topic/8486-supporting-processwire-module-authors/ but there didn't seem to be much interest in this. I haven't currently released any modules but appreciate others that have taken the time to make and support them and have at times wanted to give at least some beer money to the authors. I think it helps to keep the spirit of open source alive and gives appreciation to those that have used their own time to share and support their modules.1 point
-
1 point
-
Jacmaes, Wauw! That's excellent how make automatic titles. The multiple related dropdowns are for the front end. When select a province (parent), another dropdown shows the related cities (childs). This weekend a person ask me for make a website and now i'm happy that I can make this for the first time in PW. After a few days of searching on the forum, look PW videos, asking, ... now I understand how the CMS/CMF works! Simple, good, robust, flexible, .... I like this nice CMS/CMF. A happy newbie Christophe1 point
-
The 'keyword' to search for is PHP Object Oriented Programming (OOP). Find a good tutorial about OOP Classes, Objects, Methods (functions) and Properties (variables). A ProcessWire $page is an 'instance', i.e. and Object of the Class Page (see /wire/core/Page.php). In OOP, you can call/access the members of a Class (Methods and Properties) by 'creating' an instance/Object of that Class. When you use the variable $page, behind the scenes you are actually creating an instance of the class, i.e. $p = new Page(); You can create as many Objects of that Class as you want. The key here is that they will all be tracked differently by PHP - they are independent Objects of the same Class. So, in your case although your wire('pages')->get($pageid) were, from a database point of view, all grabbing the same page, from a OOP point of view, they were all different Objects, tracked differently, i.e. you were doing $x = new Page(), $y = new Page(), etc. Also, this should not work wire('pages')->get($pageid)->of(false); - since you need to get the page first (I could be wrong here) - and even if it did, it was a 'different' Object to the $page in the next line wire('pages')->get($pageid)->$pagefield->deleteAll(); So, in order to tell PHP that you were talking about a specific/single Object, we assign the $page we are after to the variable $p (behind the scenes $p = new Page(); - but not just any Page, but one with the id $p->id=1234 (from the wire('pages')->get(1234). Written late, I could have missed something but hope this makes sense....1 point
-
Though this isn't a PW project I thought I would take the opportunity to post an image of my PHP-based, redis backed, pick-and-pack software (I mentioned it here) that integrates with Amazon via their MWS API and is served via nginx running on one of the original 256mb Pi B models. The site is accessed in the warehouse from an Android tablet which allows me to move around the shelving to find the items really quickly and take care of printing off the address labels then packing and finally shipping the orders. If you've never seen what Amazon's seller central pick and pack list is like then I hope you can appreciate the difference given the example below (apologies as this is an old screenshot)...1 point
-
This code will not work inside a function due to PHP variable scope. $path = $config->paths->root . 'site/assets/tmp/'; It should be like this. $path = wire('config')->paths->root . 'site/assets/tmp/'; Or even shorter... $path = wire('config')->paths->assets . 'tmp/'; If you develop with debug mode on, you will get useful feedback about where your code breaks. More tips here: https://processwire.com/talk/topic/3466-access-config-inside-function/ https://processwire.com/talk/topic/6365-how-to-use-selector-in-function/ Btw, in your 'outside function code' you are using the code below. Are you using thats in a class? Why the $this? $path = $this->config->paths->root . 'site/assets/tmp/';1 point
-
Hey Christophe, I built this (cultural) event site with PW, and it might be of interest to you: http://www.spainculture.us/ Think carefully about the initial structure that makes most sense for your project. In my case, since we're talking about events organized in different cities around the U.S., I chose to build the tree this way: This "geographical structure" is very intuitive for editors as they're able to quickly add or edit events by looking for the city where the event takes place. Much faster than having all events under one place, e.g. a page named "Events". When editing or creating an event, editors can choose categories (architecture, culinary arts, etc) from a simple pull-down menu: This menu is a page field, like Diogo recommended above, which references the categories that are organized as such in the tree: I hope this helps you understand the power and simplicity of page system in Processwire.1 point
-
https://processwire.com/talk/topic/3987-cmscritic-development-case-study/?p=36867 See this topic, Ryan mentions how to achieve that about 1/2 way down the first post.1 point
-
For anyone interested this was the only way I could get it working. <? $page->of(false); $desc = $page->images_single->description; $page->of(true); echo $modules->get('TextformatterMarkdownExtra')->format($desc);1 point
-
There shouldn't be a need to change $event->return, as you're hooking before the function not after it. Also you don't want to replace the returned markup of InputfieldSelector::render. The option is correctly set, but it's not working for me, too.1 point
-
For authors, there were only about 6 of them at import time, so I created the authors as users in PW manually. I also added the "wpid" field to the "user" template, and populated the value of that manually. That was easy to find in WordPress just by editing the author and noting the ID in the URL. The WordPress wp_posts table has a field in it called post_author, which is the ID of the author. So assuming we've got a user in ProcessWire with a "wpid" that matches up to that, it's easy for us to assign the right PW user to each post. You'll see how this takes place in the code below. Wrapping it up Here is the same "import" code as in the first post, but I added all the code accounting for authors, topics, tags, and images back into it. This all just goes in a ProcessWire template file, and viewing the page triggers the import. Because it's aware of stuff that is already imported, it can be run multiple times without causing duplication. <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Import Posts</title> </head> <body> <table border='1' width='100%'> <thead> <tr> <th>New?</th> <th>ID</th> <th>Author</th> <th>Date</th> <th>Name</th> <th>Title</th> <th>Images</th> <th>Topics</th> <th>Changes</th> </tr> </thead> <tbody> <?php // get access to WordPress wpautop() function include("/path/to/wordpress/wp-includes/formatting.php"); $wpdb = new PDO("mysql:dbname=wp_cmscritic;host=localhost", "user", "pass", array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'")); $posts = wire('pages')->get('/posts/'); $sql = " SELECT * FROM wp_posts WHERE post_type='post' AND post_status='publish' ORDER BY post_date "; $query = $wpdb->prepare($sql); $query->execute(); while($row = $query->fetch(PDO::FETCH_ASSOC)) { $post = $posts->child("wpid=$row[ID]"); // do we already have this post? if(!$post->id) { // create a new post $post = new Page(); $post->template = 'post'; $post->parent = $posts; echo "Creating new post...\n"; } $post->of(false); $post->name = wire('sanitizer')->pageName($row['post_name']); $post->title = $row['post_title']; $post->date = $row['post_date']; $post->summary = $row['post_excerpt']; $post->wpid = $row['ID']; // find the post author $author = wire('users')->get("wpid=$row[post_author]"); // if we don't have this post author, assign one (Mike) if(!$author->id) $author = wire('users')->get("mike"); // set the post author back to the page $post->createdUser = $author; // assign the bodycopy after adding <p> tags // the wpautop() function is from WordPress /wp-includes/wp-formatting.php $post->body = wpautop($row['post_content']); // give detailed report about this post echo "<tr>" . "<td>" . ($post->id ? "No" : "Yes") . "</td>" . "<td>$row[ID]</td>" . "<td>$row[post_author]</td>" . "<td>$row[post_date]</td>" . "<td>$row[post_name]</td>" . "<td>$row[post_title]</td>" . "<td>" . importImages($post) . "</td>" . "<td>" . importTopicsAndTags($wpdb, $post) . "</td>" . "<td>" . implode('<br>', $post->getChanges()) . "</td>" . "</tr>"; $post->save(); } function importTopicsAndTags(PDO $wpdb, Page $page) { // see implementation in previous post } function importImages(Page $page) { // see implementation in previous post } ?> </tbody> </table> </body> </html>1 point
-
Hi Christoph, this sounds like a perfect fit. Relating helpers to helpees (excuse the made up word ) would be done using a page reference field so would be extremely straight forward. In your tree, you'd presumably have: Help Topics Helpees Helpers each topic would start with a helpee assigned to it (as they've created the need for help) and then based on their criteria, a helper or multiple helpers would be assigned to it. Would the system need to be "intelligent"? In other words, would the system need to look for keywords and try and match pairs together or is this solely the responsibility of the administrator? (This would be the only complex part of the job if so) Ryan has built incredibly complex multi-relational sites using PW (http://www.tripsite.com/) and I can't think of any better system for this kind of job.1 point
-
1 point
-
Love it. The clouds don't move for me in Chrome or Firefox on Windows 8 but they do in Safari... albeit very jerkily! Whether they move or not isn't essential though since it's the content that counts and the focus should be on the screenshots. I'm seeing both sides of the argument (not that anyone's arguing) on having the Futura admin theme on the homepage - I wonder if these three areas should be some sort of slideshow instead? Perhaps the middle panel could start out as the default admin theme - if only to match the colours - and then fade through? It's a tricky one as all the shots show off the admin or a module, but I wonder if somehow it needs to show what you can create with ProcessWire too as Tripsite and VillaRental from your site sold me on ProcessWire ryan!1 point
-
There are positives with every CMS project and things to learn. There is no one-true way to approach things. Instead it's just a matter of different CMSs meeting different people's needs and preferences. My relatively brief experience with Symphony left me feeling that it was very much in opposition to how I work. But I have no doubt there are also good points and ideas to learn from, as there are with many products. I try to spend a good deal of time experimenting with other CMSs and will be sure to give Symphony more time based on your suggestion. In terms of organizing content for an editor with some form of limited access (as opposed to a superuser), I would suggest experimenting with ProcessWire 2.1 rather than 2.0. I think that 2.1 represents a stronger system for working with access to specific types of content. You define the access with the template rather than the page in PW 2.1. My opinion is that the tree view is the right approach whether you have access to all the branches in the tree or not. It is consistent and representative of the site's front-end structure. On large sites, confusion arises when you start pulling things out of the context of the site's structure (at least, that's my experience). You actually have quite a lot of flexibility in defining how this tree works in 2.1, including the ability to specify what fields appear in it on a template-by-template basis. But the desire to display pages in an alternate way in the admin has come up before, so you'll also be glad to know the new page search module can be used as a page listing filter (enabling nearly any kind of page listing display), and we'll be taking this utility a lot further as we move forward in PW development. But the tree structure will always be PW's native view into your site... we'll just provide more options for those that want it. The debug tool sounds interesting. I wouldn't want to take the approach of intercepting GET vars or making PW produce output directly in that manner, because PW promises not to take that control from your template. But you can achieve a similar type of result pretty easily just by adding a little code to your template's file. For example: <?php if($input->get->debug && !$user->isGuest()) { echo $page->renderFields(); // uses the MarkupPageFields core module // or iterate through the page's fields on your own to produce JSON, XML, etc. return; } // otherwise render regular page output1 point