Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/26/2016 in all areas

  1. AdminOnSteroids Various admin tweaks to enhance ProcessWire admin. http://modules.processwire.com/modules/admin-on-steroids/ https://github.com/rolandtoth/AdminOnSteroids
    9 points
  2. GitHub: https://github.com/Toutouwai/TemplatesChildPages For any page, allows the restricting of templates that may be used for child pages. Usage Install the TemplatesChildPages module. The module adds an AsmSelect inputfield "Template restrictions for children" on the Children tab of Page Edit. Use the inputfield to select from existing templates and any child pages added subsequently will be limited to those selected templates. Note that any template restrictions added via this module are in addition to any "Family" restrictions set for the child and parent templates. In other words, if template Family restrictions prevent a template being selected for a given page you can't override this simply by including the template in the parent's "Template restrictions for children" field. Why use this module? The module allows you to add child page template restrictions without having to create new or duplicate templates for the parent page. This forum post explains the situation well. Similarly, it makes it possible to use the "Add New" page feature without an unnecessary proliferation of templates. If you specify a single template as restriction for child pages you can add a Page Add Bookmark for that parent page that allows site editors to easily add a new page using the right template for the location.
    7 points
  3. It's jquery.longclick.min.js at least this is used in my installation. File is minimized and difficult to edit. This is not a recommended path (as I already mentioned), since core upgrade will overwrite your changes. The right path is by using AdminCustomFiles module: install the module, create folder /site/templates/AdminCustomFiles and create the file ProcessPageList.js with something like that: $(document).ready(function(){ jQuery.longclick.duration = 2000; }); Note: written in browser and not tested. Or you could hook on Page::render (in some module or ready.php) and inject the script. Or wait for tpr's module Edit: tpr beat me fast->faster->tpr
    5 points
  4. Add this to /site/ready.php: <?php namespace ProcessWire; // modify longclick duration $page->addHookAfter('render', function ($event) { if ($this->page->template != 'admin') return; $js = <<< HTML <script> $(document).ready(function () { if (jQuery && jQuery.longclick) { jQuery.longclick.duration = 2000; } }); </script> HTML; $event->return = str_replace('</body>', $js . PHP_EOL . '</body>', $event->return); });
    5 points
  5. You need to set jQuery.longclick.duration to override the default value: jQuery.longclick.duration = 2000 I'm working on a module that adds JS tweaks to the admin, including some tiny modules/snippets created by me & netcarver, and this now includes this tweak too. Sneak preview: As you can see there's room for other tweaks so if you have something to add, please tell.
    5 points
  6. Welcome to PW and the forums @JeevanisM The link @Joss pointed you to has exactly what you want...i.e., creating thumbnail grab for pages..see under 'Resizing Images'... foreach($page->images as $image) { $large = $image->width(500); $thumb = $image->size(100, 100); echo "<a href='$large->url'><img src='$thumb->url'></a>"; } Whilst there's still need for better documentation, we certainly don't lack documentation about the basics...the stuff that will get you up and running with ProcessWire...I know it can be confusing at first but ProcessWire is really easy... A bit OT but as a beginner, I personally wouldn't install ProcessWire with a site profile unless I have first read up on how the different site profiles work (tutorials section in the docs). Why am I saying this? Because they contain some functions that really have nothing to do with ProcessWire but are helper functions created to suit those profiles that may confuse you (especially if you don't know what's coming from where). For instance, the renderNav() function you've pointed to. That is not part of ProcessWire but just a helper function created in those profiles. Instead, I would install ProcessWire without a site profile (aka the blank profile), create a blank template file in my favourite text editor and on my second monitor (if you have one ) open the ProcessWire docs about $page and $pages and start playing. Just plain PHP...no CSS and JS . Once I got the basics is when I'd start thinking about displaying cute DIVs . Sorry if I sound brash...just typing in a hurry...+ above is my personal opinion...'horses for courses'...they say..And if you've already gone through the docs, apologies...ignore me... Whatever your learning style, I hope you stay with ProcessWire. I promise you the benefits (once you get over the initial hurdle) far outweigh the initial pain of adjusting to a new system, especially one in which you have to type a bit of code PS; Don't let my post put you off from asking questions, mind...
    4 points
  7. Just wanted to let you guys know that we're moving all of the ProcessWire sites to a new web host today around 12pm (noon), EST. Our new dedicated server is from IBM/Softlayer, and this is going to be a really great upgrade for us. I'll cover more in this week's blog post, but wanted to give you a heads up that things will be switching today and there may be a brief period of down time. I may take the forums down for a bit when the change is taking place so that we don't have messages getting posted on one server and not another while the DNS updates.
    3 points
  8. If your image site_logo is set to multiple files, your code will output the url to the assets folder of the page "/site/assets/files/1/" If your image site_logo ist set to allow only 1 file, your code will output "/site/assets/files/1/logo.svg" If the outputformatting for the page is off, both cases will output "/site/assets/files/1/" So my guess is that on your homepage, somehow output formatting is turned off?
    3 points
  9. Many thanks to both of you! Either solution works well. (It's not possible to mark both posts as Solved...) And again I learnt something...
    3 points
  10. http://modules.processwire.com/ 404 on some CSS here. This is crazy fast, and sets the bar super high. I'm now sad about all my hosting.
    3 points
  11. All switched! Please let me know if anyone runs into any issues. The new server is quite a bit more powerful than the previous, so hoping you might notice a speed difference too–I sure do.
    3 points
  12. PageArray's (as well as it's parent class WireArray) can only hold one dimensional data on their own. You could however try using a WireArray to hold multiple PageArrays.
    2 points
  13. I can see! You should read a bit about the images and our ImageSizer in the docs. What you are currently missing is, how to avoid the images caching. Add "forceNew" => true to your options array while developing. Otherwise you always will get the previously created and cached variation. If you want to compare different options in one go, you also should read a bit about the suffix property.
    2 points
  14. Did you try different sharpening settings? Also that's not really a issue with processwire's imagesizer class, as the actual resizing is always done by external image processing libraries like gd or since 3.0 also imagemagick.
    2 points
  15. I wonder why nobody/Ryan answers here.... No it's not possible. I also ran into it. InputfieldCKEditor.module does configure purifier hardcoded with the allowing the target _blank. Nothing else. But the thing is we can configure the Link Editor to use different targets. But when adding a new one like "_parent", it won't allow it as it's hardcoded. In my opinion the InputfieldCKEditor.module should recognize the target config of Link Editor and add those to the allowed targets.
    2 points
  16. As it happens I was just last night tinkering around with a module for this: info here.
    2 points
  17. Thanks already gotten the idea and will proceed during the weekend, @horst I will definitely use your module as it will speed things up thanks, will update this post when i start working on it.
    2 points
  18. I went down the Elasticsearch rabbit hole and found that there is quite a learning curve. The PW module by Jonathan Dart is a great starting point but think of it as a Hello World demo. To really make effective use of Elasticsearch you need to learn about "mapping" info and indexing your data and you need to get a feel for the way the query language works. It's a big weird tool but it's worth it to get things like stemming.
    2 points
  19. Here’s the news article on my employee’s website which talks about the article: https://www.jambit.com/en/latest-info/news/processwire-alternative-to-wordpress-and-co/
    2 points
  20. This module is deprecated in favor of RockMigrations. It'll continue to work and I might fix some smaller incompatibilities if they're reported, but no major development will happen on this anymore. There where various threads about a how to reasonably handle multiple dev/staging and live environments with ProcessWire and at best handle it as automatically as possible. A git based workflow makes it easy to handle files, but the pain point of migrating db changes has even lead to multiple requests of not handling template/field storage in the db at all. I've gone ahead and used for my own projects the concept of database migrations, which most frameworks are using to handle database changes – but the ProcessWire flavored way. ___ ___ ___ ___ ___ ___ ___ /\__\ /\ \ /\ \ /\ \ /\ \ /\ \ /\ \ /::L_L_ _\:\ \ /::\ \ /::\ \ /::\ \ \:\ \ /::\ \ /:/L:\__\ /\/::\__\ /:/\:\__\ /::\:\__\ /::\:\__\ /::\__\ /::\:\__\ \/_/:/ / \::/\/__/ \:\:\/__/ \;:::/ / \/\::/ / /:/\/__/ \:\:\/ / /:/ / \:\__\ \::/ / |:\/__/ /:/ / \/__/ \:\/ / \/__/ \/__/ \/__/ \|__| \/__/ \/__/ Beta This module does help you managing migration files, where any database changes can be stored in php files using just the simple ProcessWire api at your disposal. It's not as nice as using the admin UI, but certainly better than trying to migrate changes manually and possibly weeks after adding the changes. Also there's always the option to create helper modules, which can export changes made in the admin UI to something usable in those migration files. For example I'm using an internal process module, which does let me export changes to template access rules as json strings, which I then use in my migrations to actually apply the changes. Now on to the meat – How to use the module: Read the following guide on creating own migrations Maybe use the CLI tool to speed up your workflow (and possibly automate stuff) It is generally recommended, but not enforced, that migrations are run/rolled back in order. When doing migrations or rollbacks, without specifying a migration, this module will stick to the order. Creating Migrations Your migrations will probably hold lot's of code, which does delete data. By now this module does not have any security measurements to prevent that. Be sure to test your migrations locally and possibly keep a database backup before running them. There are currently four types of migrations: default (Migration) Default migrations are the most free form migrations. There's just a description and two functions – update() and downgrade(). What you're doing in those functions is totally up to you, but it's recommended to try the best to keep changes as reversible as possible. Meaning that running update() and downgrade() once should have as less effect on the installation as possible. The ProcessWire API is available exactly like in modules using the $this->pages, $this->config, … syntax. FieldMigration TemplateMigration ModuleMigration All of those are there to make your life easier. They all have different but similar functions – which you can find in migrations created by this module – which ease the creation and removal of fields, templates or modules. All the boilerplate is handled by the base classes these migrations do extend, so you don't even need to think about update() and downgrade(). You can rather just describe the item you want to handle and the creation / removal process is taken care of. These are by now not highly tested, so please again be sure to test migrations before running them on important content. Command-Line Interface The module does include a cli interface, which does allow the migrations to be run automatically by CI or deployment scripts or just by you if you like cli's. The cli script is located in the bin directory inside the module's folder. It does however require a composer package to work, which you can simply add by running composer require league/climate in your site directory (or the root directory for pw 3.0). Make sure to require composers autoload.php in your config.php for 2.x installations. The CLI does have a quite handy help page, which you get by running php migrate -h so I'm just adding the important bits of that here: > php migrate -h […] Usage: migrate [-h, --help] [-i info, --info info] [-m migrate, --migrate migrate] [-n new, --new new] [-nf newField, --newField newField] [-nm newModule, --newModule newModule] [-nt newTemplate, --newTemplate newTemplate] [-r rollback, --rollback rollback] Optional Arguments: -m migrate, --migrate migrate Run a specific migration or all new* ones if none given. * From latest migrated to newest. -r rollback, --rollback rollback Undo a specific migration or the latest one if none given. -n new, --new new Bootstrap a new migrations file. Optionally you can already supply a description. -nt newTemplate, --newTemplate newTemplate Bootstrap a new template migrations file. Optionally you can already supply a description. -nm newModule, --newModule newModule Bootstrap a new module migrations file. Optionally you can already supply a description. -nf newField, --newField newField Bootstrap a new field migrations file. Optionally you can already supply a description. -i info, --info info Get detailed info about a migration. -h, --help Show all commands of the cli tool. Link the migrations cli update save to ProcessWire's root: https://processwire.com/talk/topic/13045-migrations/?p=118329 Helper Functions There are already a handful of helper function included in the Migration base class, which tackle things I found to need way to much boilerplate for kinda simple changes, but you can also add own custom helper functions via hooks. /** * This does use @diogo's while loop technique to loop over all pages * without getting memory exhaustion. */ $this->eachPageUncache("template=toBeHidden", function($p){ $p->setAndSave('status', Page::statusHidden); }); /** * $template, $field, $reference = null, $after = true * The below function reads like this: * In the template … add the field … relative to the field … in the position after/before */ $this->insertIntoTemplate('basic-page', 'images', 'body', false); /** * Edit field settings in context of a template */ $this->editInTemplateContext('basic-page', 'title', function($f, $template){ $f->label = 'Headline'; }); And a simple example of adding a custom helper as a hook. // in ready.php $wire->addHook('Migration::renameHome', function(HookEvent $event){ $name = $event->arguments(0); wire('pages')->get('/')->setAndSave('title', $name); }); // in the migration $this->renameHome('Root'); Snippets Still not sure how all this works in practice? Or you want to share a maybe more complex migration? Just head over to the Snippets Repo at Github. https://github.com/LostKobrakai/MigrationSnippets There are also less specific examples in the modules repository: https://github.com/LostKobrakai/Migrations/tree/master/migrations Appendix As long as the module is in Beta the helper functions in the Migration.php might be object to change/removal, so be aware of that. Download http://mods.pw/Bm https://github.com/LostKobrakai/Migrations
    1 point
  21. Just wanted to post it here for others that might look for an example. I'm currently working on importing a Site to PW2.1. Following code I figured is needed to create pages using the Bootstraped API: <?php include(./index.php) // bootstrap PW $p = new Page(); // create new page object $p->template = 'page'; // set template $p->parent = wire('pages')->get('/about/'); // set the parent $p->name = 'mynewpage_url'; // give it a name used in the url for the page $p->title = 'My New Page'; // set page title (not neccessary but recommended) // added by Ryan: save page in preparation for adding files (#1) $p->save(); // populate fields $p->image = 'path/to/image.jpg'; // populate a single image field (#2) $p->images->add('path/to/image1.jpg'); // add multiple to images field $p->save(); // testing echo 'id: '.$p->id.'<br/>'; echo 'path: '.$p->path; Note: in PW 3 with multi-instance support adding new Objects https://processwire.com/blog/posts/processwire-2.6.21-upgrades-comments-more-on-pw-3.x/#more-updates-on-processwire-3.0 [Edit by Ryan #1] Added first $p->save(); [Edit by Ryan #2] Changed $p->image('...') to $p->image = '...';
    1 point
  22. That's something I've already thought of but the way I tried to make it work failed and there were other things to do I'm not sure this module is the best place to make admin theme corrections, but for a temporary solution it could do.
    1 point
  23. Here it is: https://processwire.com/talk/topic/13389-adminonsteroids/
    1 point
  24. ​ On the subject of the docs, I noticed that there is a typo on the following page http://processwire.com/api/ref/page/status/ Under the "See Also" section at the bottom, Page::addStauts() should read Page::addStatus(). Also the link is wrong and should be http://processwire.com/api/ref/page/add-status/ instead of http://processwire.com/api/ref/page/addstauts/ ​ ​I thought I'd mention it here rather than opening another thread.
    1 point
  25. Ideally, this should be in ProcessPageList module config settings ...
    1 point
  26. On pages like the older images doc, there are links at the bottom (RELATED FORUMS THREADS) in the form of: .../index.php/topic,97.0.html Don't know if those were working before the switch, but now they don't. Also I know that we have the brand new Docs, what are very fast growing! Just wanted to mention.
    1 point
  27. Hi Jim, you are right, in the older documentation, there is only the older basic image handling described, but for most of it, you can switch to the new Docs, lately introduced with PW 3 branch, also if you use PW 2.6 / Pw 2.7 Here you go: https://processwire.com/api/ref/pageimage/ https://processwire.com/api/ref/pageimage/size/ https://processwire.com/api/ref/pageimage/suffix/ ...
    1 point
  28. Here is what I see in Chrome and Firefox. As @ottogal says, it shows the error on the home page. Chrome (Main Page) Chrome (Any page other than Home) Firefox (Main Page - Note the Security Warning) Firefox (Main Page)
    1 point
  29. Thank you for the response Horst. I looked into the documentation, yet I didn't find anything concerning sharpening of images. That's why I came here to ask. I will mask this as solved. But could you please be so kind to link me the page in which the sharpening topic is covered? Thank you in advance. Regards, Jim
    1 point
  30. Strange: I'm in Firefox. The Web Developer Tool says the image could not be loaded - likewise in both cases, be it /site/assets/files/1/ or /site/assets/files/1/logo.svg ! (Even if in the second case it is shown on the page...)
    1 point
  31. Okay, please let us know what you have tried and maybe someone can help you resolve your issue. The forum members are eager to help, you just need to provide some detailed information about what it is that you want to achieve. You would be surprised how much can get done, when we all work together.
    1 point
  32. If you wish, but did you read the images documentation I pointed you to? If you have an image field, you can grab the image and then, by using the size function, you can create a thumbnail. This will produce a resized image on loading the page. The new version of the image is stored with the size as part of the file name. $page->image-field->size(100,100)->url That creates the thumbnail and gets the url. So, to create a thumbnail that is clickable for the full sized image. I have overwritten it a bit to make it clear. <?php echo "<a href='{$page->image-field->url}' >"; echo "<img src='{$page->image-field->size(100,100)->url}' >"; echo "</a>"; ?> As you can see, the size command is used to produce a thumbnail 100x100. You can also use the width command to define the width only. It is all in the images documentation, including all the other parameters you can use to control image quality and so on.
    1 point
  33. HTML Purifier is an HTML sanitization and validation module for ProcessWire. It serves as a front-end to the HTML Purifier PHP library. From htmlpurifier.org: Usage: This module is something that you would use from a template file or another module. The syntax basically goes like this: $purifier = $modules->get('MarkupHTMLPurifier'); $cleanHTML = $purifier->purify($dirtyHTML); The default settings seem to be about right for most cases. However, you can also specify custom settings to HTML Purifier by performing set() calls before calling purify(). For example, UTF-8 encoding is assumed, so if you wanted ISO-8859-1 instead, you'd do: $purifier->set('Core.Encoding', 'ISO-8859-1'); About this module: The reason I made this module is that I'm currently working on a CKEditor module for ProcessWire. It supports a very nice inline mode that I'd like to use. But the problem with an inline mode is that the text you edit is real rendered HTML (rather than a textarea), so that could be a security problem (i.e. XSS). I researched into into how best to resolve that, and the HTML Purifier library kept coming up. So here this module is. The new CKEditor module will require it if you want to use inline mode. Download: GitHub: https://github.com/ryancramerdesign/MarkupHTMLPurifier Modules Directory: http://modules.processwire.com/modules/markup-htmlpurifier/
    1 point
  34. Saw some missing CSS files on modules directory too, but a refresh seemed to fix the situation. Could be browser cache, or perhaps something was a bit off with CloudFront after the switch. Not seeing any of those now.
    1 point
  35. Maybe you could change $.longclick.duration using AdminCustomFiles (just guessing, didn't try)?
    1 point
  36. Interesting reading: https://jakearchibald.com/2014/dont-use-flexbox-for-page-layout/
    1 point
  37. there's already this moduly by bitpoet for allowed parent pages: https://processwire.com/talk/topic/12793-template-parents/ i think it would be awesome to be able to select the allowed children on a per page basis. for example one could create a page "tools" on the tree. that page could be of template "item", like many other pages (just a title field). now it would be great to have the possibility to configure the allowed child templates somehow. - tools (item) - tools A (item) - foo X (foo) - foo Y (foo) - foo Z (foo) - tools B (item) - bar 1 (bar) - bar 2 (bar) - bar 3 (bar) at the moment this would need a template setup like this: - tools (items) -> allowing foos and bars - tools A (foos) - foo X (foo) - foo Y (foo) - foo Z (foo) - tools B (bars) - bar 1 (bar) - bar 2 (bar) - bar 3 (bar) i would be interested to hear your thoughts on this
    1 point
  38. running crazy fast here (in the heart of IBM-land)
    1 point
  39. Wow! There is a very noticeable difference here. Everything feels extremely snappy.
    1 point
  40. Noticing a huge difference in speed here; all my earlier issues are gone now and the forum feels extremely slick. Not sure if it's server location or increase in resources, but I'm quite happy with the switch. Twitter feed and at least one profile pic missing, though I guess you're already on that
    1 point
  41. I think you should use the language alternate field approach instead: https://processwire.com/api/multi-language-support/multi-language-fields/#language-alternate-field-values Take a look and came back here to discuss. And for a url like http://www.domain.com/designing-respect/pt/home/ you can use URL segments to detect the language, in your template, and switch to the language fields.
    1 point
  42. Hi, I found this forum thread that you might find interesting. It contains a post by Mr. Cramer himself, It's a little old but still work checking out when you have a chance. https://processwire.com/talk/topic/3118-crowd-fund-new-tutorials/#entry31001 If you haven't seen this already, you might find it helpful : http://wiki.processwire.com/index.php/Small_Project_Walkthrough This one also to help with searching the forums for specific topics / tutorials https://processwire.com/talk/topic/6196-easy-search-on-pw-forums-with-google/ For example, try using this search on Google 'site:https://processwire.com learn php' . You know, the Readme.txt file that comes with the Processwire install in the templates folder? It's actually worth a read Though it has nothing to do with PHP in terms of Processwire, if you are new to programming, and you haven't done so already, I'd suggest you get familiar with debugging techniques pertaining to php. Find some tutorials on on the subject. Xdebug will come up. Look into it, There are also php debugging addons for both Firefox and Chrome. Also have a look at Tracy Debugger http://modules.processwire.com/modules/tracy-debugger/ There are also articles in the PW forums on debugging. Start creating a collection of code snippets for yourself as you go along. It doesn't have to be fancy. Just something you can go to when you need an example of how you coded something in that past. Might save you a little Googling time. Lastly, try to get in the habit of writing what is usually referred to as 'clean code'. Use comments wisely. Don't leave dead/unused code in a module. It only clutters things up and is a distraction. Take the extra time to give variables meaningful names.. etc etc. Nothing sucks worse than having to go back to something you yourself wrote, say 6 months ago, and you find yourself staring at the screen silently cursing yourself out, because you can't remember what you were trying to accomplish. Bottom line - Google on 'Writing clean PHP code' and go from there. Best wishes on your coding endeavors.
    1 point
  43. Hi, 1. Is PW 3.x compatible with PHP 7? I"m not yet using PHP7, however ProcessWire 3.x runs on it and I've been reading reports in the forum to confirm it. But watch out for modules you might have that might have trouble running on it, e.g.: https://processwire.com/talk/topic/9507-php-7-coming-soon/ 2. Would you recommend PW 3.0.18+ in production? E.g. is it too "dev" or already "prd"?) Probably it also depends on the modules you use, such as anything not compatible with the new ImageField module: https://processwire.com/blog/posts/major-images-field-upgrade/ 3. Any known PW-related issues with migration from myisam to innodb? Here is the related blog entry: https://processwire.com/blog/posts/pw-3.0.15/ Older post from Ryan: https://processwire.com/talk/topic/10287-database-scheme-includes-no-foreign-keys/#entry97876 4. Pros/cons of switching to nginx + mysql + php-fpm? (apart of lack of support, e.g. need to maintain config manually with each upgrade) Never used it, so I skip this one
    1 point
  44. This post describes a bit where it comes from: https://processwire.com/talk/topic/12151-wire-queue-basic-implementation-of-simple-queues/#entry112809 @Sephiroth: if you find it useful in general, I can assist in extending / building a sqlite version that suites your needs. (define more finegrained sqlite table fields and fetching batches of a given number recipients at once, for example 100)
    1 point
  45. Glad to hear that. If some of you guys are using it I'd really like to hear your thoughts or issues.
    1 point
  46. https://processwire.com/talk/topic/12830-reaching-the-limit-of-pocket-grid-css/#entry116610
    1 point
  47. Well, it's not THAT easy. Check here: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-14-04 I suggest you read about the way ElasticSearch works to understand what is possible and what is not, and how to adapt it to your needs. It seems easy, but it a mighty thing and as such can easily cause more trouble than it's worth.
    1 point
  48. Looks great, Benjamin, thank you! I have not tried this yet, but look forward to doing so. Could your module check if ProcessDatabaseBackups is installed? If it is perhaps it could take care of either backing up the DB or at least reminding the user to do so, before it performs a migration.
    1 point
  49. Ryan on fire.... Love it !
    1 point
×
×
  • Create New...