Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/05/2017 in all areas

  1. FieldtypeFileS3 https://github.com/f-b-g-m/FieldtypeFileS3 The module extends the default FieldtypeFile and InputfieldFile modules and adds few extra methods. For the most part it behaves just like the default files modules, the biggest difference is how you get the file's url. Instead of using $page->fieldname->eq(0)->url you use $page->fieldname->eq(0)->s3url(). Files are not stored locally, they are deleted when the page is saved, if page saving is ommited the file remains on the local server until the page is saved. Another difference is the file size, the default module get the file size directly from the local file, while here it's stored in the database. There is an option to store the files locally, its intented in case one wants to stop using S3 and change back to local storage. What it does is it changes the s3url() method to serve files from local server instead of S3, disables uploading to S3 and disables local file deletion on page save. It does not tranfer files from S3 to local server, that can be done with the aws-cli's through the sync function. Files stored on S3 have the same structure as they would have on the local server. -------------------------------------------------------- -------------------------------------------------------- Been struggling with this for quite a while, but i think i finally managed to make it work/behave the way i wanted. All feedback is welcome!
    6 points
  2. Ok, here's a screenshot showing the tooltip that indicates double-clicking the "Tracy" icon opens the module settings. Currently it opens the module settings in a different tab. I am not usually a fan of this, but in this case where we are using double-click and there is no way to user initiate a new tab, I think this is best for now. I'll commit along with the new console history/snippets stuff - hopefully shortly
    3 points
  3. Field import/export is even in recent processwire versions declared a beta/experimental feature to be used with care. So while this might sound harsh your issue is not more of an security issue than any other one a developer might introduce by uncareful actions. Especially the more complex fields like repeaters / pagetables are prone to miss-matches for some of the plain id values they're using, which is probably the no1 reason, why the feature never made it into stable form by now. The things to consider on processwire's side would be to make the import process customizable by fieldtype so that the repeater fieldtype can force an update of the parent_id on import. This can only work for repeaters, as the parent pages are not user changeable. The other thing to consider would be to make the pagefiles directory be lazily created, so that pages without actual files do not create directories. This wouldn't have prevented your infinite loops, but at least the part of filling up all your disk space.
    3 points
  4. Hhm? Weird. All three modules are set to Version 0.9.17 since weeks/month now. I have updated the directory entry manually now.
    3 points
  5. If you don't need the links as such in the source HTML, you could also consider using TextformatterMakeLinks.
    2 points
  6. Hello Zilli, you should be able to echo the title of the current language like this: echo $user->language->title; You can set the title of the language under Setup->Languages in the backend. Best, Nils
    2 points
  7. Actually the link to Github from that post is out of date. This is the current version of the module for PW 3: https://github.com/horst-n/CroppableImage3 @horst - looks like there is something a little weird with the module directory: http://modules.processwire.com/modules/croppable-image3/ It is showing that the module hasn't been updated since September 2, 2016. Any ideas?
    2 points
  8. TextformatterTypographer A ProcessWire wrapper for the awesome PHP Typography class, originally authored by KINGdesk LLC and enhanced by Peter Putzer in wp-Typography. Like Smartypants, it supercharges text fields with enhanced typography and typesetting, such as smart quotations, hyphenation in 59 languages, ellipses, copyright-, trade-, and service-marks, math symbols, and more. It's based on the PHP-Typography library found over at wp-Typography, which is more frequently updated and feature rich that its original by KINGdesk LLC. The module itself is fully configurable. I haven't done extensive testing, but there is nothing complex about this, and so I only envisage a typographical bug here and there, if any.
    1 point
  9. The Console Panel now has a History stack and a separate Snippets stack! Hi everyone - this has been a long time coming. It was originally suggested by @bernhard back in early November. I want to thank @bernhard for the idea and feedback on draft versions, and @tpr who has contributed many ideas, style suggestions, and code to this functionality - sincere thanks to both of you! Snippets are automatically saved to the tracy config settings entry in the modules database table so that they are available on other browsers/computers have a dedicated save button - they are not saved automatically when running code save button only available when loaded snippet code is different from saved version so you know whether you have made changes has the ability to sort alphabetically or chronologically (date modified) no limit of number of snippets stored snippets can be deleted - a ✖ icon appears when you mouseover a snippet in the list History items are saved to local storage automatically saved when you "run" code comes with "Back" and "Forward" arrows for moving between history items currently stores maximum of 25 items - let me know if you think this needs adjusting Some other miscellaneous changes when running code, output is now appended to the results panel (like your browser dev console) you can used ALT/OPT+Enter keyboard shortcut to Clear and Run the "Clear" button now clears the results panel, but leaves the code intact Future ideas ability to easily export/import snippets to stack your ideas Please let me know if you come across any bugs or weirdness with anything - it's still pretty early stages!
    1 point
  10. Yes, I don't have that panel enabled. I use the Panel selector and occassionally enable the panel I need (Console, Validator). It's maybe only me but the Panel Selector is the "Control Panel" of TD I could imagine double-clicking on the "Tracy" icon to go to the module settings page.
    1 point
  11. If you're using AdminOnSteroids the Auto Link plugin is available in the CKEaddons submodule.
    1 point
  12. Hi, The following code works for me: foreach($languages as $language) { $selected = ''; // if this page isn't viewable (active) for the language, skip it if(!$page->viewable($language)) continue; // determine the "local" URL for this language $url = $page->localUrl($language); // if language is current user's language, make it selected if($user->language->id == $language->id) { $url = "#"; $selected = " class='current'"; } // output the option tag echo "<li$selected><a href='$url'><span>$language->title</span></a></li>"; } Hope this works for you too -Harmen
    1 point
  13. @netcarver I'm finding that the script is timing out on a large site I'm working on (there are ~1800 pages). I've tweaked the code to only find pages in which the found fields are in use and are not empty: ... // collect fields and cropsetting names $collection = array(); echo "<ul>"; foreach ($fields as $f) { if ($f->type != 'Fieldtype' . $oldFieldtype) { continue; } $collection[$f->name] = array(); echo "<li>{$f->type} : {$f->name}</li>"; $thumbSettings = preg_match_all('#(.*?),.*?\n#msi', trim($f->thumbSetting) . "\n", $matches, PREG_PATTERN_ORDER); if (!$thumbSettings) { continue; } $collection[$f->name] = $matches[1]; echo "<ul>"; foreach ($collection[$f->name] as $suffix) { echo "<li>{$suffix}</li>"; } echo "</ul>"; $field_names[] = $f->name; } echo "</ul>"; echo "<hr />"; $pages_visited = 0; $images_visited = 0; $variations_visited = 0; $variations_copied = 0; // now iterate over all pages and rename or copy the crop variations echo "<ul>"; $selector = implode("|", $field_names) . "!='',include=all"; $found_pages = $pages->find($selector); foreach ($found_pages as $p) { ...
    1 point
  14. Another strange Apache+mod_security issue perhaps?
    1 point
  15. Hi @horst haven't tested with newer version. Let us test and confirm.
    1 point
  16. Hi @zervis, you could try $pages->findMany("template=user"); or $pages->findMany("role=user"). I tested this with normal PW users and $pages->find(), but it should work with findMany, too. Another way could be: $pages->find("template=user", ["lazy" => true]) see here for options, but I didn't tested that.
    1 point
  17. Important: The behind-the-scenes library can be quite resource heavy. As mentioned in the module's configuration, it's highly recommended that you cache your templates or use ProCache. Users of the WordPress plugin are also advised to use Super Cache, and so there's not much I can do about this.
    1 point
  18. Bumped to 0.2.0-beta: Switch from the old PHP Typography library to the newer, more frequently updated library found at wp-Typography. This adds several features that are now being used in the module. Some features are not working correctly for me, and so I have excluded them. Soon, I'll do a complete tear-down to see what works and what doesn't. Config no longer allows the textformatter to be disabled. If you want to turn it off, rather remove it from your field. Config no longer allows to reset to defaults. A different implementation of this may be added in the future, if deemed required. Stylesheet is no longer provided as a function for the purposes of not being opinionated. There is, however, a stylesheet in the module's directory, which can be used as a basis for your main stylesheet. You will also notice that the stylesheet references new classes. Due to the fact that this fork of PHP-Typography uses hanging punctuation, new classes have been added. However, they retained the original naming for single and double initial quotes. As this is a new module for PW, I thought it sensible to change these names. All the new class names are in the stylesheet, and also in the Typographer subclass.
    1 point
  19. How about adding a link to the Tracy module settings page to the Panel selector panel?
    1 point
  20. The slightly longer version... where (200,200) means an image width 200px in width and height, croped from the center. (200,0) would result in an image 200px in width and whatever results in the height A good starting point would be the doc to the fieldtype images
    1 point
  21. Hi! If you have an array of images, try this: $child->image->first()->url $child->image->first()->size(200,200)->url
    1 point
  22. One way of doing it would be: foreach($pages->find("parent=recommendations") as $child){ echo $child->title; } but there are many more ways to accomplish that goal. Best starting point would be to read the docs of selectors
    1 point
  23. Edit: Feature has been removed. See next post. Bumped to 0.1.1 and added styles(): <?= $modules->get('TextformatterTypographer')->styles(); ?> Outputs the following default style-set: span.caps{font-size:96%} span.numbers{font-size:96%} span.dquo{margin-left:-.41em} span.squo{margin-left:-.06em} To configure this, add a config array as the first parameter. For caps and numbers, Typographer will detect if you're specifying a string or integer-based value and name the property accordingly: <?= $modules->get('TextformatterTypographer')->styles([ 'caps' => 'Charter SC', // some fonts don't render well when their font-size is changed, so using a small caps font is better. 'numbers' => 'Charter SC', 'dquo' => '-.29em', // depends on your font ]); ?> This outputs the following: span.caps{font-family:'Charter SC'} span.numbers{font-family:'Charter SC'} span.dquo{margin-left:-.29em} span.squo{margin-left:-.06em} Or, you could well use your own stylesheet. Also, I haven't done anything about ampersands. Not many people style those, and so there's no sensible default. (GitHub)
    1 point
  24. Works fine for me in an auto-load module in ProcessWire 3.0.42 using the code below. All fields are saved correctly, both page and non-page fields. public function init() { $this->pages->addHookBefore("FieldtypeMulti::savePageField", $this, "hookBefore"); } public function hookBefore(HookEvent $event) { $page = $event->arguments[0]; $this->newPage($page);// calls method to create new page $this->message("we hooked into page with id: {$page->id}"); } public function newPage($parent) { $p = new Page(); $p->template = 'basic-page'; $p->parent = $parent; $p->title = 'Test Child Page'; $p->save(); }
    1 point
  25. I was not aware of this section's existence, and since I've submitted a number of sites to the site submission page, I thought it may be good to post them here, too. So, over the past couple of years I've been using ProcessWire, I've had the opportunity to build a decent number of ProcessWire websites. I initially didn't like the idea of using ProcessWire when I was first required to use it, but I soon came regret even thinking that - ProcessWire is now my favourite CMS! Here are some sites where I've been the primary/sole developer (I must say, I did not design these sites, I just turned the designer's visions into reality: PROGRESS: A Creative Agency This is the second iteration of the company I work for's website. it was built to reflect our amended brand identity and scope as an agency. Hilton Extraordinary F&B This website is access only, so you will be unable to see the site in action, however, I have linked to our case study on our website which has some screenshots. Note that the app is being discontinued, since they want a single sign on system. So for one, it just wasn't going to be simple to do the SSO system on the app. And two, the app was kind of pointless anyway, and they just fell for the old "we need an app for that", when a responsive website is just fine for their needs. The Extraordinary F&B site also protects many important static files by restricting access to them, and using Apache X-SendFile to allow access to them when the user is authorised. TY Logistics This website is four a courier company based in the UK. The animating lines was fairly challenging, but I got there in the end. The animating lines work by generating an SVG path string on the fly, using various elements as reference points, setting the stroke-dasharray and stroke-dashoffset to the path length, and then animating stroke-dashoffset to zero. It utilises ScrollMagic for managing the scroll-based animations. Guy Hollaway Architects This website was built for an architects based in London and Hythe, UK. Folkestone Harbour Arm This was created to list events and information about the newly refurbished and converted Harbour Arm in Folkestone, United Kingdom. Unfortunately, there are no events on the site right now, which makes some areas look rather bare. However, there is a screenshot available on the page for this site on the sites directory. Visit Romney Marsh This was a budget-wise project to promote the Romney Marsh in the south-east of England. It features a Google Maps integration for the listing of attractions and accommodation. And has another, very similar map for events on and around the Romney Marsh. Hythe Care Homes This has to be one of the coolest care home websites I've seen! We developed a site for Hythe Care Homes, a care business consisting of three separate homes for old-aged people. More to come soon when I have time. On my lunch break right now, you see.
    1 point
  26. Wanted to mention that there's a new dev version https://github.com/somatonic/Multisite/tree/dev2 that we are testing and using right now. It was tested and works with multilanguage and PW3 various features.
    1 point
  27. Sorry if this is mentioned well elsewhere, but just in case not and in case someone else might find it handy, this example helped me, in a few minutes, get emails sent out, with custom messages, when certain pages were saved. https://processwire-recipes.com/recipes/extending-page-save-process/ I am repeatedly amazed by the elegance and power of ProcessWire... To Ryan and all fellow PWers—THANK YOU.
    1 point
×
×
  • Create New...