Jump to content

teppo

PW-Moderators
  • Posts

    3,208
  • Joined

  • Last visited

  • Days Won

    107

Posts posted by teppo

  1. This is an inputfield module integrating Trumbowyg WYSIWYG editor into ProcessWire, quickly hacked together after some discussion at the Redactor thread. Trumbowyg is a light-weight alternative to more feature-rich editors, such as CKEditor or TinyMCE.

    Both this module and Trumbowyg itself are still in alpha state.

    Customisation options include only a subset of what Trumbowyg provides, more will be added in the near future. Also, link and image features as seen in other RTE modules (TinyMCE and CKEditor) are not implemented yet.

    The module is available at https://github.com/teppokoivula/InputfieldTrumbowyg.

    post-175-0-04742700-1404655083_thumb.png

    • Like 15
  2. @adrian: I'll take a closer look at that tab issue soon. About the link dialog, I'm not really sure -- it's probably the same thing as with image dialog, that it should be replaced. Too bad, since these super-clean dialogs are part of what makes Trumbowyg such a pleasure to use :)

    The scope of Trumbowyg seems pretty limited for the time being and for an example I haven't yet found any 3rd party plugins for it (regarding paste buttons and "pretty" code formatting). I'll take a closer look ASAP and see if there's anything available, otherwise might have to cook something up myself.

    In the meantime I've added some basic config options to the module.

    Edit: tab issue should be gone now. Forced higher z-index value to fullscreen Trumbowyg editors.

    • Like 1
  3. @Manfred62: https://github.com/teppokoivula/InputfieldTrumbowyg. Just for testing, though, it's far from polished (mostly just a quick fork of InputfieldCKEditor with 90% of everything stripped off).

    What I'm not really sure about, should this become a "finished" module, is how the images should be handled? Trumbowygs default image tool is clean and pretty, but doesn't really make sense in ProcessWire, so I'm thinking that the image plugin from other RTE's should probably be ported here or something like that..

    • Like 1
  4. @dazzyweb: I'd assume so too.. at least as long as you're willing to swallow their other requirements, such as the "fair use" clause accompanied by statement that they alone decide what this "fair use" consists of.

    I for one wouldn't, but that's just a my personal opinion. There's a whole world of difference between proprietary and free software and I know which side I prefer :)

    • Like 1
  5. Even then, that doesn't help you with plugins that aren't in the directory - you're on your own there!

    As harsh as it may sound, I'd say that this isn't something we can affect, and thus not something we should worry about. The best we could do in this regard would probably be adding some sort of indicator to admin whether a specific module is found from the modules directory or not, just to make it obvious that you really are on your own there :)

    • Like 1
  6. @adrian is right; apart from sending loads of email, external services make it much easier to get your messages through.

    Setting up a mail server is simple, but there are lots of factors that matter when it comes to spam prevention. Formatting and encoding everything properly, having correct DNS records (SPF etc.) and configuring the server itself are (usually) no-brainers, but things like age and reputation of the server also affect scores.. and of course there are various blacklists and whitelists in use too :)

    Based on my experience so far, I'd never recommend relying on local mail server or putting one together yourself if it's critical that the users receive messages correctly 100% of time. In this case I can't really say if it's a critical issue if one or two people here and there don't get their messages -- sounds to me like it wouldn't matter that much, but you'll probably know better.

    Even if you do go with your own, local mail server, at least check it with something like http://mxtoolbox.com/diagnostic.aspx. Tools like that can check that your IP isn't already on one or more blacklists and also make sure that you've got most other basic things in order.

    Hope that helps a bit.

    • Like 2
  7. To give you a concrete example, there's a particular company in my area that is able to provide e-commerce websites, with unlimited products, PayPal and EPoS integration, multilingual setups, etc., for just €399 (no, it's not a typo).

    I get that this is just a small part of a much larger issue, but as a concrete suggestion to a concrete example, there are couple of ways to achieve this: a) they've got a very sophisticated platform of their own, b) they're using one from elsewhere (such as Shopify) or c) for that price they install an out-of-the-box e-commerce solution, do minimal work on it and that's it.

    Not trying to be depressing here, but if an out-of-the-box solution really what the client wants and needs, that's what they should get. If you want to compete with companies like that and offer your services for clients with such needs, I'd suggest looking into existing solutions -- preferably ones provided as hosted services.

    If a client wants something entirely customised to their needs, I can assure you that no one can provide it for 399€. Not unless they're counting on making profit from the monthly fees in a long run, in which case the price of the project itself can be much lower than what it costs for them to build. I still very much doubt that anyone would do a >10K€ project for <500€, that's just too much of a stretch.

    The key here is that uniqueness, authenticity, adhering to specific requirements -- and generally speaking any work that requires involvement of a real person with real ideas -- cost. You can't get all that for couple of hundred euros. For the clients that appreciate this, a bulk product just isn't going to cut it. For those who don't, it's probably pointless to even try to sell it.

    Out of all the great posts on this thread already, I really liked what @yellowled said about "saving them time, effort and nerves". That's one heck of USP (as explained by @totoff) if you do (and communicate) it right. As another concrete example, we've been involved in projects that have literally cut a weeks worth of manual work to an hour or so of waiting for a background task to run. It'd be pretty hard for a client to not value that.

    I'm sorry that things are difficult for you and really think you're right when you say that people don't appreciate craftsmanship much these days. It's a sad thing, but all I can say is that you'll have to either find a way to provide good quality with minimal effort (out-of-the-box services) or find a way to attract clients that do appreciate this. I know that neither is really an easy way out, though.. :)

    (For the record, I work for a company that provides web-based solutions ranging from the most basic self-service platforms for small companies and individuals to entirely custom-built ones for large corporations, cities/municipalities etc. For some clients we handle everything from content to marketing and some prefer to do these things themselves. There are clients for all of our products and none of them is perfect match for all of our clients.)

    • Like 4
  8. I'm the last person to stand up for WP (seriously), but still have to point out that neither of these are really issues with WP itself. In fact most of WP problems I've seen have been related to 3rd party plugins/modules.

    I'm not saying that it's not the fault of the system in some way, as they really should provide a safe platform for 3rd party extensions to build on (and clearly that's not always true in the case of WP), but they (WP core developers) can't be held responsible for whatever crappy code people implement on top of the good parts of that platform.

    .. oh, and my main point is that this should really serve as a warning for us too: it's entirely possible, if not exactly easy, to create modules with vulnerabilities on top of ProcessWire. As the amount of modules grows, issues like this become more likely and thus we (module authors and users alike) really need to take an active role on preventing them.

    IMHO.

    • Like 9
  9. $page->pattern_type should return an instance of PageArray, which won't have field "title" -- or any other fields for that matter. PageArrays are collections of Pages, and Pages are the ones with fields (and in any case you wouldn't be able to iterate title field as in your example).

    Try iterating Pages contained in that PageArray, like this:

    foreach ($page->pattern_type as $pt) {
        echo $pt->title;
    }
    
  10. Okay, that was slightly freaky but following the last PW update I had to uninstall all the modules, delete the Admin/Pages/Image Crop page and reinstall the whole module to get it working again.

    I'm hoping it was just a freak occurrence but would merit further testing before PW 2.5 is released.

    I'm getting this right now (right after updating from 2.4.3 to 2.4.5), so it's definitely an outstanding issue. Will have to dig in to see what's going on..

    Edit: Just guessing, but could this be related to this commit and the part about "6) Convert Fieldtype modules to load on-demand rather than all at boot"? Looks like after the update when InputfieldCropImage runs, FieldtypeCropImage hasn't been init'd yet.. which obviously results in getThumb() not being available.

    Anyway, will have to debug more.

    Edit 2: Whether or not that was the issue, I've solved it locally by making sure that FieldtypeCropImage is loaded with InputfieldCropImage. I can't uninstall the module or try other tricks on this site, as it's already in production -- I'm assuming that Antti or Ryan will dig out the real reason (and fix) for this, but in the meantime this works for me:

    Index: InputfieldCropImage.module
    ===================================================================
    --- InputfieldCropImage.module  (revision 7702)
    +++ InputfieldCropImage.module  (working copy)
    @@ -13,7 +13,8 @@
    
            public function init() {
                    parent::init();
    -
    +               // make sure FieldtypeCropImage is loaded
    +               $this->modules->get("FieldtypeCropImage");
                    //default settings
                    $this->set('thumbSetting', 'thumbnail,100,100');
            }
    
    
    • Like 7
  11. @Joss: it's also a matter of knowing your customers. Being in the same channels and not forcing them to use the channels you've chosen.

    In this regard I appreciate what ServInt were trying to do, i.e. using Twitter and Facebook to communicate to clients already in those medias. What they failed at was that they sent out one quick message, neglected keeping people up to date as things evolved and didn't even reply to messages of frustrated clients as those kept piling up.

    Twitter is very fast-paced media; if you stay silent for five minutes, people decide that you're gone (or just don't care) and start asking for status updates. Unless you answer them, they're going to be pissed :)

    My opinion is, of course, hugely affected by the fact that 100% of time I'm in some way connected to social media, so if a service provider wants to reach me, that's their best bet (and the number one media I'd check if something was acting up would be Twitter, which is perfect for quick status updates). Not saying that using Twitter would eliminate the need to send important updates as emails, but it can provide very real extra value to a lot of customers.

    (Also: if my service provider sent me an email each time there's been some little slowdown or a minute of downtime, I'd be equally pissed at them. Each media has it's own merits and email isn't that great for fast-paced messaging. When you're having this scale of an issue it should've been used, though.)

    On slightly related note, I found that blog post somewhat lacking. Sure, they're saying that things went wrong (+1 for explaining what the issue was), but the rest was mostly just saying that "shit happens" and "we'll try to be better". I'd have expected them to name at least one concrete step they're taking to make sure that this doesn't happen again -- "we're going to learn from this" is abstract and in itself doesn't promise any improvement at all.

    Communication is a difficult beast to pin down perfectly :)

    • Like 2
  12. For a module I'm working on I'm trying to use InputfieldSelector to define a selector that iterates pages excluding those with admin template. It seems that InputfieldSelector isn't picking up "template!=admin" (or template=admin for that matter) properly -- does anyone know if a) this is intentional, b) why is that and c) is there a way around this?

    Currently I'm using "has_parent!=2, id!=2" instead, but that seems potentially unstable (though it's quite unlikely for this ID to change) and much less obvious than "template!=admin".

    Any ideas?

  13. On the one hand I don't want to reinvent the wheel; why not just use SchedulePages. On the other, I am a bit wary of tying an important functionality of Blog to a third party module that is not part of the core. In case things were to break in the future and they were not fixed (no offence meant to Jasper), that would leave Blog users hanging.....Maybe I am being over cautious.

    Nothing wrong with being careful, but luckily we're talking about free software here. If it's any more reassurance, we've got a lot of sites relying on this module already, so trust me: in the (unlikely) scenario that something was to happen and the module wasn't kept up to date, I for one would be more than happy (and forced, actually..) to catch the ball ;)

    • Like 3
  14. @davo: yeah, rsync probably would do it, but to keep sites in sync all the time would require this to be triggered after each change to assets etc.. or just to be executed regularly enough to achieve "good enough accuracy" :)

    Disabling edit sounds like a good idea to prevent unnecessary mess. Sounds like a good fit for demo mode too.. and just to be really clever, you could even make it dynamic using something like $_SERVER['SERVER_NAME'], so it'll be automagically turned on for the duplicate :)

    • Like 1
  15. One nice thing that Wordpress has is the ability to change the author of a post from the person who is creating it and logged in. Maybe an author PageField that allows you to select from other PW users that have a blog author role, or something along those lines?

    Agreed. This might be a valid solution for the user-specificity part, though "regular" bloggers probably shouldn't have the permission to do this -- right?

    Whether this solves the question of having multiple separate blogs still doesn't seem entirely obvious to me. In another system we've used it was possible to create and embed separate blogs, with their own names and other settings, to different parts of the site. That was pretty handy, actually. Each blog being tied to one user account (in a way that made it impossible to change later) was the problematic part.

    If only we could somehow had both.. :)

    Edit: I'll have to take a closer look at post settings based on @kongondos reply above, but just wanted to clarify the part about "regular bloggers' permissions". In our case bloggers are sometimes actually users that have absolutely no other permissions -- can't edit content etc. Them being able to edit other bloggers' posts or change authors of those would be far from optimal. Could be specific to our case, though..

  16. Seriously? If yes, out of the box, no. But with some trickery, you can have MarkupBlog output posts from only a particular author, assuming each author has their own blog. I am just thinking out loud here. If this is a feature request, I'd like to have more details but also hear what others think :-)

    Glad you like the module. :D

    Sorry for spamming (sort of), but just wanted to comment on this one that most (quite possibly all) of the sites we've implemented a blog for have more than one blog. Doesn't sound that far fetched to me: one or more for internal use, one for each division (a lot of our blogging clients are municipalities and they've got a ton of these), one for CEO/mayor, one for each temporary project etc.

    Also, if you were referring to creating a bunch of user-specific blogs: I've explained this sort of behaviour (in another system) to clients over and over and over and can assure you that, though it may sound like the logical solution, in real world it just doesn't work.. unless you also allow some sort of "blog superusers" to post with any user account, which could introduce an entire set of new problems :)

    One typical situation is a CEO or mayor having his/her own blog. Most people of that caliber simply don't have much spare time and blogging is rarely considered a core task, so even if this person does really write his/her own posts, there's a very high probability that someone else handles posting them online.. which is where the trouble starts if each blog is tied to one user. I'm sure you get the point.

    Anyway, I'd appreciate if you could consider this kind of feature, but I get that it's probably not too high in priority :)

    • Like 1
  17. Also, I read through the thread and saw a mention of having a publish date/time - has this been implemented? If not I'm probably going to be doing some work on a few of my own modules in the next week or two, so would be happy to see about doing a pull request with it as it's something I'll need to add anyway :)

    Scheduled publishing is an integral part of the workflow for many bloggers, so this would definitely make sense. I couldn't live without such a feature anymore.. :)

    @kongondo: if you're still pondering whether to use SchedulePages somehow or cook up your own method, I'd vote for SchedulePages. Admittedly I'm being somewhat selfish here (I'm sure we'll be using this module for our client sites and I don't like the idea of having to explain why and how scheduling posts is different from all other pages) but it's also a great module :)

    • Like 2
  18. just a quick question... How do I set the max age (bzw. where can I reset the log)? 

    (I want to handover a site to a client and want the millions of log entries during dev to be removed up to a certain date.)

    I would expect a "delete all" on the listing page - did I overlook something?

    There's a setting called "Data max age" in the settings of Changelog Hooks module. That's probably what you were looking for (sorry for taking this long to answer!)

    Hi, sure I know that deleting the rows in the database solves it perfectly. :-)

    My post is

    -because I think to remember that there was a max_age setting somewhere (but I cannot find it)

    -and because a Delete-All button is something I was used to from Drupal and liked the idea to have such a button.

    If you really need to delete all items, I'd suggest uninstalling and installing the module. That should do the trick.

    "Delete all" type of button would be simple to add, but I don't really see much benefit in that.. unless it's added to the changelog page (not module settings), but in that case I'd be worried about users accidentally deleting their entire changelog. Unless there's something I'm missing here, I'd probably leave this as is :)

  19. Thanks, Ryan. Let me know how it handles once you do test it, would be interesting to know. My tests so far have been very limited in scope, so I'm fully expecting a pile of issues (and most likely a few things I've completely missed).. though of course the opposite would be cool too :)

    You've given me something new to consider there, will definitely take IftRunner and PageAction part into consideration.

  20. Sorry for the delayed answer, Pierre-Luc! Been busy with other stuff and this totally slipped my mind.
     
    What you've described there wasn't really possible without direct SQL queries until just a few moments ago. I've just pushed to GitHub an update to VersionControl.module (0.10.0) that adds new $page->versionControlRevisions() method. This isn't properly tested yet, but something like this should work:

    // current value of field 'headline'
    echo "Headline for current revision: {$page->headline}<br />";
    
    // value of field 'headline' in previous revision
    $revisions = array_keys($page->versionControlRevisions(2));
    $page->snapshot(null, $revisions[1]);
    echo "Headline for previous revision: {$page->headline}<br />";
    
    // return Page to it's original (current) state
    $page->snapshot();
    echo "Back to current revision: {$page->headline}<br />";
    

    Since snapshot() returns Page object to given revision or point in time ($page->snapshot($time, $revision)) you'll want to make sure it's back to it's original state in case you're going to make changes and save the page -- otherwise the revision you fetched with snapshot will be returned from history once you save the page.
     
    $page->versionControlRevisions() returns an array of revisions for current page and can optionally take one param, $limit, to fetch only that many revisions if more exist. It's return value is in the form of array([revision] => [timestamp]), i.e. array(4 => '2014-01-01 02:00:00', 3 => '2014-01-01 01:00:00') etc. so in order to get just the revision IDs out of that I'm using array_keys() in the example above.
     
    You could probably also do something like this, if you want to make sure that Page doesn't get accidentally returned from history (this'll consume more memory, though):

    $revisions = array_keys($page->versionControlRevisions(2));
    $page->previousVersion = clone $page;
    $page->previousVersion->snapshot(null, $revisions[1]);
    echo "Headline for previous revision: {$page->previousVersion->headline}<br />";
    
    

    Not sure if you're still working on this, but this kind of feature felt useful so I'm glad you brought it up.. :)

    • Like 6
×
×
  • Create New...