Leaderboard
Popular Content
Showing content with the highest reputation on 10/26/2013 in all areas
-
Looks great! Can't wait to have this on my site. The only thing I'm missing (as far as I can tell from the screenshots) is a global link to "View site". I think it's a major usability benefit to be able to quickly access your site from anywhere in the admin. Might I suggest a small icon the right of the "Profile" icon in the menu bar? http://fortawesome.github.io/Font-Awesome/icon/external-link/2 points
-
I don't personally exclude anything when migrating a site from dev to live. While it might make sense to exclude things like /site/assets/cache/ and /site/assets/sessions/, it's also not entirely necessary as those things are already under automatic garbage collection/clearing. You do need to make sure that those directories exist though. So if you exclude them from the copy, double check that the directory still gets created. I see no problem with excluding those directories (and /site/assets/logs/ if you want to) as long as you make sure they get re-created in the destination and are writable to PW.2 points
-
Hi, After reading this thread, I decided to make a module that helps generating PDF files of ProcessWire pages. GitHub: https://github.com/wanze/Pages2Pdf Modules Directory: http://modules.processwire.com/modules/pages2-pdf/ This module uses the mPDF library to generate the PDF files. It has fully UTF-8 and basic HTML/CSS support for rendering the PDF files. The output is customizable with ProcessWire templates. Example I've enabled generating PDF files for the skyscraper template of ryans Skyscrapers-profile with a template that outputs the data in a table along with the body text and the images: one-atlantic-center-pdf-4177.pdf Please take a look at the README on GitHub for instructions and further information/examples. Cheers1 point
-
Hi. I have been working on a simple mailchimp integration module. It is probably pretty bad written as I don't fully know my way around the processmanager module creation process yet. Anyway this is basically what you need to do. Create a mailChimp account (free), get the API keys for your account. Add the API key to the config.inc.php file. Create a mail friendly template: Inline CSS with supported CSS tags so dont use floats or position for instance. Create a "root" page where you Newsletter will reside under. This case root is called "newsletter" want another name just change in the module. (Line 27) Install the module. Some screenshots: This is the admin section where Lists is being fetched from mailchimp and newsletters is being fetched from under the root page you set up earlier. Click send and your mail is on the way. Result page. So what have happened now, you have created and sent a new email campaign through mailchimp. For detailed reports regarding delivery status you need to log on to mailchimp. For subscription you can build your own form or use some of the one provided by mailchimp, if you want to skip the "verify subscription" mail you need to create your own subscribe form see example attached. ProcessMailChimp.zip subscribe.php I am not saying that this is a 100% completed module but it cover my needs and I have seen some questions regarding this kind of functionality roaming the forum.1 point
-
CollagePlus is a jQuery plugin by Ed Lea. It takes a list of images and converts it to a nicely formatted grid. With this module, we use the CollagePlus plugin to produce nice grid output for ProcessWire image selection. This applies to the images that you select when clicking the image icon from the rich text editor (TinyMCE or CKEditor). The idea for this is from the great Unify admin theme for ProcessWire by @adamspruijt. To use, simply install the module and it is ready to go. Requirements: This module should run on any version of ProcessWire. But to be on the safe side, it would be best to use version 2.2 or newer. If you are using version 2.3.1 (dev branch) or newer this module makes use of conditional autoload for increased efficiency. Download: http://mods.pw/54 or https://github.com/ryancramerdesign/JqueryCollagePlus or install via Soma's ModulesManager. For those running ProcessWire 2.3.2 or newer, you can also install it from your admin: Modules > new > class: JqueryCollagePlus.1 point
-
@Joe: not possible. See http://ckeditor.com/forums/Support/How-copy-and-paste-normally for details. It's a browser security feature that prevents JavaScript from accessing clipboard within iframes. Editor used on this forum doesn't create a context menu of it's own like CKEditor, thus it's not affected by this.1 point
-
I still think it's not clear enough. I remember the first time when I looked at the breadcrumb and thought "I wonder what that home icon does". I was surprised to end up in the site. Edit: It seems that adrian agrees with me, hehe1 point
-
The home icon in the breadcumb functions as the "View site" button right now. But I agree with you that it should be elsewhere, and have it's own icon.1 point
-
1 point
-
1 point
-
Okay I understand now. I think I can safely move the call to JqueryFancybox to the render() method, which should fix this issue.1 point
-
Thanks for the reverse honeypot method! I'm now using both a regular honeypot (don't fill the field) and your reverse method in all my input forms. I can also recommend adding simple logging to see if it works or not. if ($honeypot == 1 || $securityfield != 1) { $log = new FileLog($config->paths->logs . 'detectedspam.txt'); $log->save('Spam catched: '.$sanitizer->textarea($input->post->body)); $session->redirect($config->urls->root); exit(); } 30 seconds after I implemented this, I got a spam message logged. urgh.. bitter sweet feeling..1 point
-
@Macrura: I've just pushed new version to GitHub with "version-control" permission. This is going to be installed automatically with the module, but if you've already installed and don't want to lose any data, simply add a new permission called "version-control" manually and apply it to appropriate roles.1 point
-
1 point
-
Last week I had time and worked with PocketGrid. As example I took the same demo-page on which I tested Kube. At first I worked from desktop to mobile (like I did with Kube). Rebuilding the site with PocketGrid was fun and no problem. Next challenge: building it mobile-first with PocketGrid. Puuh, was hard at the beginning. You had to think completely different (css). Was my first real 'mobile-first' doing. But at the end I got it. Result: less clean html, removing one unnecessary breakpoint, clean css. On the other side: IE8 needs a extra css or some js (because mobile-first). In short words: PocketGrid is supercool... Also I like the clean logical html. All the responsive magic is done in the css. No need for cryptic classnames. <div class="navigation block-group">...</div> <!-- PocketGrid --> <div class="footer block">...</div> <div class="small-2 large-4 columns">...</div> <!-- Foundation --> <div class="col-xs-6 col-md-4">...</div> <!-- Bootstrap --> Using percent, em, px... whatever you like. PocketGrid is absolutely flexible.1 point
-
1 point
-
I'am starting a new project next month and I will buy FormBuilder for that one. Also Installed 2.3.5 ProcessWire-dev.zip two days ago and congratulations on a great update, to you and all the forums' members testing it. I hope I can contribute to test the dev version too, here: http://processwire.com/talk/topic/3768-processwire-231-dev-branch/ Great detailed explanation and great tip too, Thanks Ryan!! : Sorry for being a little off topic. Thanks again.1 point
-
I've built a processwire website for a friend and had lots of problems with "this request was aborted because it appears to be forged" after putting it on the production server. Now, after some weeks of searching for the problem (also at the provider...) solution was very simple and I like to share: The Webspace on the server was full. And cause every visit creates a session (inside assets/sessions/ folder) no new session could be created (new sessions files were created, but size was zero). The result was the "forged" message. So perhaps this could be one more solution, if anyone else has this problem...1 point
-
Yeah, damn. You're absolutely right... Was my fault! I had a typo in my routing-hook. Just forget what I've said1 point
-
It's a little hard to follow exactly how you have your site structure, but you should be able to find the answer for your problem here: http://processwire.com/api/fieldtypes/images/ The very first example shows how to iterate through all images on a page: foreach($page->images as $image) { echo "<img src='$image->url'>"; } If you need to get the images from a child page then simply get the child page first using a selector: $childpage = $page->child(selector to get specific child); Then foreach through $childpage->images1 point
-
update to Version 1.0.2 translatable German Language Pack comes with Module more configuration options simplification of color setup optimized Accesibility1 point
-
@teppo: the field does contain the value "wire_challenge". But your comment reminded me that i had modified the config file and set sessionChallenge and sessionFingerprint both to false when i had trouble login in to the manager just after moving the site to the live server. I have set these settings both to true again and now pro-cache works as expected again. So it was my own mistake that caused the wire_challenge cookies to not be set anymore1 point
-
Soma, I was also going to post about this It looks interesting although creating content still doesn't feel very smooth. There is one thing though that I've been thinking for some time, why do people think that Json and Markdown are more semantic than HTML? To me it doesn't make any sense... Is ** more semantic than <strong>? Is Json more semantic than XML? Isn't HTML an XML way of organizing written content? HTML has come such a long way that I tend to think that it is the most efficient and semantic way of storing written content, I even wish that books would be written with it, and word processors and DTP tools would use it by default, an I would love to see better and more efficient HTML parsers coming up. Well, just a thought...1 point
-
@Raymond: if you check the Bypass tab of ProCache setup page, is there anything listed in "Cookies that bypass the cache"? By default wire_challenge should be there and this should effectively disable ProCache for logged in users. See Ryan's screenshot above for an example. If that field is empty or this cookie isn't listed, add and test again.1 point
-
There are likely a couple of issues with your code. If your images field has "Maximum files allowed" set to anything but "1", you would need to do: $page->image_planet->first() because the images field is an array of more than one image. Also, you need to supply the src with the url to the image, so you would need: $page->image_planet->first()->url It's all in the cheatsheet: http://cheatsheet.processwire.com/ and the images documentation: http://processwire.com/api/fieldtypes/images/1 point
-
Greetings, As always, ProcessWire makes it easy! Here you go: <?php echo date("F j, Y", $page->modified); ?> Thanks, Matthew1 point
-
I guess PW removes it if it can. If the file exists, PW will throw a warning each time you log in (as a superuser at least).1 point
-
1 point
-
I've upgraded a multi-language site from 2.2.0 to 2.3 and everything worked perfect!1 point
-
I actually mean code snippets in general, not just those that would be relevant for use with Hanna code. There are so many useful bits of code spread throughout this forum and various gist repos (especially Soma's), but finding them can be difficult. The ability to be able to search for a function and execute it or copy it for use in a template directly from within a code tester/runner or the Hanna code module would be fantastic. I could see that for snippets that perform admin type functions this could actually replace some some potential desire for smaller modules. An example might be your clean-files.php script: http://processwire.com/talk/topic/4437-delete-orphaned-filesimages-from-siteassetsfiles/?p=43687 I think it would be cool to be able to fire up the code runner and browse by category and/or search for "clean orphaned files" and see an explanation of what it does and then be able to run the script directly without the need for copying/pasting from the forum into a template and executing that. With my page tree migrator I have done something like this with the ability to import files directly from the page-list git repo from a simple dropdown, so surely we could something like this using gists, but with searching options?1 point
-
I assume you have page field called "subjects" on your student template. Then the selector would be this: $studentsStudyingThisSubject = $pages->find("template=student, subjects=$page"); Above code works if you have that code in your subject_template. Then the $page object will have the subject you are looking for. Hope this helps.1 point
-
Adrian, the Pagefile::install hook should be triggered so long as the file doesn't already exist in the destination. Is it possible that the files are already in /site/assets/files/.../? If so, the file doesn't technically need to be installed, so the hook is never called. As for getting the field belong to a Pagefile, this morning I've committed an update (to dev) that makes that possible. You can now retrieve the Field object that is part of the Pagefiles/Pagefile in the same way you can retrieve the $pagefile->page, by accessing $pagefile->field (accessible from the pagefile or from the pagefiles array).1 point
-
Hi sakkoulas, That's because the standard font set by the module does not have those characters included. I removed all fonts but the standard ones from the tcpdf folder so the module doesn't get too heavy. You can do those steps: Download TCPDF Copy all files starting with freesans* or freeserif* to /site/modules/Pages2Pdf/tcpdf/fonts In your module configs, set freesans/freeserif under Default font Then the greek characters work (make sure you enable debug mode or save the page to delete any cached pdfs). I think this is the easiest solution. Disadvantage is that the pdf is a bit heavier due to this font which includes all unicode characters. Another possibility is to convert a greek font to TCPDF according to the docs: http://www.tcpdf.org/fonts.php Does this work for you?1 point
-
Very nice - It was quite easy to add the 2 subpages. I added a Hook after 'save' and with $hookEvent->arguments[0] you get the page and add the Subpages if necessary Module Code: public function init() { // add a hook after the $pages->save $this->pages->addHookAfter('save', $this, 'createSubPagesForCompany'); } /** * Hook into the pages->save method and create two subpages if necessary * */ public function createSubPagesForCompany($event) { $page = $event->arguments[0]; $templates = wire('templates'); // only for template 'company' // create two subpages 'engagement_list' & 'address_list' if necessary if (!$page->isTrash && $page->template->name == 'company'){ if ($page->children('template=engagement_list')->count()==0){ // create engagement list $eng_list = new Page($templates->get('engagement_list')); $eng_list->parent = $page; $eng_list->name = 'engagements'; $eng_list->save(); $this->message("Engagement Liste erstellt."); } if ($page->children('template=address_list')->count()==0){ // create address list $addr_list = new Page($templates->get('address_list')); $addr_list->parent = $page; $addr_list->name = 'adressen'; $addr_list->save(); $this->message("Adressliste erstellt."); } } }1 point
-
You'd want to hook after $pages->save(); If you want your function to execute on every page save, any time, then you'd want to create an autoload module. http://wiki.processwire.com/index.php/Module_Creation If you want to capture newly added pages separately, then you'd also want to hook $pages->added(), which is called after a new page has been added. This example shows both: /site/modules/HelloWorld.module class HelloWorld extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hello World', 'summary' => 'Just an example module class.', 'version' => 1 'autoload' => true, ); } public function init() { $this->pages->addHookAfter('save', $this, 'hookSave'); $this->pages->addHookAfter('added', $this, 'hookAdded'); } public function hookSave(HookEvent $event) { // this function called any time a page is saved (whether new or not) $page = $event->object; // now you can access anything from the $page } public function hookAdded(HookEvent $event) { // this function only called after a new page added $page = $event->object; } }1 point
-
Since this thread is related , I'm also posting this here. I wrote a little helper module to find related pages with score and sorting by score AND modified. Module code can be found here: https://gist.github.com/3558974 $pages->findRelated( Page $page, PageArray $tags, string $field [, string $tmpl, int $limit] ); It add a $pages->findRelated() method. You can do something like this: $found = $pages->findRelated($page, $page->tags, 'tags', 'product|product2', 100); if($found) { foreach( $found->slice(0,5) as $rel ) { echo "<p><a href='$rel->url'>$rel->title</a> ($rel->score)</p>"; } } else { echo "<p>No related Products found</p>"; }1 point
-
Marc, when you are developing a site it's good to turn debug mode on. This will ensure that errors are sent to the screen, exceptions reported, etc. This can be found in /site/config.php. By default, it is false. You'll want to change it to true: $config->debug = true; Obviously you don't want this enabled for production sites, so remember to change it back to false for live/production sites. I don't see any problem with using var_dump, var_export, print_r, etc. so long as you are directing that output to where you can see it. Also avoid running these functions on PW objects as you may get into an infinite loop. Sometimes it can be difficult to track the output of these functions because PW performs a redirect after most POSTs. But if you use PW's built-in reporting functions, they will get queued between requests until they are output. Here are the relevant functions bellow. They will produce the messages that you see at the top of your screen in PW admin: $this->message("status message"); $this->message("status message that only appears in debug mode", Notice::debug); $this->error("error message"); $this->error("error message that only appears in debug mode", Notice::debug); If you are outside of a Wire derived object, you can call upon any API var to handle the notice for you. For example: wire('session')->message('status message'); wire('pages')->error('error message'); Note that these reporting functions above are for the admin (and related modules), and they don't do anything on the front-end of your site. How you choose to debug or report errors on the front-end is at your discretion. Personally, I keep debug mode on in development, and this puts PHP into E_ALL | E_STRICT error reporting mode... it reports everything possible. If I need to examine the value of something on the front-end, I'll do it the old fashioned way with just PHP. Though others may prefer to go further with their debugging tools. If you want to keep your own error log, here's how (anywhere in PW): $log = new FileLog($config->paths->logs . 'my-log.txt'); $log->save('whatever message you want'); You can direct it to store logs wherever you want, but I suggest using the PW logs dir as shown in the example above. This will make the log appear in /site/assets/logs/, and this directory is not web accessible for security.1 point