Leaderboard
Popular Content
Showing content with the highest reputation on 10/28/2014 in all areas
-
I've created a new Textformatter in the last couple of days: TextformatterSrcset will add a srcset attribute to all your images inside a Textarea. Depending on your configuration, it will create all sizes for the images, make a double-sized one for HiDPI/Retina devices and you can even create a low-quality placeholder. Read more at Github and make sure that you read the examples. It was build to work perfect with the two scripts from Alexander Farkas, respimage and Lazysizes. Do yourself a favor and try them out. They don't require jQuery, they have wonderful fallback and are fast and easy to use. More information and downloads on our Github repo. This module is currently quite stable and tested against multiple configuration variations. It works Some code improvements are needed, so use with care. Feel free to ask any questions you might have.7 points
-
The clients can be non-technical to use PW, but you have to do some work. There are plugins for PW but the majority of them are not for frontend features. For this all you have to understand is how you can organize things in the PW backend, and how to get those things in your html. Anyway, to be clear I will give you the gallery example: To create a gallery you can have many approaches to collect the images. 1. You can create a parent page called "gallery" and allow for children pages with a single image field on each and any other fields that you need to have info on each image. 2. You can create a page called "gallery" (for example) dedicated only to the gallery where you have a multiple images field that will hold all the images with their descriptions. 3. You can create a multiple images field (or many) along with others fields in that template and use the to make the gallery (or galleries) It's all about flexibility and making your own decisions. search for gallery here in the forums and you will find multiple approaches. Second part is to choose a javascript gallery. There are loads of them, and all you have to do is go to their documentation to know what kind of HTML they expect you to create. Third part is to create that HTML and put the images dynamically to it in your template file. For example, if the JS gallery plugin asks for a list of images in the format "<ul><li><img/></li><li><img/></li><li><img/></li><li><img/></li></ul>": 1. ( where the ("/gallery/") page holds a holds a single image field "image" ) <ul> <? foreach($pages-get("/gallery/")->children() as $imagePage): ?> <li><img src="<?=$imagePage->image->url?>" description="<?=$imagePage->image->description?>"/></li> <? endforeach ?> </ul> 2. ( where the ("/gallery/") page holds a multiple images field "images" ) <ul> <? foreach($pages-get("/gallery/")->images as $image): ?> <li><img src="<?=$image->url?>" description="<?=$image->description?>"/></li> <? endforeach ?> </ul> 3. ( where the page being viewed holds a multiple images field "images" ) <ul> <? foreach($page->images as $image): ?> <li><img src="<?=$image->url?>" description="<?=$image->description?>"/></li> <? endforeach ?> </ul> Edit: while I was writing you had already a very long conversation. I'm still going to submit this6 points
-
This module adds a "SEO" tab to every page where you can define a special title, description, keywords, etc. Try it http://aluminum-j4f.lightningpw.com/processwire/ Name: demo Pass: demo123 How to use You can choose between include automatically or use the following methods: $config->seo // includes all the default values and configuration settings // e.g.: $config->seo->title $config->seo->keywords $page->seo // includes all the default values mixed with the page related seo data // e.g.: $page->seo->title $page->seo->keywords // for rendering: $page->seo->render . . Screenshot Download You can download it in the modules repository: http://modules.processwire.com/modules/markup-seo/5 points
-
On the National Geographic case study, I found it interesting that the developers moved the whole site to ProcessWire in the background and *then* brought this up with the client. Had they asked if they could move from Drupal to PW, the answer would likely have been negative. Perhaps a risky strategy for some but as my old boss once said: "Ask for forgiveness. Don't ask for permission"5 points
-
Inputfield And Fieldtype ImageFocusArea requires ProcessWire 2.5.6 or later This Inputfield makes it possible to select the important part of the image and use this area for different cropping options. This module is not a replacement for the existing Thumbnails module, though depending on your need it probably could replace it in many cases. I think a more flexible cropping approach than the existing Thumbnails module is useful especially when using the new html <picture> and you don't want the editor to define multiple thumbnails. Usage Create a new Inputfield ImageFocusArea and add it to the desired template. Edit a page with this template and add an image to the new field. You will see a link "Add Image Focusarea". Click the link and you will see a popup with a cropping tool similar to the Thumbnails module. Select the important part of the image, click "apply" and save the page. By default the Field hooks into Pageimage::size and automatically populates the cropping option with percentages of the center of the selected focusarea. You can always override this behaviour by calling $image->size with a different cropping option (e.g. $image->size(100,100,array('cropping'=>'center'))). The module introduces 3 new cropping options: align: This is the default if you do not override it with another cropping option. When resizing a image the module only adjusts the alignment of the crop. You will get the most zoomed-out result of these options. inside: Only parts inside of the selected area are used in the resulting image. You will get the most zoomed-in result of these options. outside: The resized image will contain the whole selected area. The surrounding imagearea will be used to reach the targetsize. This is also true for upscaling=false. Upscaling will only happen if the source image was smaller then the targetsize. API usage examples // here we force the old/usual 'center' mode: echo "<img src='{$page->image->size(200,200,array('cropping'=>'center'))}' />"; // by default if you did not define a cropping option, the cropping option gets automatically populated // Both calls will result in the same image: echo "<img src='{$page->image->size(200,200)}' />"; echo "<img src='{$page->image->size(200,200, array('cropping'=>'align'))}' />"; // the resulting image will be the center area of the selected focusarea echo "<img src='{$page->image->size(200,200, array('cropping'=>'inside'))}' />"; // to get an image with exactly the same ratio as the focusarea use width()/height() instead of a size() echo "<img src='{$page->image->width(200, array('cropping'=>'inside'))}' />"; echo "<img src='{$page->image->height(200, array('cropping'=>'inside'))}' />"; // the whole selected area will be part of the image, the surrounding imagearea will only be used to reach the targetsize echo "<img src='{$page->image->size(200,200, array('cropping'=>'outside'))}' />"; Flexible CSS Background Images Additionally you can access a new property cssBackgroundPosition, which could be useful for frontend responsive images. The visual result is similar to the cropping='align' mode, but depending on the size and postion of the focusArea and your images source and target size your mileage may vary. This property is intended to be used together with background-size: cover;. It is important that the background-image has the same ratio as the original image! <style> .cssimg{ background-size: cover; width:200px; height: 200px; } </style> <div class="cssimg" style="background-position: <?= $image->cssBackgroundPosition ?>; background-image: url(<?= $image->url ?>); "></div> Downloadhttps://github.com/phlppschrr/ImageFocusArea remember, this modules requires ProcessWire 2.5.6 or later There are still known bugs with upscaling=false, but I am not sure if it is a bug of this module or a ProcessWire bug. (fixed in ProcessWire 2.5.6) Thanks to Ryan and especially Horst for all the new great API additions for Pageimage und ImageSizer which made this module possible. This is my first module. If you notice any problems or unexpected behaviour post here or fill an issue on github. I am open to all suggestions. Do you think the cropping option names (align, inside, outside) are descriptive enough? Any better ideas? -- Edit: Renamed the Module to ImageFocusArea and updated the github link Edit 2: Reformatted this post and added some additional information.4 points
-
Yep - You just bet me too it. I eventually tried creating a variable first and then passing the value to the echo thingy. BTW, re. variables - my wife came into the office yesterday and I must have looked particularly grumpy. The conversation went kind of like this: Her: whats wrong? Me: oh...just bloody variables Her: Bloody fairy balls? I thought you were having ProcessWire problems! Well, it made me laugh and got rid of my grump.4 points
-
Money is a bad motivator as it only works as for a limited amount of time. Eagerness and willingness is way stronger and can keep you going like a good ol diesel. When you want to succeed your goal you have to do more over here then in the other camp I guess. But in the end you'll become a real fisher and you're be able to catch sharks in any ocean.4 points
-
When you're satisfied with that position then ProcessWire is not the right tool for you I Guess. But when you're willing to learn, then jump in we're here to help. ProcessWire has that nasty side effect that non coders become coders after using it for a while. You don't need much scripting at all to get started. Go ahead and follow the link provided by Joss.4 points
-
Hi everyone, I'd like to announce a complete overhaul of this module - problem is that I am not sure whether to release it as an update to this module, or perhaps as something completely new, perhaps called PageProtector. UPDATE: The functionality described in this post is available as a separate module: PageProtector This new version (not on github just yet) makes it very easy for site editors to set up various password protected areas on their site, or to simply protect a new page or section while they are still working on it. New functionality Ability for your site editors to control the user access to pages directly from Settings tab of each page Includes whether to protect all children of this page or not Optionally allows access to only specified roles Ability to change the message on the login page to make it specific to this page Option to have login form and prohibited message injected into a custom template Access to the above "Protect this Page" settings panel is controlled by the "page-edit-protected" permission Table in the module config settings that lists the details all of the protected pages Shortcut to protect entire site with one click What do you all think - replace the existing module, or release this functionality as a separate version? Module Config Settings Page Protection Settings4 points
-
Hi Adrian, Running 2.5.6 but that was from the other day. Downloaded it again and it looks to be sorted. There goes my chance at bug-fixing glory!4 points
-
great i will start on it, yes i have knowlege of using jquery and its scripts in website,3 points
-
On the google developer page the whole procedure is described. In fact its nothing more than placing a piece of javascript inside your HTML. Once you have a finished site, create an adsense account, follow the instructions and wait for google to approve your website. http://www.google.com/adsense/start/how-it-works.html3 points
-
Upcoming update: Blog version 2.2.1. (dev) Summary of Changes: All main methods that render HTML output are now configurable via a parameter/argument $options These changes allow much greater control of your Blog features' layout/output. I will provide examples later but most of the below is hopefully self-explanatory. Please note these changes supersede those introduced in version 2.1.1 and 2.1.0 (some name changes to array indices + some additions). None of the changes will break your existing install if you are using the stable Blog branch. However, if you updated to 2.1.1 on the dev branch, AND started using some of its new optional features, some minor modifications to template files could be required (i.e, following the examples shown in 2.1.0, e.g. for renderPosts(), $featuredImage parameter is now $options and covers all aspects of rendered posts, not just featured images. E.g. to display a featured image on a summarised post, use array('post_small_image'=>xxx) as shown below. I have updated the dev branch for testing/comments, thanks. I will update the docs once I merge to master branch. New Default Options in MarkupBlog Methods renderPosts() //default options for various aspects of posts $defaultOptions = array( 'post_count' => 1,//0=off, 1=on - for the count in: Posts 1 to 5 of 15 'post_count_text' =>$this->_('Post'),//e.g. Posts 1 to 5 of 15 'post_not_found' => $this->_('No posts found.'),//message when no posts found 'post_author' => 1,//display name of post author: 0=off,1=top(below post-headline),2=bottom(in post-foot) 'post_author_text' => $this->_('Posted by'),// 'post_date' => 1,//display post's date: 0=off,1=top(below post-headline),2=bottom(in post-foot) 'post_date_text' => '',//e.g. Posted by author 'on' date 'post_more_text' => $this->_('View More'),//for $small posts - link text to full post 'post_categories' => 2,//display post's categories: 0=off,1=top(below post-byline),2=bottom(in post-foot) 'post_categories_text' => $this->_('Categories:'),//e.g. 'Categories', 'In', 'Filed under', etc 'post_tags' => 2,//display post's tags: 0=off,1=top(below post-byline),2=bottom(in post-foot) 'post_tags_text' => $this->_('Tags:'),//e.g. 'Tagged', 'Related', etc 'post_small_allowable_tags' => '',//holds string of HTML tags for strip_tags $allowable_tags. Needs to be in format '<code><p><img>' 'post_small_headline_tag' => 'h4', 'post_large_headline_tag' => 'h2', 'post_comments' => 1,//show comments info? 0=off,1=comments count top,2=comments count bottom,3=comments count top & bottom 'post_zero_comments_text' => $this->_('No comments yet'), 'post_comments_text' => $this->_('Comment,Comments'),//title in anchor comments icon + post-foot comments text, e.g. '2 Comments' or '1 Comment'. Must be in 'singular,plural' format 'post_comments_label' => $this->_('Comments:'),//this appears in post-foot, e.g. 'Comments': 2 Comments //## featured images ## 'post_image_alt' => 'description',//defaults to $image->description. Otherwise other stated field on the page, e.g. = 'title' 'post_image_tag' => 'featured',//string: image tag to look for in blog_images//@@todo - need translation here? //** small/truncated post featured image ** 'post_small_image' => 0,//display post's featured image: 0=off,1=top(above post-headline),2=bottom(first item in post-body) 'post_small_image_width' => '',//no width manipulation of featured image if this is blank or 0 'post_small_image_height' => '',//no height manipulation if this is blank or 0. Note, if size is true and both width and height > 0, use size() instead /*size: - image will be resized to exact dimensions -> $img = $image->size($x, $y) - where $x = 'width' and $y = 'height'*/ 'post_small_image_size' => false,//if 'size' = true AND both width and height > 0, this kicks in //** large/full post featured image NOTE: for full posts, to avoid duplication we only pull image from blog_images ** 'post_large_image' => 0,//display post's featured image: 0=off,1=top(above post-headline),2=bottom(first item in post-body) 'post_large_image_width' => '',//no width manipulation of featured image if this is blank or 0 'post_large_image_height' => '',//no height manipulation if this is blank or 0. Note, if size is true and both width and height > 0, use size() instead 'post_large_image_size' => false,//if 'size' = true AND both width and height > 0, this kicks in ); renderTags() //default options for tags $defaultOptions = array( 'tags_posts_text' =>$this->_('post,posts'),//come in the format 'singular,plural' for e.g. 1 'post' ); renderCategories() //default options for categories $defaultOptions = array( 'categories_posts_text' =>$this->_('post,posts'),//come in the format 'singular,plural' for e.g. October 5 'posts' 'categories_not_found' => $this->_('No categories to display.'),//message when no posts found 'categories_more_text' => $this->_('View More'),//link text to view all posts in that category ); postAuthor() //default options for author widget $defaultOptions = array( 'author_text' => $this->_('Author'),//text next to author title|name 'author_thumb_width' => 100,//no width manipulation of author thumb if this is blank or 0 'author_thumb_height' => '',//no height manipulation of author thumb if this is blank or 0 'author_thumb_alt' => 'title',//defaults to $author->title. Otherwise other stated field on the page, e.g. = 'title' or if 'description' then $image->description ); renderNextPrevPosts() //default options for next/prev posts $defaultOptions = array( 'prev_post' => '<',//tag/text for previous post, e.g. «, «, etc, i.e. << >>, etc 'next_post' => '>',//tag/text for next post, e.g. ›, etc 'prev_post_text' => 'title',//if title or not empty: will show title of the prev post. Otherwise show specificed text, e.g. 'Older entries' 'next_post_text' => 'title',//if title or not empty: will show title of the next post. Otherwise show specificed text, e.g. 'Newer entries' ); renderComments() - was already configurable; here showing new additions only //ADDITIONAL default options for comments $defaultOptions = array( 'comments_success' => $this->_('Thank you, your submission has been saved.'), 'comments_error' => $this->_('Your submission was not saved due to one or more errors. Try again.'), 'comments_text' => $this->_('Comment,Comments'),//comments text, e.g. 2 'Comments' or 1 'Comment' next to comments count (div#comments). Must be in 'singular,plural' format 'comments_list_empty' => $this->_('No comments found.'), 'comments_list_reply_text' => $this->_('replied to'), 'comments_by_text' => $this->_('Comment by'), 'comments_post_text' => $this->_('Post a comment'), 'comments_prev_text' => $this->_('Back'), 'comments_next_text' => $this->_('Next'), ); renderArchives() //default options for archives $defaultOptions = array( 'archives_posts_text' =>$this->_('post,posts'),//come in the format 'singular,plural' for e.g. October 5 'posts' 'archives_month_view_all_text' => $this->_('View All'),//'view all' that month's archives if limit set on amount to list );3 points
-
There is another side to this community which transcends anything ever found on slashdot.2 points
-
Mike Anthony, Sweet! That looks super cool. A bit more than I need, and longer than I can wait. I extended the module this afternoon and added support for: Wildcards: /somepage/* Alternate Domain: http://legacy.site.com The alternate domain is specified in the module config settings. If set, the module will also check the alternate domain for the request. If it gets back a status code of 200, then it will redirect to the request on that domain. That may be a fringe feature, but I need to maintain a legacy.site.com scenario, and this takes care of everything. @apeisa I may not be the best keeper of this module, as this kind of thing is a bit out of my wheelhouse. Can I just submit a Pull Request? I could also just release a beta version first for those who want to test it. We have about 80 redirects active here (a lot of which will go away with the wildcards), but I've been testing it on a production site all afternoon. Seems stable.2 points
-
Thank you so much for all your suggestions and help my friends, i have decided to step in this CMS. hope you guys will be there to help me further. so in future i would become a member to help others in this CMS... Thank you so much..2 points
-
Fortunately for me, I was able to get a screen capture before you edited your post2 points
-
2 points
-
Here is what you need for basics (either know it, or go learn it) You need to know how to echo something in php It is worth learning what a foreach loop is and how to do one You need to understand what an array is You need to know good practices in putting html and css together (that is not a PW thing really...) er ... That is probably most of what you need to understand to get you started. By the way, you will see on my tutorial that I recommend you install the BLANK profile. THe other profiles will get you started, but if you are trying to learn, sometime a blank sheet of paper is better.2 points
-
It is not lacking themes at all. ProcessWire has no built in templating system like some of the more limited CMSs So, as long as you know html and css you can create your own site in your own way, backed by Content Management. This is what makes it a proper business CMS solution. Have a play!2 points
-
In ProcessWire you're free whatever you want to output and it is not limited to HTML only. As a result you're free to use any template you can find. You could simply drop HTML of a wordpress theme in your templates and use that if you wish. Other resources: http://html5up.net/ http://www.opendesigns.org/website-templates/ I never use themes my self so there are probably way better resources.2 points
-
Hey guys, I'm building a site that has some rather long urls going on which is going to be a problem because there are going to be some social media buttons on the website, specifically a twitter share button. This module is looking to be a good solution but I had been hoping to generate the short urls rather than depending on the client to create them. I've created a module that hooks into page save and creates a new short url if an existing on for that page is not found. My issue is that it creates too many short urls. I've tried hooking into different aspects of the page save to see if it makes a difference (which it does) so I'm suspecting that I may not fully understand hooking (as I haven't used it too many times). $this->pages->addHookAfter('save', $this, 'createLink'); creates 2278 links $this->pages->addHookAfter('added', $this, 'createLink'); creates 2248 links $this->pages->addHookAfter('saved', $this, 'createLink'); creates 1124 links Except for the first link, which is correct, each link refers to the previous link. Here's what I have: /** * Initialize hooks */ public function init() { $this->pages->addHookAfter('save', $this, 'createLink'); } /** * createLink hooks into the pages->save method and creates a new short url if an existing one is not found * */ public function createLink($event) { $page = $event->arguments[0]; $full = $page->url; $l = wire()->pages->get("template=LinkShortener,full_link=$full"); if($l instanceof NullPage) LinkShortener::addNewLink( $full, $page->id ); } Any help you can offer would be appreciated. Thanks! Riz Edit: I've discovered my super rookie mistake. I didn't take into consideration that when the short url was created it was triggering a page save which was what was creating an infinite loop which ended up timing out when it got somewhere in the thousands. Changed it to: public function createLink($event) { $page = $event->arguments[0]; $full = $page->url; if ($page->template != "LinkShortener"){ $l = wire()->pages->get("template=LinkShortener,full_link=$full"); if($l instanceof NullPage) LinkShortener::addNewLink( $full, null ); } } And it works great.2 points
-
Minor updates to renderNextPrevPosts(). Added ability to add custom link texts e.g. <<Older entries Newer entries>> Updated post above.2 points
-
It's funny how it goes: in Drupal (almost) all content items are Nodes, which feels absolutely nonsensical and confusing to me, but I've never heard people say that they don't "get" it. Pages, on the other hand, seem to confuse many newcomers, even though the bulk of the content they manage in ProcessWire are exactly that -- pages. Personally I prefer pages over nodes, and perhaps even resources (from MODX)2 points
-
Hybrid Auth will look for a path or array that you pass as $ha_config in to new Hybrid_Auth( $ha_config ); So if you have a config file somewhere assign its path to $ha_config before you assign an instance of the class. Altough in the project i'm working on i'm passing an array with all the config values into it. /** * Gets HybridAuth config data from module configuration settings * */ public function ___getHybridAuthConfig() { if ($this->page->template == "admin") return; if (in_array('active', $this->get('hybridauth'))) { $this->isHybridAuth = true; $this->hybridAuthConfig = array( 'base_url' => $this->getHybridAuthBaseUrl(), 'providers' => array( "AOL" => array( "enabled" => $this->get('hybridauth_aol_status') == 'enabled' ? true : false ), "Facebook" => array( "enabled" => $this->get('hybridauth_facebook_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_facebook_app_id'), "secret" => $this->get('hybridauth_facebook_app_secret') ), "trustForwarded" => in_array('trust_forwarded', $this->get('hybridauth_facebook_trust_forwarded')) ? true : false ), "Foursquare" => array( "enabled" => $this->get('hybridauth_foursquare_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_foursquare_app_id'), "secret" => $this->get('hybridauth_foursquare_app_secret') ) ), "Google" => array( "enabled" => $this->get('hybridauth_google_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_google_app_id'), "secret" => $this->get('hybridauth_google_app_secret') ) ), "LinkedIn" => array( "enabled" => $this->get('hybridauth_linkedin_status') == 'enabled' ? true : false, "keys" => array( "key" => $this->get('hybridauth_linkedin_app_id'), "secret" => $this->get('hybridauth_linkedin_app_secret') ) ), "OpenID" => array( "enabled" => $this->get('hybridauth_openid_status') == 'enabled' ? true : false ), "Twitter" => array( "enabled" => $this->get('hybridauth_twitter_status') == 'enabled' ? true : false, "keys" => array( "key" => $this->get('hybridauth_twitter_app_id'), "secret" => $this->get('hybridauth_twitter_app_secret') ) ), // Windows Live "Live" => array( "enabled" => $this->get('hybridauth_windowslive_status') == 'enabled' ? true : false, "keys" => array( "id" => $this->get('hybridauth_windowslive_app_id'), "secret" => $this->get('hybridauth_windowslive_app_secret') ) ), "Yahoo" => array( "enabled" => $this->get('hybridauth_yahoo_status') == 'enabled' ? true : false, "keys" => array( "key" => $this->get('hybridauth_yahoo_app_id'), "secret" => $this->get('hybridauth_yahoo_app_secret') ) ) ), // If you want to enable logging, set 'debug_mode' to true. // You can also set it to // - "error" To log only error messages. Useful in production // - "info" To log info and error messages (ignore debug messages) "debug_mode" => "", // Path to file writable by the web server. Required if 'debug_mode' is not false "debug_file" => $this->config->paths->logs . "hybridauth.txt", ); } }2 points
-
2 points
-
Let's bump this thread since Beyond Tellerrand Berlin is less than one week away - any PW Forum members attending? If so, wanna meet Monday night at the warm up?2 points
-
Hi ank and welcome to the forums. Hard to know exactly how you have things set up, but give this a go. It's untested, so there might be something slightly amiss, but should be close: <?php $pagename = $page->child->title; foreach($page->children as $child) { $headimage = $child->headimage->first(); $thumb = $headimage->size(600, 400); $pagename = $child->title; echo " <div class='section'> <a href='{$child->url}'> <div class='sectionimage'> <div class='image'> <img src='{$thumb->url}' alt='{$headimage->description}'></img> </div> <div class='caption'> <p>{$child->title}</p> </div> </div> </a> <div class='brands'> <ul>"; foreach($child->children as $childchild) { echo "<li><a href='{$childchild->url}'>{$childchild->title}</a></li>"; } echo "</ul> </div> </div>"; } Sorry for getting rid of all your echo statements - they were driving me crazy2 points
-
interrobang, this is awesome! Can't wait to try it out. I have needed this so many times and just found workarounds, my site editors are going to be super excited.2 points
-
This module adds CSV import and export functionality to Profields Table fields on both the admin and front-end. http://modules.processwire.com/modules/table-csv-import-export/ https://github.com/adrianbj/TableCsvImportExport Access to the admin import/export for non-superusers is controlled by two automatically created permissions: table-csv-import and table-csv-export Another permission (table-csv-import-overwrite) allows you to control access to the overwrite option when importing. The overwrite option is also controlled at the field level. Go to the table field's Input tab and check the new "Allow overwrite option" if you want this enabled at all for the specific field. Please consider limiting import overwrite option to trusted roles as you could do a lot of damage very quickly with the overwrite option Front-end export of a table field to CSV can be achieved with the exportCsv() method: // export as CSV if csv_export=1 is in url if($input->get->csv_export==1){ $modules->get('ProcessTableCsvExport'); // load module // delimiter, enclosure, file extension, multiple fields separator, names in first row $page->fields->tablefield->exportCsv('tab', '"', 'tsv', '|', true); } // display content of template with link to same page with appended csv_export=1 else{ include("./head.inc"); echo $page->tablefield->render(); //render table - not necessary for export - just displaying the table echo "<a href='./?csv_export=1'>Export Table as CSV</a>"; //link to initiate export include("./foot.inc"); } Front-end import can be achieved with the importCsv() method: $modules->get('TableCsvImportExport'); // load module // data, delimiter, enclosure, convert decimals, ignore first row, multiple fields separator, append or overwrite $page->fields->tablefield->importCsv($csvData, ';', '"', true, false, '|', 'append'); Please let me know if you have any problems, or suggestions for improvements. Enjoy!1 point
-
I've just posted a Fieldtype and Inputfield module combination that support the use of MySQL time fields in ProcessWire. Ryan's Datetime module is great but I needed something that dealt specifically with times for a scheduling system and this is one of the results. For 24 hour clock format ('HH24MM') you now get a clock-picker pop-up by default... ...but you can inhibit it if you don't want it... Although the input time format is selectable, as this is stored as a MySQL time field, you currently need to specify values in selectors in full "H:MM:SS" format. So if you wanted to get all events starting on or after 9am you'd do something like this... $events = $pages->find("template=events, starts>=9:00:00")->sort("starts"); This is definitely a beta module as I've not tested every single input format yet. Currently does not support negative time-periods or fractions of a second. FieldtypeTime on Github FieldtypeTime in the Module Repository Releases Version 0.2.0: Adds support for the use of this input field in repeaters and repeater matrix types. Version 0.1.0: Adds clock picker.1 point
-
Doing it server side has the advantage that only the code you need for mobile clients will be served which can save quite some kB. If I understand response.js right, first the whole DOM needs to be loaded before response.js can swap things around or deactivate them. If you do things server side, on mobile devices you don't output elements you need for the desktop and vice versa. There is a module for minimizing images. Or you can use image compression tools. A good overview here. I have used ImageOptim on the Mac and Trimage on Linux. Both work well and can help saving bandwidth. Don't know about Windows tools. But some of them use the same libraries, I think.1 point
-
@muchdev I went ahead and submitted a new version with a option to turn off automatic script injection. See https://github.com/somatonic/AjaxSearch#module-settings for further infos as you need to output the js config var used by the AjaxSearch.js manually too. After all I'm not sure why you need this module at all. Just take the AjaxSearch.js and deinstall the module, as there's no reason to have it installed at all. This module was more a little fun helper back then, I'll maybe remove it from the modules.processwire.com.1 point
-
1 point
-
I've seen Load Impact used before. I don't know much more about it, but it's another one to throw into the mix If you're comfortable with command line tools, there is also ApacheBench.1 point
-
The txtfirmatter doesn't return but modify the variable instance. No need to $new = ... See ,xamples in this thread marked as solved.1 point
-
But can't Ryan create his own blog and jingles?!1 point
-
I had used EE for years, way back when they were still called pMachine. So I have a firm understanding of the CMS. However I have not used it in the past two years, and I am sure lots has changed. Same here! I loved EE until I had the "EUREKA MOMENT" with ProcessWire. It took a long time for me, because after leaving EE, I was on the hunt for the next great CMS. That got me into various WAMP setups, virtual machines, a dozen different CMS's, etc. I liked many others, but none gave me the AHAAA MOMENT, like a lightning bolt, as PW did the first time I understood it.1 point
-
For a noob like me it was easy enough when I tried to setup a DO VPS using their guides. The issue for me would have been maintenance and security - which I would have sucked at - so I've stayed with my managed VPS. Take a look at https://serverpilot.io/ too.1 point
-
Chris, Here, we never touch the core ...You don't need to change anything in /wire/. Whatever you change there will get overwritten on upgrade In a hurry, but have a look at this post: https://processwire.com/talk/topic/7981-update-ckeditor/?p=77847 You playground's at /site/modules/InputfieldCKEditor/, e.g. config.js1 point
-
Oh hey, how did I miss this topic? We might have something with lightning.pw that we can call cloud hosting. It is build for ProcessWire and we're working on new features that focus on making development easier. Unfortunately we have to fight against big problems with our FTP service and we did some minor backend improvements. Next up is the Snapshot and own Profile function, then a Dropbox integration and everything beyond is just a point on the roadmap at the moment. I just want to remark that lightning.pw is only intended for development. We don't want to handle the hosting of a real live site because. That's why we have those random names and the long domain. A migration tool between a life site and dev would be nice and might be coming in the future. _ Maybe you can find a hoster that doesn't has the "cloud" stuff in their marketing but just offers solid hosting with a snapshot functionality? I could also think, that the backup module from PW 2.5 offers a great way to "save" a site. But that doesn't help with the staging functions. Did you had a look at DigitalOcean?1 point
-
The first thing to do is leave the technology completely out the conversation, even if the client starts asking. Websites are, in the end, marketing and communications tools and it is vital to get the client thinking about the brand, the message, the need and the customer. If I was making a TV commercial, I would not expect the client to ask which recording desk I would be using for the soundtrack, but I would expect him to tell me whether commercial will be aired on cinema as well as television. In above the line advertising, the client wants clear results above anything else and it is worthwhile to encourage the same expectations for their website. Since a website may also involve the client or someone from their organisation working on the site, then it is also important to make the point that the site should also be easy to use. There is not need to say "ProcessWire" is easy to use, since that is meaningless if they don't know what a processwire is, how much to feed it or where you can get one kennelled. So, again, no technology speak, this is about assurances that YOU can fulfill the brief not that the software can. Coming from an old world creative production background, one of the most frustrating things I have found is this huge blurred area between the needs of the brand and the technology needed to get there. I suppose it is because many people in creative roles are also in technology roles, whereas in film production, for instance, the two roles are often separate and have been so traditionally for a hundred years. The client therefore has a clear route: Account Manager -> Creative -> a great big, magical, foggy bit when the technology is handled by people he is not introduced to -> final product to be signed off and paid for. Much better for all concerned1 point
-
@tobaco: gurkendoktor is more familiar with the caching issue, I asked him to answer1 point
-
Depending what the budget it, I chatted to Rackspace a few months ago about a project that didn't happen in the end for a minor celeb. Talking to them on the phone, I was very impressed by how helpful they were prepared to be and flexible and not just stick to the ratecard, as it were.1 point
-
Correct me if I'm wrong, but doesn't SHIFT+CMD+V (Mac) or SHIFT+CTRL+V (Windows) force paste as plain text in almost any application? That's the way I've always done it and it generally works well. No need for extra plugins to do this when that capability should already be OS native.1 point
-
Short tipp for CKEEditor contents.css (copied in your site/templates/styles directory and add the path like metioned) it's mostly easy to get the same styles like in frontend with easy import default template styles and adapt them like: /** * General editor styles (regular mode only) * * See contents-inline.css for inline styles. * */ /* Template CSS ONLY */ @import url("style.css"); /* WORKSPACE EDITOR SETUP */ body { } /* CORRECT THE ORIGINAL STYLESHEET */ don't tested with the 2.5 - but my first project on 2.4 works great and simple without having the stuff twice - i ionly have one frontend stylesheet. sometimes there is some padding needed for the WYSIWYG....or other things in the default style.css that needs to be overwritten or changed.1 point
-
Hi Tobaco, my setup is always the same. Doesn't matter if I use PageTable or not. Here it goes (simplified): /templates - basic-page.php - home.php - /tpl - main.php - mainnav.php - subnav.php - footer.php The tpl/main.php is the overall template like: <?php include('tpl/mainnav.php'); include('tpl/subnav.php'); include('tpl/slider.php'); ?> <!DOCTYPE html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title><?= $page->title ?></title> <!--- styles and scripts --> </head> <body class='<?= $bodyclass ?>'> <header> <div class='wrap'> <a href="/"><img src='/site/templates/img/logo.png' class='logo' alt="Logo"></a> <nav class='main'> <?= $mainnav ?> </nav> </div> </header> <?= $slider ?> <?= $subnav ?> <section class="content"> <div class="wrap group"> <h1 class='v2 hide'><span><?= $page->title ?></span></h1> <?= $content ?> </div> </section> <footer> <div class="group"> <?php include ('tpl/footer.php'); ?> </div> </footer> <script src="/site/templates/dist/all.min.js"></script> </body> </html> basic-page template looks like this (every template renders the content and then includes the main template): <?php /** * basic page template * */ $bodyclass='inner'; $content = $page->body; include('tpl/main.php'); With PageTable the structure looks like this: /templates - basic-page.php - home.php - part_text.php - part_columns.php - part_gallery.php - /tpl - main.php - mainnav.php - subnav.php - footer.php The part_* templates are templates only for PageTable. part_columns.php could look like this: <?php $headline1 = ""; $headline2 = ""; if(!$page->checkbox1) $headline1 = "<h2>{$page->title}</h2>"; if(!$page->checkbox2) $headline2 = "<h2>{$page->text1}</h2>"; // Output echo " <div class='pageTableSection {$page->template->name}'> <div class='inner'> <div class='col one-half'> {$headline1} {$page->body} </div> <div class='col one-half'> {$headline2} {$page->textarea1} </div> </div> </div> "; And the basic page template gets enhanced by ("layout" being the PageTableExtend field): <?php /** * basic page template * including PageTable layout parts */ $bodyclass='inner'; $content = "{$page->body}"; if(count($page->layout)>0){ foreach($page->layout as $l){ $content .= $l->render(); } } include('tpl/main.php'); That way, the layout parts are easily renderable in the Admin with PageTableExtended. While writing this, I want to point to another feature of the module. If rendered by PageTableExtended, the template gets an option 'pageTableExtended' which you can use in your part template: // Output echo " <div class='pageTableSection {$page->template->name}'> <div class='inner'> <div class='col one-half'> {$headline1} {$page->body} </div> <div class='col one-half'> {$headline2} {$page->textarea1} </div> </div> </div> "; if(!$options['pageTableExtended']){ // we are not in the Admin, so we include our social media buttons which we only need in our frontend include('social/socialmediabuttons.php); } Hope that helps.1 point
-
Just wanted to step in and confirm that HTML Purifier does, indeed, strip any tags it doesn't recognise as valid (i.e. part of whatever DTD it's following). ACF is the one that allows any tags it's configured to allow using a config string -- there's a world of difference there. Also, if anyone got the idea that I'm against ACF, validating/filtering/sanitising user-generated markup, or whitelisting, I'm not. Whitelisting is a very good security practice, but as long as HTML Purifier doesn't allow valid HTML5 elements, it's outdated and useless (for many of my use cases). That may or may not be true for anyone else, but in many cases I've found it easier to avoid it -- for now. For the record, the issue that originally led me to this decision was the fact that I could, in theory, configure HTML Purifier to allow specific data-attributes, but apparently there isn't any way to whitelist all data-* attributes, using a wildcard. That's understandable considering it's purpose and scope, but not acceptable for some of my use cases.1 point
-
If you turn off ACF and turn off HTML Purifier, you've essentially got what we had with TinyMCE. I grew increasingly uncomfortable with TinyMCE as ProcessWire has grown. The fact that it is open with regard to what markup it will allow also creates quality problems for a site especially over time. But an even bigger issue is security. An RTE without a strong filter behind it is a security hole because markup from RTEs is already entity encoded and ready for output. If a user with access to the RTE knows what they are doing, they can manipulate the POST request to the server, adding in some of their own markup (and XSS). This is particularly easy to do with TinyMCE. And once you can do that, you can get very creative indeed. A non-superuser with page edit access using TinyMCE could feasibly insert a script to make a front-end page render like a PW admin login screen. The next time the superuser views that page on autopilot, they type in their password and then the system is compromised. So CKEditor + HTML Purifier prevents that problem. ACF doesn't prevent that problem, but goes a long ways towards solving the other major RTE issue: markup quality and preventing markup degradation. You can turn those filters off, but it's important to understand the compromises that result. If your admin is limited to yourself or just superusers then you probably have no need for HTML purifier. But I sleep a lot better at night knowing we have a secure solution for the RTE. Since CKEditor can be configured to be as open-ended as TinyMCE (even if we don't recommend it for anyone but superusers), I don't necessarily see any reason to use TinyMCE any more... we now have a stronger feature set and much nicer plugin system for CKEditor than we ever had for TinyMCE. But I'll still be maintaining and supporting TinyMCE as a 3rd party module for a long time to come. On most of the sites where I'm already using TinyMCE, I'm likely to keep using it. But for any new installations CKEditor is definitely the way to go.1 point
-
Foundation4 by far been my favorite framework of choice. Sublime2 + Emmet plugin & Foundation4 = some pretty quick layouts.1 point