Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/13/2015 in all areas

  1. Hello again everyone. The latest web that I made for a real estate company www.grupoolmos.com. I am proud of code but not with the design. ; ) I created two modules for the backend. One based on jQuery datatables by soma for managing clients and relate properties (what the customer is looking ? What properties are available? ) This information can be sent by email , etc Another module is for the dashboard (a simple module process) .
    7 points
  2. Raymond Geerts, has pointed me a way to swap templates folder based on the hostname. (His post is somewhere here on the forum.) You need to place this code in /site/config.inc Here's my variation: /** * Switch ProcessWire templates directory on $_SERVER['HTTP_HOST']. Type the * Hostname as key and the name of the new templates folder as value. * */ $config->templates = array( 'sub.domain.dev' => 'templates-dev', // domain => templates folder name ); if (isset($_SERVER['HTTP_HOST']) && isset($config->templates[$_SERVER['HTTP_HOST']], $config->templates)) { foreach ($config->templates as $host => $folder) { if ($_SERVER['HTTP_HOST'] === $host) { $config->urls->templates = "/site/" . $folder . "/"; $config->paths->templates = dirname(__DIR__) . $config->urls->templates; } } } Here is Raymond's post.
    4 points
  3. Jumplinks can handle this. I’ve had the same problem recently. I do also think ProcessWire should 404 these kinds of URLs, though.
    4 points
  4. Image Animated GIF v 2.0.2 Module for PW 2.5 stable or newer, but is obsolete for PW Versions greater then 3.0.89 (... read more ...) This module helps with resizing and cropping of animated GIFs when using the GD-Library. The GD-Library does not support this. This module is completely based upon the fantastic work of László Zsidi (http://www.gifs.hu/, builts the initial classes) xurei (https://github.com/xurei/GIFDecoder_optimized, enhanced the classes) I have ported it to a PW module and it works with core imagefields, together with Pia and with CropImagefields that uses the new naming scheme since PW 2.5. ------------------------------------------------------------------------------------------------------------------------------------------ read more in this post about the rewrite from version 1.0.0 to version 2.0.0 ------------------------------------------------------------------------------------------------------------------------------------------ You can find it in the modules directory: https://modules.processwire.com/modules/image-animated-gif/ and on Github: https://github.com/horst-n/ImageAnimatedGif ------ A preview can be found here
    3 points
  5. This is a new version of Yahoo! Weather module for ProcessWire, old version of the module can be found at this link. The module has been rewritten, new options have been added alongside with caching from the API (Yahoo! API allows 20.000 calls per hour when using free version, so it comes in handy if your site has a lot of page hits). I've also updated icons in the package (you can easily swap them with yours in module icons folder). You can grab the module from the Modules page or directly from Github link. Update 1.0.1 Yahoo changed their forecast API URL (http://xml.weather.yahoo.com/ instead http://weather. yahooapis.com/), tiny update in Github repo. How to use You can call the module in two different ways: This is a basic call that renders the module, use this if you want only one instance of the module shown with WOEID set in the module settings. <?php echo $modules->get('MarkupYahooWeather')->render(); ?> If you want to show multiple instances of the module, call it this way: <?php $weather = $modules->get('MarkupYahooWeather'); $weather->woeid = 12587912; // Decatur, USA echo $weather->render(); $weather->woeid = 44418; // London, United Kingdom echo $weather->render(); ?> Options This module has the following options: Yahoo! Weather WOEID WOEID (Where On Earth ID) is an unique identifier for each city, you can easily find WOEID by using this site: http://woeid.rosselliot.co.nz. Default = Zagreb Set Locale Sets PHP locale, needed for localized date display. Default = en_US.UTF-8 Set Encoding Converts international date names to right format. Default = ISO-8859-1 Date Format Sets desired date output, formatted with PHP strftime function. Default = %A, %d.%m.%Y. Cache Time Cache time in minutes, caches .xml file(s) retrieved from Yahoo! API and pulls the data locally. Default = 5 minutes Display temperature in Fahrenheit instead of Celsius? Show weather conditions in Celsius or Fahrenheit scale (temperature: C/F; wind speed: km/h, mph; sunrise and sunset: 24h, am/pm). Show 5 day forecast below current weather forecast? Shows extended 5 day forecast, if unchecked, only current weather will be shown. Default = Checked Show wind direction and speed? Shows wind direction and speed. Default = Checked Show sunrise and sunset time? Shows sunrise and sunset time. Default = Checked Autoload script and stylesheet? Renders script and stylesheet during page render, if you prefer to include them manually, turn this option off. Default = Checked Load script in the bottom of the page? If "Autoload script and stylesheet" option is checked, you can select where script should be rendered automatically, before the end of head or body tag. Default = Unchecked Delete Weather Cache Deletes locally stored and cached .xml file(s) from Yahoo! API for all instances of the module.
    3 points
  6. @Macrura: This works for me every time: Install the skin into site/modules/InputfieldCKEditor/skins/lightwire In config.js, use the following: CKEDITOR.editorConfig = function( config ) { config.skin = "lightwire,/site/modules/InputfieldCKEditor/skins/lightwire/"; }; By doing this, we need not put anything into wire/modules.
    3 points
  7. On the topic of performance, I'm now wondering if I should set up a cache system for Jumplinks. It was mentioned by Antti a while back that Jumplinks is already feature-rich, but I think that caching redirects will actually be a life-saver for some users with large sites. At the end of the day, running the regex engine for every incoming request is sure to be a big performance hit on any server (the way I see it). I'm sure everyone agrees this should be added? There are also a few other fixes and enhancements in the pipeline, the most important one involves optional query-strings (much like the QSA flag for mod_rewrite). At the moment, if you want to match something.php and something.php?foo is requested, the redirect will not occur. In order to get it to work, you'd need to add {all} on the end of the source URI, which is, quite frankly, not the best way of doing it.
    2 points
  8. i use that technique from Raymond and i gotta say, it's pure gold!; saved me many times and helped along a project that i thought would be a nightmare to work on (requirement to work on site while it was in use)..
    2 points
  9. Hi everyone, Just added some new features (not in the repo just yet), but wanted to get some feedback on a new name for the module. It still functions as a way to migrate modules and their settings from one PW install to another, but now also includes: batch download and install modules from a list of class names entered in a textarea field batch module updating Name ideas: ModulesManager wouldn't be bad, but already taken ModulesMigratorInstallerUpdater would be the most accurate, but obviously ugly ModulesInstaller is OK, but doesn't cover everything ModulesHelper ? ModulesToolkit ? Free like for any suggestions Here are some screenshots for inspiration: THE OPTIONS EXPORTING INSTALLING (FROM MIGRATED ZIP) INSTALLING (FROM LIST OF CLASSNAMES) BATCH UPDATING MODULES WITH AVAILABLE UPDATES
    2 points
  10. Regarding No. 1: $data = $modules->getModuleConfigData('WireMailSmtp'); $data[$key] = $value; $modules->saveModuleConfigData('WireMailSmtp', $data); Fill in key and value yourself. It's the same for any other modules settings.
    2 points
  11. Thank you, Jan Romero. Installing ProcessJumplinks solves the problem. No further setup required.
    2 points
  12. I've changed it so anyone can set the first tag as a prefix, however staff will need to be vigilant and see that it is being used properly (I believe the original use case was to clearly define the different types of topic in the module forum, which may not be a problem in future with some restructuring anyway).
    2 points
  13. Is my 100th post I wanted to do something special. I edited a video, hope you like it Just for fun Edited: Now with subtitles
    1 point
  14. https://github.com/adrianbj/ProcessModuleToolkit It allows bulk automated migration installation and upgrading of modules (and their config settings) from one PW install to another, so it should be very handy in setting up new sites with your standard collection of favorite modules and settings. Allows includes batch installing by a list of module class names. Go to the Setup > Module Toolkit and follow the prompts. During the import, you can choose which modules from the collection to import. You can optionally import the module config settings from the source install. The one caveat is if a particular setting includes a reference to a page, template, or field ID, it won't work, but you can easily update this setting on the destination install. Batch install new modules directly from the modules directory with a list of module classnames or URLs to module zip files. You can optionally, automatically update all of the imported modules (if they are in the ProcessWire modules directory) to their latest available versions. It copies the module files so you can use it to migrate modules that are not available in the PW modules directory, or on Github. Great for all those custom helper modules you've created. Full restore feature in case something goes wrong / you change your mind. I maintain a dedicated test PW install for installing and configuring modules which I can then export for use in my projects using this tool. Please test and let me know what you think!
    1 point
  15. Where do i get? From here: https://github.com/IDT-media/Pages2JSON (thanks to LostKobrakai for "bug" report) What does this do? Simply adds method toJSON() to Page and PageArray elements, is capable to converting image and file arrays to URL containers, travels recursively all objects before outputs actual JSON. How to use? Simply install this module, configure data you want it to export in JSON result (similar to Ryan's ServicePages, thanks btw used some of ur code here). in templates or anywhere you need JSON output, call: $page->toJSON(); or $pages->toJSON(); Live example with template: search.php /***************************************************************** Do search *****************************************************************/ $term = $sanitizer->text($input->term); $results = array(); if($term) { $input->whitelist('term', $term); $term = $sanitizer->selectorValue($term); $limit = (int)$input->limit; $limit = $limit ? $limit : 50; $limit = $sanitizer->selectorValue($limit); $selector = "title|categories|content*=$term, limit=$limit, template=default|product"; // Prevent admin pages. if($user->isLoggedin()) $selector .= ", has_parent!=2"; // Find pages that match the selector $results = $pages->find($selector); } /***************************************************************** Output *****************************************************************/ header("Content-type: application/json"); echo $results->toJSON(); exit(); Customizing values: if(wire('config')->ajax) { wire()->addHookAfter('Pages2JSON::getValue', function($event) { $value = $event->arguments(0); if(!is_object($value)) return; $page = wire('page'); if($page->template == 'thumbs' && $value->className == 'Pageimage') $event->return = $value->size(28,28)->url; }); } Here i swap URL of all Pageimage objects in JSON response to match thumbs. Simple hu?
    1 point
  16. Hi, i just launched my litte blog orkork.de It's a german blog about nerdy topics like IT, development, photography, games, movies and more. Responsive design, built on top of bootstrap. Different teaser types and widgets are configurable in the backend, for every category node. I use require.js for the internal js stuff and use gulp as a building tool for less compilation and css/js minification. unveil.js manages lazy loading of images, including retina versions. Though, it's not heavily optimized yet, but you have to start somewhere I would love to get some feedback, if you have any! Cheers
    1 point
  17. If field can contain only one value or a string... if($page->title) echo $page->title; If field can contain multiple values, e.g. a multiple image field or multiple page field (i.e. contain arrays) if(count($page->images)) echo "we have images. Let's foreach them"; https://processwire.com/talk/topic/2239-how-to-test-for-empty-fields/ https://processwire.com/talk/topic/546-how-to-detect-an-empty-field/ https://processwire.com/talk/topic/8067-cant-detect-empty-field/ https://processwire.com/talk/topic/957-how-to-find-elements-with-empty-field/ https://processwire.com/talk/topic/8850-check-if-a-datetime-field-is-empty-does-not-work/ https://processwire.com/talk/topic/4177-checking-for-empty-textarea-field/ https://processwire.com/talk/topic/3050-checking-for-a-field-if-else/ etc....
    1 point
  18. Has Raymond's technique been submitted to the PW Recipe's yet?
    1 point
  19. Okey, i'll consider it but since it's not currently core module use own custom version of this or alter it by hooking, if more people vote for MapMarker it gets in more likely, thanks for awesome documentation tho. However i'll change file and image files to support description by default just like you suggested. Those who already use this module, notice that this will break your JSON streams when it comes to files and images.
    1 point
  20. You can try override default behavior: wire()->addHookAfter('Pages2JSON::getValue', function($event) { $value = $event->arguments(0); if(!is_object($value)) return; if($value->className == 'Pageimage') { $obj = new stdClass; $obj->url = $value->url; $obj->description = $value->description; $event->return = $obj; } }); Didn't test this btw, you could let ppl know if it works, thanks.
    1 point
  21. It's not complicated, but you have to grasp some basic level on how to interact with API's. Just follow a tutorial like this one. If you got it working, try the WireHttp class you are already trying since that will be a lot cleaner.
    1 point
  22. wow that's amazing
    1 point
  23. I like the current behavior in that you can save a page unpublished and the populated fields will be saved. Even if you try to publish, the populated fields will be saved, it's just that it won't actually publish until the required fields have been populated. But I would like the option to not show the required warnings unless the user is actually trying to publish the page. On templates with long complicated sets of fields, there are plenty of times you don't want to fill out everything right away and I think the warnings are intrusive at this point. I am thinking this would be a template level setting, but I guess it could also be per field, but that might be a little annoying to set them all? If it was per field, then it should be available as a template context override as well. Of course the title field should be treated differently. Anyone else have any thoughts on this?
    1 point
  24. @Mike - thanks - that totally works; maybe this info should be in the readme for the lightwire - will post on github ah just noticed Nico's post - @Nico - just added an issue, requesting Mike Anthony's instructions to be in the readme.. thanks for making this, liking it a lot!
    1 point
  25. ModuleToolkit is not tha bad.. other tags could be: ModuleDirector ModuleAdmin ModuleMigratorExtended looks really great for speed up site setup with the new tools!! Best regads mr-fan
    1 point
  26. I quite like ModuleToolkit, without the s. Yes? Great module, by the way
    1 point
  27. You should be able to do this on your own. Use $config->prependTemplateFile = '_init.php'; in your config.php and try this: // _init.php // Alter from basic-page.php to basic-page-dev.php if($user->isSuperuser()){ $page->template->altFilename($page->template->name."-dev"); }
    1 point
  28. It's a bug, see here: https://github.com/ryancramerdesign/ProcessWire/issues/1093
    1 point
  29. Hi As expected http://domain.tld/foo returns 404 Page Not Found. But http://domain.tld/index.php/foo shows the homepage and returns 200 OK. Can someone please confirm that this is the wanted behavior? Background: After redesigning a website Google has a lot of obsolete urls in their index. Some of them look like http://domain.tld/index.php/foo and get redirected to the homepage instead of throwing a 404. These urls are shown as Soft 404 in the Webmaster Tools. Thx
    1 point
  30. @Macura: Try to upload it directly into /wire/.../CKEditor (like here: http://monosnap.com/image/dETfuhFapWn79p36bIwmAsR6ANGNHc) and use the config.js to change it. Should look like this afterwards: /** * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; config.skin = 'lightwire'; }; And change the config.js in site/modules, too.
    1 point
  31. You've essentially three options: Pack the abstract class together with both your modules. You can use the bundle module to install the two other or leave it to the user to install them independently. Looks like this as folderstructure: FrontendUser -> ( FrontendUser.module, FrontendAbstract.php, FrontendUserLogin.module, FrontendUserRegister.module) This way users can only upgrade the whole bundle via the admin interface, but I think that's not a problem here. Distribute the modules independently (FrontendUser, FrontendUserLogin, FrontendUserRegister) and require the base module with the abstract class from the subordinate ones. Duplicate the abstract class to each module.
    1 point
  32. Hi, webaff and welcome. There are a couple of things you can do: Take a look at ProcessRedirects. This module offers an easy way to redirect old urls to current pages. No point losing link equity if you can redirect meaningfully. (This would be my preferred option.) Head off any 'rogue' URL segments in your templates (in 'head.inc' or equivalent). This tutorial gives plenty of info - page 3 deals with throwing 404s.
    1 point
  33. This issue still exists on (at least my) linux servers. If a file to upload does not contain any latin characters, you get the "Unable to move uploaded file to: ..." error. If a file name has at least any latin character, the upload works. On windows everything works fine. Can we do something about it?
    1 point
  34. forgot to test using an older php version.. sorry It's corrected.
    1 point
  35. @Peter - LightWire has been out for a while now: NicoKnoll/LightWire-Skin Also don't think it's alpha any more. Pretty stable on my sites. Edit: Whilst it's stable, it still has features to be added... Is that what you're following up on?
    1 point
  36. Just a thought on this. It looks like this will result in URLs like: mysite.com/documents/mydocument/ that will directly display a PDF. Correct? Maybe it's just me, but I always like to know when I am about to open up a PDF - it gives me the option to save instead, or open in a new tab, or decide not to open because I am on mobile don't want to wait for a potentially huge PDF file to open. Maybe this is becoming less of an issue now that browsers are directly rendering PDFs themselves, or sites are using mozilla's pdf.js etc. Anyway, just my two cents worth PS, given that you are using a file field, shouldn't: $file= $page->pdf; be: $file= $page->pdf->url;
    1 point
  37. Posting and getting may sound more difficult then Ryan has made it for us. To give you a simple example that extends Jan Romero's post: $http = new WireHttp; $request = array( 'public-key' => 'xyx1234_what-instagram-wants', 'just-a-key' => 'Just some value you want to add to your get request', ); $data = $http->get('http://instagram.com/request/some/partt', $request); // data should have data coming from instagram var_dump($data);
    1 point
  38. There shouldn't be that kind of problem (I'm not seeing it). Can you send me with more information into my email and I'll take a look over the weekend. Glad you are liking padloper!
    1 point
  39. Hi Christophe, Please double check your site/config.php for adminEmail configuration. If not you can add that to site/config.php like follows: /** * adminEmail: address to send optional fatal error notifications to. * */ $config->adminEmail = 'name@exampledomain.com'; Here is a little reference. Thanks
    1 point
  40. Working on a cleaner and nicer CKEditor Skin using fontawesome:
    1 point
  41. If {team->body} has hanna code formatter enabled, then it will not work as Hanna Code 1.9 does not support recursive Hanna code processing. Refer to my earlier post. Remove the {$team->body} statement from your code snippet and check the result whether it then outputs all 9 members. Once you see that working, try using the patched version of Hanna Code I submitted on Github.
    1 point
  42. I'm building a series of Process Modules for internal business functions. We have several processes that require complex forms. More than would be feasible to create using pages. So I decided to use FormBuilder to allow the appropriate users create and maintain the forms. There would be way too many fields required to send all these forms to pages using the built-in FormBuilder process. These are all lengthy forms (and this is a University), so think 10+ forms — some with up to 60 fields. Rather than save the form to a page, we hook into 'FormBuilderProcessor::saveForm' and create a page that references FormBuilder entry. (The page title is the same as the form entry, for example 1.817) I got a few tips from Ryan on that part. There is one base module called "ProcessAdminForms" that has all the common functionality. The modules that extend it can get as specific as needed. The screenshots below are from the "ProcessAdminIPIFs" module. It is an internal HR process that is required to hire a new employee or setup a new vendor. List of entries Show/hide columns (state saved per user via cookie) Viewing an entry Administrative comments & notifications
    1 point
  43. I've been working part-time, for several months, on an administration and attendance tracking system for a local trampoline and gymnastics club where I also do a little coaching. Been trying to build this up incrementally in the form of re-usable modules and I have already released some of these (FieldtypeTime, markup crossfade & google calendar embed) but a couple of new fieldtypes and the major module - which handles club sessions, members, scheduling and attendance tracking - are still being tweaked. The system runs on the club intranet with the club administration being done via PW's admin interface and the homepage being displayed on the check-in kiosk at the front desk (a touch-enabled monitor in portrait orientation.) The athletes use the kiosk to check-in as they arrive and club information, signage and advertising can all be shown in the background on the kiosk thanks to the markup-crossfade module. Club staff can quickly and easily create new slides in the kiosk display sequence or modify what's already there (slides for fees-due, car blockages, session times etc) as well as seeing who is in attendance and for what. I don't yet have permission to post full screenshots of the athletes in public places (remember this is all internal to the club) but once I get permission I'll do a write-up of the site. In the meantime here's a few teasers. Firstly, on the check-in kiosk... ...and some from the back-end...
    1 point
  44. Basicly you have one folder for templates by default. This is configured to be in "site root" + templates/ You are able to overrule this setting from the site/config.php as follow $config->urls->templates = $config->urls->site . 'mytemplates/'; $config->paths->templates = $config->paths->site . 'mytemplates/'; A trick i use a lot when developing in a live site is to duplicate the template folder and rename the copy to templates-dev. Then make sure i have an other domain (or subdomain) pointing to the hosting, for example dev.domain.ext and for the live site on www.domain.ext With the following code i can access the development templates while normal visitors keep getting the default templates. /** * Development: Alias for template-dev access * */ if($_SERVER['HTTP_HOST'] == 'dev.domain.ext') { $config->urls->templates = $config->urls->site . 'templates-dev/'; $config->paths->templates = $config->paths->site . 'templates-dev/'; $config->debug = true; } You can make up all kind of 'rules' to go by when overruling the templates folder with php from the config.php file. For example serving the same site with different layout and code for mobile on m.domain.ext /** * Mobile: Alias for template-mobile access * */ if($_SERVER['HTTP_HOST'] == 'm.domain.ext') { $config->urls->templates = $config->urls->site . 'templates-mobile/'; $config->paths->templates = $config->paths->site . 'templates-mobile/'; }
    1 point
  45. Update: If the image's filename contains ONLY Chinese characters I got the same error as before. However, if it has any ascii character in it (eg: numbers, letters, punctuation), for example: “未命名-1.jpg”, the module will kick in and rename the uploaded file name for me. Could anyone explain this phenomenon to me? Thank you very much. Zesen
    1 point
  46. The first thing I notice is the spaces and mixed case in the filenames. This is a bad idea for lots of reasons which is why if you uploaded the docs via a Files field in PW it would have converted them for you. I think what is causing the 404 is PW's htaccess rewrites. It sees: http://ahaa.inthooz.me/assets/form-downloads/ and goes looking for a page with that path. You could potentially move form-downloads into: http://ahaa.inthooz.me/site/assets/form-downloads/ and things should work just fine. But, why not upload them to PW and have files that are part of the system? EDIT: having them all in a files field in PW means you could use this code to provide download links to all and it would automatically work for all new files as they are added: echo "<ul>"; foreach($page->files as $file){ echo "For the {$file->description} form, <a href='{$file->url}'>click here!</a>"; } echo "</ul>"; Although personally I hate "click here" links, but I went with how you had things structured already
    1 point
  47. OK, it's been a while since I looked at this, and much of it was inspired or guided by Ryan. I had to boil it down a little to make it generic enough to make sense, so this exact code hasn't been tested, but it should get you started. Here's a proof of concept that works. Template for your calendar page <?php function pagesToJSON(PageArray $events) { $json = array(); foreach($events as $event) { $json[] = pageToArray($event); } return json_encode($json); } function pageToArray(Page $event) { $data = array( 'id' => $event->id, 'title' => $event->title, 'start' => date("Y-m-d H:i:s",$event->start_date), 'end' => date("Y-m-d H:i:s",$event->end_date), 'url' => "./$event->id", // event ID is the url segment ); return $data; } if($input->urlSegment1) { // event ID provided as a URL segment to this page $event = $pages->get("id=$input->urlSegment1"); include("./includes/head.inc"); echo $event->title; echo $event->body; include("./includes/footer.inc"); } else if($config->ajax && $input->get->start && $input->get->end) { // fullCalendar making an ajax request of events $start = (int) $input->get->start; $end = (int) $input->get->end; $events = $pages->get("/calendar/")->children("sort=start_date"); $events = pagesToJSON($events); echo $events; } else { //display the calendar $config->scripts->add('/site/templates/assets/js/fullcalendar.min.js'); $config->styles->add('/site/templates/assets/css/fullcalendar.css'); $config->styles->add('/site/templates/assets/css/calendar.css'); $config->scripts->add('/site/templates/assets/js/cal.js'); include("./includes/head.inc");?> <div id="calendar"></div> <? include("./includes/footer.inc"); } // end else ?> head.inc <!DOCTYPE HTML> <html> <head> <title><?=$page->title?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- CSS includes defined via $config->styles->add --> <?php foreach($config->styles as $url) echo "<link rel='stylesheet' type='text/css' href='$url' />";?> <!-- include jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js" type="text/javascript"></script> <script>!window.jQuery && document.write(unescape('%3Cscript src="/site/templates/assets/js/jquery-1.6.3.min.js"%3E%3C/script%3E'))</script> <!--js includes defined via $config->scripts->add --> <?php foreach($config->scripts as $url) echo "<script type='text/javascript' src='$url'></script>";?> </head> <body> footer.inc </body> </html>
    1 point
×
×
  • Create New...