Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/25/2016 in all areas

  1. In AIOM, you can switch to development mode, where CSS is not cached, or delete the cache (there's a button) to make any changes take effect immediately.
    3 points
  2. ClearCacheAdmin Module Since there's so many asking how to clear cache. Here comes a helper module that let's you clear caches directly from the admin menu. Additionally it has its own admin page that's a collection of the various caches available in ProcessWire in one place. See some infos and clear them. WireCache (using $cache) caches in the DB and there no way to clear it from the admin. Now you can delete the entries individually or all in one go. Supports following cache types: - Template "Page" Cache (disk file cache) - MarkupCache module (file cache) - WireCache (DB) - Other files and directories found in assets/cache/ path Wanted to do this for a long time. It was also great fun to do it and give something to the community to also learn something. For now it's on github only. Requires ProcessWire 2.6+. https://github.com/somatonic/ClearCacheAdmin
    2 points
  3. This seems to be a great Lorem Ipsum type of module AutoContent generator by adrian https://processwire.com/talk/topic/11016-autocontent-generator/
    2 points
  4. The image craetion / rotation belongs to the creation of an AdminThumnail, I believe. It has nothing to do with the upload itself. Or do you have defined any max-dimension with the imagesfield? But if you are on PW3, why don't you use another image engine than GD? If you can go with IMagick or NetpbmCLI or ImageMagickCLI, yo will not run into those problems. The GD-lib is the only one engine that always need to load the full uncompressed image into memory as one block. The other engines are able to process images in lines or chunks.
    2 points
  5. Damn it. You were faster. I had the same module on my to-do. Thanks for the module. Very helpful! I have three more points as a feature on my idea list: empty the ProCache and AIOM+ cache when they are installed. Remove all image variations and a short-cut to clear everything at once.
    2 points
  6. I actually don't think this is a matter of file paths. That error points to one file (like _func.php) having a namespace, and another file (like main.php) not having a namespace (or not referring to the function in the namespace that it exists). If you are letting PW decide whether to compile a file based on whether it has a namespace or not, then you've got to take those same considerations for any files it might include(). A file that doesn't get compiled isn't going to have files include()'d from it compiled either. So it sounds like you probably do have a namespace defined in your _func.php file, but not in your main.php file (or the opposite). For your case, since you are adding a namespace to the to of all your .php files, I'd suggest disabling the compiler by setting $config->templateCompile=false; in your /site/config.php.
    2 points
  7. Ok, let's make it really simple for people using chrome to do this If you are using chrome do this to have PW search with google on the omnibox by simply typing "pw [spacebar]" 1. right click on the omnibox and chose "Edit Search Engines" 2. scroll down until you find these input fields 3. Fill them as in the image: third field should be https://www.google.com/search?q=site:processwire.com%2Ftalk++-site:processwire.com%2Ftalk%2Fmembers%2F+-site:processwire.com%2Ftalk%2Fuser%2F+%s This is the equivalent to this search in Google: "site:processwire.com/talk -site:processwire.com/talk/members/ -site:processwire.com/talk/user/ %s" where %s is the query 4. type "pw [spacebar] Edit Search Engines" and see if this thread appears in first PS: I'm sure there is an equivalent way to do this in other browsers, but I'm not going to look for that now. Edit: simplified the url
    1 point
  8. As fas as I know, currently there is no way for a module developer to include a changelog in a way that enables us to check out the changes in the admin before upgrading.
    1 point
  9. Now I installed the module via github, that worked without issues. At the moment I can't give you access to the setup. Thanks for the hints to the -master versions of modules. Again the question: What are they for, what's the difference to the others?
    1 point
  10. This week I've got to keep the blog post a little brief because I've been so caught up in this weeks' updates that I've run out of time to write much in the post! The updates this week are not actually to the core code, but rather to the API reference documentation for ProcessWire 3.x. There's lots more work to do still, but I definitely have a good start, so going to introduce it here in this post. https://processwire.com/blog/posts/processwire-3.x-api-reference/
    1 point
  11. Success, adding to MarkupGoogleMap.js... (not RCDMap.js!) var ctaLayer = new google.maps.KmlLayer({ url: 'http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml', map: this.map }); at line 126... Thanks for help!
    1 point
  12. don't know what this RCDMap.js is, but i created a simple fiddle for you. does this help? http://jsfiddle.net/T78Hd/13/
    1 point
  13. The module includes the latest core version of Tracy with that commit you referenced, so not sure why manual updating would have helped. Also note that I make a couple of manual modifications to the core to make editor links reference the main template file, rather than the compiled version, so you will have problems there. Did you try the stable version - that should really speed things up - seems to me that the new src/Tracy/assets/Bar/loader.phtml approach used by master is the source of the slowdown. Any chance you can give me access to this server - I am baffled as to why the latest commit to the module stopped by debugger bar from working again. PS For reference, here is my Issue report to the Tracy core: https://github.com/nette/tracy/issues/157 - hopefully they'll be able to figure out the slowdown problem with the master (dev) version.
    1 point
  14. Hi biber, I had some time to oversee the code again, finally. I made two adjustments: The first was to remove the "echo </li>" from the second function in the visit call and add a </li> to the end of the output of the first function. Thats what I was hinting at before. The second was that I wrapped the nested lists inside another list-item <li> because of the HTML specifications for lists: http://www.w3.org/TR/html5/grouping-content.html#the-ul-element For comparison the working visit call: (with additional <ul> tags around so this can stand for its own) echo "<ul>"; visit( $pages->get('/') , function(Page $page) { echo '<li><a class="men" href="' . $page->url . '">' . $page->title . '</a></li>'; if ($page->numChildren > 0) { echo '<li><ul>'; } } , function(Page $page) { if ($page->numChildren > 0) { echo '</ul></li>'; } } ); echo "</ul>"; best wishes Steffen
    1 point
  15. Marvin Scharle responded to my mail on 11 Dec 2015 about PW3 support: Looks like the project/service is unmaintained.
    1 point
  16. this module is intended for superusers during development and alpha state (although there should be no critical parts) only tested with chrome and pw 2.7.2 https://github.com/BernhardBaumrock/InputfieldEditLinks todo: - check if it works with ajax fields - add icon to view current page template to change template specific field-values bugs: - two icons on page fields
    1 point
  17. @bernhard Just wanted to say thanks for this module. I prefer it to the Helper Field Links module because the link doesn't create any extra space in the inputfield, which is useful when setting the layout of inputfields as I see almost the same interface as site editors will see. Cheers!
    1 point
  18. You can append a variable to the CSS to prevent caching: your.CSS?v=160422
    1 point
  19. Another way you could do this (code style may not be to your taste): <?php $pagesWithImages = $pages->find("filter_image!=''"); ?> <?php foreach($pagesWithImages as $p): ?> <?php foreach($p->filter_image as $filter): ?> <div class="filter-box" style="background-image: url(<?= $filter->url ?>);"> <div class="uk-overlay uk-overlay-hover uk-position-cover"> <div class="uk-overlay-panel uk-position-cover uk-overlay-background uk-overlay-fade uk-flex uk-flex-center uk-flex-middle"> <a class="hover-btn" href="<?= $p->url ?>"><?= $filter->description ?></a> </div> </div> </div> <?php endforeach; ?> <?php endforeach; ?
    1 point
  20. Back to the Tracy logs directory/files permission issue - I have just added a check that prevents the error and warns if the directory is not readable. Still don't know why it ended up that way for you guys, but at least now Tracy will still work and you'll get a message about why it can't show the Tracy log file entries.
    1 point
  21. If I'm not wrong... <?php foreach($page->team as $member): ?> goes hand in hand with <?php endforeach; ?> and allows you to put html code between them, without needing to echo it for instance. It could be that here <ul class="modal-list"> <?php foreach($member->tasks as $task){ echo "<li>$task->description</li>"; } </ul> ?> is missing between } and </ul>. Or that you have to remove <?php NB: I could be wrong, I'm a beginner at PHP...
    1 point
  22. Hey guys, I think a few things in the code examples above need to be moved around. Also, since Repeaters don't know about languages, if you are creating repeater items on your own from the PHP side, you'll have to enable those items for all the languages they are applicable to. I replied on that GitHub issue report, along with suggestions for adjustments to the code.
    1 point
  23. You can do $file->page (http://cheatsheet.processwire.com/files/file-properties/file-page/) so $filter->page->url should work.
    1 point
  24. You can make it work with pagination, but it's a bit different to execute. // This part cannot use pagination, because we need all of john's comments, // but the whole selector construction is cacheable to minimize load // invalidate the cache whenever john does post a comment // optionally you can then also recreate the selector, so the waiting time // does hit John and not other users $johns = $pages->find("template=comment, comment_username=John"); $parents = $johns->explode(function($c){ return $c->parent->id; }); $parents = array_unique($parents); $commentsSelector = array(); foreach($parents as $parent){ $johnsFirstComment = $johns->find("parent=$parent, sort=created"); $commentsSelector[] = "afterjohn=(template=comment, parent=$parent, created>$johnsFirstComment->created, comment_username!=John)"; } $commentsSelector = implode(', ', $commentsSelector); // End cacheable $pages->find($commentsSelector . ', sort=created, limit=10');
    1 point
  25. $johns = $pages->find("template=comment, comment_username=John"); $parents = $johns->explode(function($c){ return $c->parent->id; }); $parents = array_unique($parents); $repliesToJohn = new PageArray(); foreach($parents as $parent){ $johnsFirstComment = $johns->find("parent=$parent, sort=created"); $afterJohnsFirstComment = $pages->find("template=comment, parent=$parent, created>$johnsFirstComment->created, comment_username!=John"); $repliesToJohn->import($afterJohnsFirstComment); }
    1 point
  26. If you are using Google analytics you could easily use it to track your downloads and have nice statistics and setup conversion goals and so on. You would only have to change your template code. No extra fields... easier than it may sound from the docs: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#setting-up-event-tracking
    1 point
  27. Thanks @Mats! The map tiles are designed in Mapbox, the map itself is built on Leaflet.js, using the great Ember Leaflet addon. Once you get the hang of Ember.js (quite a steep learning curve) and it all starts making sense, it becomes really logical and fast to build upon. Because it is so strict, you can predict how components and external addons will work, and how to separate your functions. All using the same philosophy. As a result, it's peanuts to toggle markers and other layers on the map that relate to other items in the application. Let me illustrate how easy it is. The polylines are added by adding a Polyline-layer, which is part of the Ember Leaflet addon. It requires 'locations': an array of lat/lng points. The stripped down version of it works like this: 1. From the API we get, for instance, this JSON for the Hoofdroute (main route) -> http://www.intonature.net/api/routes/hoofdroute 2. Through the default Ember Data Rest adapter this JSON gets loaded into the route* model: // models/route.js import DS from 'ember-data'; export default DS.Model.extend({ title: DS.attr("string"), points: DS.attr("array"), color: DS.attr("string"), }); 3. After the model promise is fulfilled, it renders the Template belonging to the Route*, often with help from an Controller to 'decorate' the data. If that made no sense, you can also read that previous sentence like this: Through the magic of Ember this ends up at the Map Component which is inserted into the Explore template. The stripped down version of the Explore template: {{!-- templates/explore.hbs --}} {{map-component locations=locations currentItem=currentItem currentPreviewItem=currentPreviewItem routes=routes }} 4.And then inside the map component we get the following: {{!-- components/map-component.hbs --}} {{#leaflet-map id='explore-map'}} {{tile-layer url=tileLayer}} {{#each routes as |route|}} {{#if route.points}} {{#polyline-layer locations=route.points color=route.color }} <span class="route-label">{{route.title}}</span> {{/polyline-layer}} {{/if}} {{/each}} {{/leaflet-map}} And that is essentially it. We load the /explore route*, which loads data from the server and puts it into a model, then renders its template. This template contains a component which draws polylines on top of a tile layer. My previous large map-oriented / PW- & RequireJS powered project took overall about 300 hours to develop. In large because I had to invent the wheel, discover fire, and then deal with burning wheels everywhere. In short: I was missing a strict, well defined idea of which part is responsible for which function, something that happens to a lot of developers I have noticed. That, combined with the incredible shitty documentation of the non-standard Google Maps stuff and some other setbacks made it quite a tedious project. (The resulting site is still quite nice though: http://www.vangoghroute.nl ) Developing Into Nature took me around 90 hours, of which maybe half map-related. I still had to figure out a lot, yet I don't think I'll quickly return to the old world of "Php-generated html with bits of Javascript here and there and oh let's throw some more Ajax at it shall we?" * Let me clarify: We are dealing with 2 kinds of routes here. First of all the "Into Nature art routes", and then there are the 'Ember Routes'. Ember Routes are the urls of the app, and responsible for getting data and injecting that data into models.
    1 point
  28. Is the site you refer to above running ProcessWire?
    1 point
  29. Thanks for your answers! The first think i had to do, was enable the url segments. That was unclear for me. I asked a colleague for help. We looked at the example above and get it to work. $download = ($input->urlSegment1 == 'download'); $file = $page->bildarchiv_images; $thumb = $page->bildarchiv_thumb; if ($download) { $downloadFilename = '';// ($page->title).'.'.substr(strrchr($file->$filename, "."), 1); wireSendFile($file->filename(), array('forceDownload' => true, 'exit' => true, 'downloadFilename' => $downloadFilename)); } else { echo '<div id="basic-site-text" class="row content-box">'; echo '<div class="medium-9 columns content-box-column-left">'; echo "<h2>$page->title</h2>"; if($thumb) echo "<a href=\"./download/\"><img src='$thumb->url'></a>"; else echo "<a href=\"./download/\"><img src='$file->url'></a>"; echo "<p><strong>Stichwörter:</strong><br>$page->stichwoerter</p>"; echo "<p><strong>Copyright:</strong><br>$page->copyright</p>"; echo "</div>"; echo '<div class="medium-3 columns content-box-column-right">'; echo "<a id='search_submit' class=\"expanded button\" href=\"./download/\">Download</a>"; echo "</div>"; echo "</div>"; }
    1 point
  30. I've created a little module for that: https://processwire.com/talk/topic/13064-inputfieldfile-image-sorting-autosorting/
    1 point
  31. /** * Send the contents of the given filename via http * * This function utilizes the $content->fileContentTypes to match file extension * to content type headers and force-download state. * * This function throws a WireException if the file can't be sent for some reason. * * @param string $filename Filename to send * @param array $options Options that you may pass in, see $_options in function for details. * @param array $headers Headers that are sent, see $_headers in function for details. * To remove a header completely, make its value NULL and it won't be sent. * @throws WireException * */ function wireSendFile($filename, array $options = array(), array $headers = array()) { $http = new WireHttp(); $http->sendFile($filename, $options, $headers); } Usage $file = $page->filefield->first()->filename(); // or $page->filefield->filename(); depending on your settings wireSendFile($file, array('forceDownload' => true, 'exit' => true)); Example Allow url segments in the template where your button and image exists. $img = $input->urlSegment1? (int) $input->urlSegment1:0; $download = $input->urlSegment2 == 'download'?true:false; $file = $page->filefield->eq($img); if ($download) { wireSendFile($file->filename(), array('forceDownload' => true, 'exit' => true)); } else { echo "<img alt='' src='{$file->url}'/>"; echo "<button><a href='$number/download/'>Download Picture</a></button>"; }
    1 point
  32. Has anyone used this module on 3.X branch? Using 3.0.8 i'm getting stuck on the 'Step 2' screen. It does not seem to grab the fields from the template i want to use for the pages to import. In the screenshot 'menu-item', but i've tried in a number of ways and different parents but no luck. I'm not getting any errors or anything but i get empty field dropdowns. I'm aware that the module does not yet indicate compatibility with 3.X but most 2.X modules i tried worked fine with 3.X. Edit: for (cross)reference, a Github issue has also been made about this by another user. https://github.com/ryancramerdesign/ImportPagesCSV/issues/12
    1 point
  33. Take a look at Netcarver's module. You can also use the JS I posted above, but change the jQuery selector to use the class of your field name instead of .InputfieldHours
    1 point
×
×
  • Create New...