Leaderboard
Popular Content
Showing content with the highest reputation on 11/23/2014 in all areas
-
Pia - Pageimage Assistant Hello, today I can tell you that Pia Ballerina want to assist you with Pageimages and that can become really helpful! . . . Pia, in its current state, version 1.0.0, provides: a GUI (the module config screen) for quick and easy changes to the sitewide Pageimage default options an alternative way for calling the Pageimage resizing methods with PW selector strings three new methods as shortcuts to the resizing functions a new method called retinafy and its alias hiDPI, (introduced in version 0.2.0) . . . 2) Instead of ->width(), ->height(), ->size() you can call ->pia() now. With a PW selector string you tell Pia what image variation you want to have : . $image->pia("width=100, quality=80, sharpening=medium")->url; . If you want process ->width() just define width. If you want process ->height() only define height. If you want process ->size() just define width and height. If you want process ->size() with equal values for width and height, just define only size, or use the alias square: . $image->pia("width=480")->url; $image->pia("height=320")->url; $image->pia("width=400, height=300")->url; $image->pia("size=350")->url; $image->pia("square=350")->url; . So, yes, - I see. Now you may think: "Ok, nice looking girl, - and she can dance very well, - but for what should it be good that she is involved here? My very old buddies width, height and size - and me, - we don't need any Ballerinas between us!" . Yeah, I see what you mean. But this above is not what Pia is good for, this is just a little warming up for you. . In some cases one need to specify more than just width and / or height. If it comes to that you need explicitly populated options with the individual pageimages, Pia will become faster and more comfortable at some point. Also the code is looking more readable with Pia, at least to me: . // regular style #1: $image->width(800, array("upscaling" => false, "cropping" => true, "quality" => 80, "sharpening" => "strong")); // or regular style #2: $options = array("upscaling" => false, "cropping" => true, "quality" => 80, "sharpening" => "strong"); $image->width(800, $options); // now lets Pia dance: $image->pia('width=800, upscaling=0, cropping=1, quality=80, sharpening=strong'); $image->pia('width=800, upscaling=off, cropping=on, quality=80, sharpening=strong'); . For me it is that not only Pia begin to dance, my fingers do so too when writing selector strings instead of the regular array code. . Ok, last thing before we can go to stage: "You already may have noticed that Pia accepts few different values for boolean expression, yes?" for TRUE you can write these strings: "1, on, ON, true, TRUE, -1" for FALSE you may use one out of "0, off, OFF, false, FALSE" Ready? Ok, lets go to stage. . . . 3) Pia provide three new methods as shortcuts. This means that when using one of the shortcuts you have pre-populated options, regardless of the sitewide default settings: crop :: does what the name says contain :: is equal to the regular method: ->size($width, $height, array("cropping" => false)) cover :: this, Pias third child, is a new kid on the block . Let's have a closer look and compare it. We use Pias image from above as source for this example. (It's dimensions are 289 x 400 px) . . * crop $image->crop('square=100'); . it is 100 x 100 px and the name is: pia-ballerina_titel.100x100-piacrop.jpg . . . * contain $image->contain('square=100'); . it is 73 x 100 px and the name is: pia-ballerina_titel.100x100-piacontain.jpg . . . * cover $image->cover('square=100'); . it is 100 x 139 px and the name is: pia-ballerina_titel.100x139-piacover.jpg . . . Ok, you got it? . "Crop" crop out the area, "Contain" fits the image into the area, and "Cover" calculates the needed dimensions for the image so that the area is completly covered by it. . Following is a link with lots of those crop-, contain-, cover- variations. I have stress-tested it a bit: much variations . ---------- . . Later Additions: . * contain with option weighten Since version 0.0.6 contain can take an additional param called "weighten". (read more here) . . . * retinafy Since version 0.2.0 retinafy is added. It returns a markup string, e.g. a HTML img tag, where placeholders are populated with property values from the pageimage. Default properties are: URL, WIDTH, HEIGHT, DESCRIPTION. The method also can take an optional array with CustomPropertyNames. You also can use the alias HiDPI if you like. (read more here) . . ---------- . . You can get the module from the modules directory or from the repo on Github: . git clone https://github.com/horst-n/PageimageAssistant.git your/path/site/modules/PageimageAssistant . . Bye! . Classical ballet performance at the Aalto Theatre in Essen, in the context of the Red Dot Award ceremony 26 June 2007, Act III, Sleeping Beauty, the wedding reception Photos: Horst Nogajski - www.nogajski.de18 points
-
5 points
-
Hi guys am a complete Noob to Processwire and i have spent the past two weeks reading codes and understanding the structure and concept around it. So i am the type of dev who obesseses about architecture structure before getting to work, and i think my mind is broken due to my limited knowledge on PW. So i will expain my goal. I intend to rebuild http://styljunki.com from Wordpress to Processwire because of two reasons. 1. PW has no templating system meaning no hacks like shortcode or mundane template conventions. 2. Modules dependency meaning i can leverage on existing modules (easily) e.g wire('moduleName')->method this really appeals to me alot However there are certain tasks i want to achieve. Concept of Blog vs Pages There are some contents which are Post and some which are pages, is there some such dinstinction in PW, I know PW manipulates pages and adds fields but what of Blogs which just take entry and nothing special, I tried my hands on the Blog Module on PW 2.5.8 but it threw some errors. Menu Management My Client intends to manage menus and from what i have seen ; PW lists all the pages, we were looking for something where we can simply create menus for the front page and we simply pick those. But if there's a module around I am willing to use/ contribute code if it is neccessary. Custom Post In Wordpress you can create a custom post and query that, is there any similar thing to that ? Unit testing PHPUnit Testing in WordPress was a big joke, is there any link to unit test processwire while we work Thanks this are my questions NOTE: Also i'd really like to say congrats because, I have spent the 4 years of my life developing with CMS from Joomla,WordPress,ImpressPages and really this is the first time i am really excited about a CMS. Working with WordPress as a CMS is a pain in the ass, esp for someone used to MVC frameworks like Zend and Yii. I have searched and searched till i came across your site on CMSCritic and Joss Salinger 's post the rocker blogger (rock on) on how easily he could use it despite no coding experience. I intend to contribute in my way. Keep up the good work guys. Love from Nigeria4 points
-
Just committed little update - added support for adding custom services via site config - some minor fixes and improvements - added config for what fields module searched on {title} and {text} placeholder fields - added placeholder field „media“ => pinterest - added services tumblr, reddit (off by default) and pinterest (off by default) - updated themes with {themeUrl} - updated readme4 points
-
Needed to show someone how to quickly setup some settings for various things in a simple text area: could be used for slider settings, site settings, etc; What it does: gives you a matching variable for each key of each line... 1.) setup a textarea field for the settings ; i'm calling it settings_ta 2.) add delimited settings, 1 per line; i use a pipe (|) delimiter; example: address|some info here facebook|https://www.facebook.com twitter|https://twitter.com phone|(999) 999-9999 3.) in your _init.php, get the settings - replace the page number and the name of your settings field: $settings_ta = $pages->get(1644)->settings_ta; $settings_lines = explode(PHP_EOL, $settings_ta); foreach($settings_lines as $settings_row) { $settings_pair = explode('|', $settings_row); ${trim($settings_pair[0])} = trim($settings_pair[1]); } more condensed version, for those of you who like brevity... foreach(explode(PHP_EOL, $pages->get(1644)->settings_ta) as $settings_row) { $settings_pair = explode('|', $settings_row); ${trim($settings_pair[0])} = trim($settings_pair[1]); } now you can do this in your templates: echo $address; echo $facebook; echo $twitter; echo $phone; Edit: made the code simpler....; 2nd edit - added trim to support using ace editor with tabs Addendum: as an added convenience, you could use the Ace text editor module which would give you a monospaced text field and the ability to use tabs for your settings, which could be more readable and easier to edit. The code has been updated to support this by trimming the exploded strings prior to generating the variable/value. address | some info here facebook | http://www.facebook.com twitter | http://twitter.com phone | (999) 999-99993 points
-
Yep, OP was referring specifically to D8 I tried D7 soon after its release, wasn't too thrilled by the experience (Found the theming experience appaling) However the changes introduced with D8 seem to be pretty massive, and cover some really interesting stuff - especially the adoption of a php-framework and the support for webservices. I suppose I'll just have to try it and see for myself ^^3 points
-
I believe that OP was referring specifically to D8, and how it relates to PW. According to the Drupal team, they've changed a lot since D6-7, so I don't think it's such an unreasonable question to ask, and personally I'd love to hear some proper insights on the matter -- preferably from someone with solid D8 knowledge, not just past experiences with earlier versions Taking a look at the D8 marketing materials, it seems like they're going to a good direction. Some of their new features I like, some I don't like, but in the context of Drupal they probably all make sense. Either way, it seems to me that much of what they've been adding ProcessWire, one way or another, already provides. The way they're touting HTML5, mobile first, etc. makes me think that the markup generation part, which is one of the biggest problems (in my opinion), might not have changed much either. The developer API and theming system still seem complicated to me, but I'm used to working with custom applications, application frameworks and ProcessWire specifically, so my views are probably biased. It also seems that these are very much separate entities, quite unlike how it works in ProcessWire, where the API is a key to everything, everywhere. Anyway, this is exactly why I'd love to hear some unbiased opinions3 points
-
MarkupSocialShareButtons This module outputs a list of share links for the following services by default * E-Mail (kinda extra) * Facebook * Twitter * Google+ * LinkedIn * Thumblr * Reddit (off by default) * Pinterest (off by default) Usage examples echo $modules->MarkupSocialShareButtons->render(); This outputs a simple UL list with links <ul class='MarkupSocialShareButtons cf'> <li class='mssb-item mssb-facebook mssb-popup'><a href='url'><i>facebook</i></a></li> etc ... </ul> Config Screen See more details and examples on github or modules directory https://github.com/somatonic/MarkupSocialShareButtons http://mods.pw/8j2 points
-
You can make your custom sharing widgets using sharrre and PW.. doesn't take long! 1.) Download http://sharrre.com/ 2.) put sharrre.php in templates 3.) put jquery.sharrre.min.js in your scripts folder. 4.) add the new template to PW 5.) add new hidden page using that template; call it anything (example 'sharrre') 6.) include the script in your output; 7.) in your custom js file setup your js; make sure to put in the correct urlCurl to your page using the sharrre.php for example: /*-----------------------------------------------------------------------------------*/ /* SHARRRE /*-----------------------------------------------------------------------------------*/ $('#shareme').sharrre({ share: { twitter: true, facebook: true, googlePlus: true }, urlCurl: '/sharrre/', template: '<div class="box"><div class="left">Share</div><div class="middle"><a href="#" class="facebook">f</a><a href="#" class="twitter">t</a><a href="#" class="googleplus">+1</a></div><div class="right">{total}</div></div>', enableHover: false, enableTracking: true, render: function(api, options){ $(api.element).on('click', '.twitter', function() { api.openPopup('twitter'); }); $(api.element).on('click', '.facebook', function() { api.openPopup('facebook'); }); $(api.element).on('click', '.googleplus', function() { api.openPopup('googlePlus'); }); } }); Note: there are other themes - see the website... grab the CSS that goes with this JS setup: http://sharrre.com/example2.html 8.) somewhere on your page, put the relevant markup: <div id="sharrre"> <div id="shareme" data-url="<?php echo $page->httpUrl?>" data-text="Share this page"></div> </div> works for me on 3 sites so far.. - - - N.B. There is now a comprehensive module for social sharing buttons by Soma which is probably easier to setup and more flexible, though using Sharrre can still have some applications. Also, it is possible that Sharrre is no longer maintained and may not still work without some intervention... not sure as I have not researched this issue..2 points
-
Not our first ProcessWire powered website, but definately our most interesting one so far: http://www.rabotheater.nl At Itix we build and maintain online ticketing software for theatres and cinema's. About 30 theatres across the Netherlands are powered by Itix. Our software has some form of integrated content mangement, but this "CMS" does not live up to current standards and client wishes anymore. We decided to move all frontend related content to a PW environment. Eventhough most data still exists within Itix, all website-specific enrichment is done within ProcessWire. PW gets it's data through export/imports (for complete datasets) and a method of triggering events, filling a jobqueue and updating specific single items. Rabotheater is our first client moving to a PW powered website, but I'm confident many will follow. http://www.rabotheater.nl2 points
-
2 points
-
Hi @Sephiroth, Welcome to PW and the forums. I am sure Joss is writing a long post right now to answer your questions ...(edit: he just did) About this: Can you confirm if you are really talking about the Blog (Site) Profile rather than the Blog Module? if the latter, what errors did you get? The Blog Module works fine for me even in 2.5.9. PHP Unit Testing: There was something in the works but I don't know the current status - https://processwire.com/talk/topic/2609-tests-for-processwire-core/ Menu Management: There is nothing out-of-the-box that the client themselves can (should?) use. A while back I did a proof-of-concept Menu Builder but never got it finished. However, there are other ways to achieve this. One way is to set up (yes, you guessed it), a 'page' field that you can attach to some template where a client can select pages that he/she wants to appear in a menu. A second similar option is to set up a 'checkbox field' that you attach to the template of pages that can potentially appear in a menu. Every time the client edits such pages they can tick the checkbox to enable (or disable depending on how you code it in your template file) that page to appear (or not appear) in a menu. Custom Post: Don't use WP so I don't know what this is. Maybe explain a bit more? Edit: OK, just read this: Given Joss' explanation above about pages, I think that answers your question. Really, in PW everything is custom. PW doesn't care what you call them . You will probably get a better explanation...2 points
-
Okay, I will address the Pages issue - I am somewhat famous for it! To start: https://processwire.com/talk/topic/2296-confused-by-pages/ And once you have that out of your system, here is the real info. Basically, a page in Processwire is just a container for content - nothing more. So, it could be a: Web Page News Bullitin Block of info Some strange widget An option for a dropdown selector A gallery item A review Something that gets stuffed into something else! A parent of some other group of pages, A child of something Basically, it is just an item that is created using the criteria of a template. It does not need to have a template file associated with it - if you are using it as a simple option in a drop down, what would be the point? Fields from a particular page can be called into another template or page or anything else, either singularly or rendered as a group. The contents of a page need a template file to be displayed on the site as they are, but not if they are being displayed by something else. Confused? The bottom line is don't think of a page as a "page" that you would get in Wordpress - just think of it as a container for data that can be used for anything at all. This is why Processwire is a TRUE content management system - because all the elements are simply tools to help you manage content, they do not force you to make your content any particular shape.2 points
-
Sorry to cause confusion. Basically I was telling another member that the subject was closed, rather than I was going to technically close the thread - it does not really warrant closing the thread. A wonderful case of idiomatic British meets international forum speak. I am happy to continue chatting about the very basic and simple idea I first proposed, but I will not be discussing a long-winded, over complicated, over centralised system that no one has time or inclination to manage. That should be discussed in another thread should people be interested.2 points
-
2 points
-
2 points
-
Sorry for the inconvenience. We fixed this earlier today. This only affected the creation service (the background runner creating the site) and not the global login or the sites itself. In more detail, we've updated the server 3 days ago but forgot to restart an intern service. This caused the creation process to fail. We failed to test this and only noticed after three days. Added "Create a site and login once" to our update checklist.2 points
-
Thanks for your kind comments. The Jobqueue resides mostly outside of Processwire, firing requests to a URL which updates PW's pages. The receiving end gets the data and uses PW's api to insert, update or unpublish pages. In order to offload peak-moments we decided to implement a queue. Imagine an import is done in our ticketing software; this would fire thousands of events to ProcessWire if we didn't use a queue to balance requests. At the moment all is running well, but theatres tend to create a hype when the new season starts and visitors will come in masses, wanting to get the best seats for their favorite shows. It will be interesting to see how ProcessWire will cope during this period. We intend to do some performance testing in the near future. The website is running without cache at the moment, but we may end up using ProCache or a proxy cache to keep server requests at a minimum. All user-specific content is gathered (cross site) with Ajax, thus Proxycaching or Procache are still possible. Modules we have used include Form Builder, Template Twig Replace (and data provider), Lister (which makes the backend far more user-friendly, great addition!), Ajax Search, Image Cropping, Profields, Batcher... and many more Aye, apparently he does2 points
-
Am I right in thinking that multiple hooks that are added for the same event can be prioritised by doing something like this... $session->addHookAfter( 'login', $this, 'myLoginHook', array('priority'=>xyz) ); Where xyz is the relative priority for the hook and the lower the value, the earlier it will be called as the hooks are executed?1 point
-
Hi, After the move to ProcessWire on one of our major websites, I had to build myself a module/plugin so I could use the Amazon S3 / CloudFront infrastructure. The module/plugin uses Amazon S3 PHP SDK and the idea was to provide a clean way to upload/backup files to S3 and distribute the assets via Cloudfront. The current version of the module/plugin will copy the page files to Amazon S3 so you can then serve the via Cloudfront automatically. Note that the files are still also copied to the server where your PW installation resides. There's an option to backup the deleted files to another folder on S3 because when you delete a file on PW via the admin, the file is also deleted from it's folder on S3. The module also supports Apeisa's Thumbnail module so it also stores the thumbnails on S3. Note that the native size() method to create image thumbnails on S3 is currently not supported. As it is, the module will only upload new assets, so beware that if you already have pages created with assets you'll definitely have errors, so my advice is to test this with a blank installation of PW. If anyone wants to test it and contribute to it, I think this provides a good proof of concept for a functionality that is requested by several users (me included). Please note that I'm not a PHP developer, my skills (very) limited and I'm aware that it can be improved and I'm open to suggestions, feedback and most of all, collaborators. The module is hosted on github here and it's available in the ProcessWire modules directory. Nelson Mendes1 point
-
$pages->get will not use check_access: $pages->get("template=shop-cart, user=40, session=6b53ec96ea298445183c269bf0d51d54, cart.product=1035, include=all, check_access=0")->id So sounds expected behaviour to me, as cart.product=1035 performs a find in the scope of the current user. And that find isn't allowed due to access rights. little note: When you do a find (not get) and use include=all there's no need to call check_access=0 as that is assumed by that.1 point
-
1 point
-
1 point
-
Hi tinacious, Does wrapping your call to strftime() in utf8_encode() fix this for you? Like this... $formatted_date = utf8_encode(strftime($strings['date_format'], $page->date));1 point
-
Sorry for writting this without actually downloading and trying out your module, but does it allow to add other (custom) social services?1 point
-
1 point
-
It is incredible how it is in this PW forum, You go to sleep, you wake up, turn the computer on, and you find another jewel! It is all around the globe so magic just never stops! It is like a new year every day with presents under the tree. Thank you, mr. Horst! And something on the substance: 1) It would be usefull in many cases (at least for me) to have a 4th method, which would act like contain, but would fill with adjustable color spaces to the left and right (or to the up and down if it is horisontal) making the thumb a squre, but still containing the whole of the image. Like this: 2) Could you please write a bit about how you work with images. We now have options from you: pim and pia (not forgetting about core methods). How do they work together? Should we use both or just one of them and in what cases?1 point
-
@joss - like your idea; just spent 2 hrs making PDF files with screenshots, arrows and callouts for a client so they can go in and start editing their site.. of course I could make some a custom admin page and put a sidebar link to documentation; but an all-in-one dedicated module would be nice where you could add pages to some part of the tree for all of the docs and then have the module generate the welcome screen for the docs, with list view... (sorry to post after you closed this)..1 point
-
I completely rewrote the module kinda. New version just committed earlier: See readme here for more infos: https://github.com/somatonic/MarkupSocialShareButtons There comes now a GUI in the module config screen to select themes (with live preview), and configure all options like links and url params. Theming has changed a little to make things easier, and the bundled themes use PNG icons instead of SVG. Edit: updated first post too.1 point
-
1 point
-
OMG. Animated gifs! I suddenly feel so retro. But seriously, PW with GD-lib doesn't support this. And as your request now seems to be the first that arrives here, it shows that this is a really rare case today. Teppo already has done a good recherche on that and it shows that this is not a small piece of work. I don't think that Ryan would want a full support for that to go into the core. (If not more than 20% or 30%? of the users need this it has to go into a module). But you need a quick solution now. You may check if your host supports IMAGICK, (not 'ImageMagick', but 'ImageMagick' through a PHP-Extension called 'Imagick'). If yes, install and try out ImagickResizer. I don't know if it supports animated GIFs yet, but there is a good chance it does. If this doesn't work for you, can you display them just with "resizing" by css dimensions? (Is this the only case where you need this) If above both doesn't work, I think the only thing what can be done quickly is to implement a check for animated GIFs into the Imagesizer (or maybe as a workaround, into your template code) and if it is a animated one, redirect the manipulation to one of the mentioned LIBs at StackOverflow.1 point
-
I think we would have to put together kind of an active “Shop Development Group”. I love coding, but I’m definitely not that much a developer to lift a task like this. But I have some ideas on how to structure the modules to achieve a maximum of flexibility regarding how to layout your shop within the page tree. Splitting the challenges is small packages may be the key to success here. I’ll try to sketch my ideas. Could be a point to start. Maybe, when this thing gains some momentum, we could create an own github account for this where all shop modules are bundled and specific discussions on functionality can happen in the issues section. Who would be interested in contributing to a project like this?1 point
-
Hi there! Your first image seems to be 500x500 in size, actually, just scaled down using styles. Could that be the original size, perhaps? Second image has "500x500.300x0" in it's filename, which looks a bit weird (are these both added by ProcessWire?) and is actually 300x300 in size. Guessing this is the downscaled version. Haven't tried these with ProcessWire, but I've seen image resizing destroy animations in GIF files before. That might be happening here too -- Horst should probably take a look at this, he's the one who knows best what's happening. A very quick Google search resulted in this thread, which seems to suggest that GD resize might need extra work to support animated GIFs For the record: if possible, I'd suggest that you create a new GitHub issue for this.1 point
-
That's great and will surely become handy soon. May i suggest namespacing the css classes? Item, Facebook or Twitter are classnames that are potentially already beeing used across several frameworks and applications.1 point
-
On the Rabotheater page the DOM doesn’t change at all. The buttons just change the class of the list, thereby changing the CSS. I would recommend this technique unless you want your views to show different data. You can solve the different presentations either for the entire list, or for the individual films. I would probably go with the latter: You have three templates for a film page: film.php – Just your regular page template to display a specific film. This is the only film template that is represented in the Admin. film_list_image.php – Only the markup for a list item showing the film and perhaps some relevant info in the “collage” style. film_list_title.php – List item markup including the film title and perhaps release year, review score, or whatever. On the list page, you render films using the $page->render() method with the chosen template as the first argument: $film->render('film_list_image.php'); You can switch between styles by reloading the entire page with Post, Get or urlSegment input, and perhaps store the preference in $session or $user. You could also load the films with AJAX and call $film->render() with the template there, then return the new markup to the list page. Of course, it might be better to return the film information in JSON format and build the presentation markup of choice with JavaScript on the list page. As you can see, there isn’t one technique that fits all. The CSS option is definitely the fastest, simplest and arguably the best way, provided you can keep the markup the same between both list styles. Just have a look at the Rabotheater site in your Element Inspector. Wicked fast, no DOM changes except one class attribute, no additional server requests. You could even animate the change. I only go into the other stuff because it incorporates ProcessWire and because it answers your question about having two templates for one page.1 point
-
We plan to launch in a few days. If you'd like to help us having a proper starter set of recipes, please contribute via adding to this GitHub repo: https://github.com/processwire-recipes/ProcessWireRecipes (the recipe files themselves can be found at /site/recipe-txt-files) Recipe files are plain text files written in markdown (here is an example of their intended structure). Owzim's awesome RecipeInstaller module makes it possible to easily convert them into ProcessWire pages. edit: recipe txt files will be outsourced in a separate repo to simplify things, here is said repo: https://github.com/processwire-recipes/Recipes1 point
-
Here's what usually happens in my experience: I spend about a (paid) day documenting the specific setup of PW sites for clients, proof-reading and carefully crafting nice PDFs, which I then mail to the client. Clients usually go “Oh, this is great! We have or own manual tailored to our needs which we can reference any time we don't remember what you told us in the CMS training! I'll print out copies for everyone right now!” Weeks or months later I get a call. “Erm, we kind of forgot how this-and-that works, and we were wondering if you could come in for another CMS training? We haven't used the system in a while and most users forgot what they learned in the training.” – “Well, you always have the documentation I wrote for you …?” – “Yeah, about that … could you send us another copy of the PDF, please?” The alternative is clients that go “Nah, we don't need documentation, we'll get along with the backend just fine.” And they do, because PW can be pretty self-explanatory. Bottom line, documentation is important (and PW is documented pretty well already, compared to other CMSs out there). But a lot of end users (again, just in my experience) tend not to read it, because they prefer a human expert to tell them how what they specifically need works. (Which is why questions get asked over and over again in forums, in my opinion.) I'm not sure a documentation integrated in the backend would really work and thus be worth the effort or overhead. (In fact, I don't even know if it would be an overhead.) Also, there's the risk of inconsistent (some things being documented very well, others not so much) and outdated documentation, which I feel is almost worse than no documentation at all. Oh, and translations, of course.1 point
-
It's about time this was pulled together as a configurable module. So here it is on github and in the module DB. You can configure a set of roles and a target redirect page under the module config. I've done very limited testing here - hence it being marked as alpha in the module DB - so please let me know if it works for you. A word of thanks to both Wanze and kongondo are in order as they pulled most of the material together that I used for this!1 point
-
Three days at Beyond Tellerand made @marcus and me spawn some great ideas for this. One of which is that we will maintain a text-based repo of recipes, so that they are decoupled of any database, are properly version controlled and anyone with a GitHub account can contribute easily. This may be great opportunity for those of you who have not yet been using something like git to finally dive into it. I wrote an importer module, which already works pretty well. The rough structure is decided upon as well. Let's get it on! PS: we also met nico one day, what a very nice fella he is .. I had too much to drink that night though1 point
-
Yeah, incidentally I mentioned this elsewhere today. I got stuck on some recursive function . It's not high on my priority list atm but will have a rethink at some point...1 point
-
Just thought you guys might like to know that the priority setting just got another user Needed to solve the conflict between RedirectIds and 404Search modules. Thanks again Ryan for thinking of everything!1 point
-
Same answer as before. Saving a template does not include a $_POST variable with embedded HTML, so it's not going to trigger mod_security. Mod_security doesn't like $_POST or $_GET variables with embedded HTML, especially more than one of them (like body and sidebar). Basically your web host has to disable that aspect of mod_security, as it is definitely not CMS friendly. You may also be able to resolve it by making sure you have not more than 1 field with HTML in it (i.e. just a "body" field). This is not uncommon, because WordPress typically only has 1 HTML field present, so some hosts configure their mod security to allow 1 through and not more. Personally though, I would not use a web host placing this kind of restriction unless the hosting is free.1 point
-
Static hooks apply to all instances of a class, whereas direct instance hooks apply to just 1 instance (the one you assign it to). For example, you'd use a static hook if you wanted to hook into or add some new method to all Page instances. Whereas, if you are hooking any API variable ($session, $pages, $modules, etc.), it's better to use a direct/instance hook since there is only ever going to be 1 instance of those variables anyway. While you could use a static hook anywhere, direct hooks are a little more efficient because they are stored with the actual object instance rather than in the larger pool of static hooks. Meaning, direct/instance hooks result in less for ProcessWire to sift through when executing hooks (though it probably doesn't matter much in the larger scheme of things). But this is also the reason why they aren't prioritized together, as they are stored in different places.1 point
-
Ok, an update. To get two of my modules to work well together I do need this functionality. I basically want the 2-factor login module to get first crack at the hook before the login alarm gets to log/email the users. I set the priority in the 2-factor module to 10 and in the alarm module to 2000 (just to be sure) however on adding a die(__CLASS__) to both hook handler routines I could see that the alarm module was getting called first. An unexpected result, but I've now found out why. It turns out that I was hooking the login event in slightly different ways and this does seem to effect the order the routines get called in. In the 2-factor module I was doing this... $this->addHookAfter( "Session::login", $this, 'my2FactorHook', array('priority'=>10)); Whilst in the alarm module I was adding the hook differently... $this->session->addHookAfter( "login", $this, 'myAlarmHook', array('priority'=>2000)); Switching the 2-factor init() routine over to using $this->session->addHookAfter('login'...) has everything called in the right order.1 point
-
That's correct. At least, that was the intention. It's one of those things I thought would come in more handy than it has… I'm not aware of it ever being used. So I think the only time it has even been tested is when I originally coded it in there (at which time it was working). No recent confirmation of current functionality though. A quick glance in the code seems to indicate that it should work as intended, though please let me know if you find otherwise. Default priority level is 100 (that's what gets assigned when none assigned).1 point