Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/03/2019 in all areas

  1. Thanks - that's what I was looking for. Here is my final code for the hook: $p->name = $this->pages->names()->uniquePageName($p->name); $p->parent = pages()->get('/news/'); $event->arguments(0, $p); Works a treat!
    3 points
  2. I think the confusion is mostly in terms of managing expectations. It works if you just want to move plain data without caring much how it's actually moved. If you on the other hand have a tightly integrated system, where ids of things should not easily be changed then you might not want to use it. The big issue is that there's not much documentation on how exactly things work (especially in terms of conflict resolution) and about the obstacles you might encounter in the process.
    3 points
  3. Access By Query String Grant/deny access to pages according to query string. Allows visitors to view protected pages by accessing the page via a special URL containing an "access" GET variable. This allows you to provide a link to selected individuals while keeping the page(s) non-viewable to the public and search engines. The recipients of the link do not need to log in so it's very convenient for them. The view protection does not provide a high level of security so should only be used for non-critical scenarios. The purpose of the module was to prevent new websites being publicly accessible before they are officially launched, hence the default message in the module config. But it could be used for selected pages on existing websites also. Once a visitor has successfully accessed a protected page via the GET variable then they can view any other page protected by the same access rule without needing the GET variable for that browsing session. Superusers are not affected by the module. Usage Install the Access By Query String module. Define access rules in the format [GET variable]??[selector], one per line. As an example the rule... rumpelstiltskin??template=skills, title~=gold ...means that any pages using the "skills" template with the word "gold" in the title will not be viewable unless it is accessed with ?access=rumpelstiltskin in the URL. So you could provide a view link like https://domain.com/skills/spin-straw-into-gold/?access=rumpelstiltskin to selected individuals. Or you could limit view access to the whole frontend with a rule like... 4fU4ns7ZWXar??template!=admin You can choose what happens when a protected page is visited without the required GET variable: Replace the rendered markup Throw a 404 exception If replacing the rendered markup you can define a meta title and message to be shown. Or if you want to use more advanced markup you can hook AccessByQueryString::replacementMarkup(). $wire->addHookAfter('AccessByQueryString::replacementMarkup', function(HookEvent $event) { // Some info in hook arguments if needed... // The page that the visitor is trying to access $page = $event->arguments(0); // An array of access keys that apply to the page $access_keys = $event->arguments(1); // The title $title = $event->arguments(2); // The message $message = $event->arguments(3); // Return some markup $event->return = 'Your markup'; }); Screenshot https://github.com/Toutouwai/AccessByQueryString https://modules.processwire.com/modules/access-by-query-string/
    2 points
  4. Why don't you just install TracyDebugger and try it out? It makes so many things so easy:
    2 points
  5. According to this old post it basically seems ok: If the page already exists, you want to turn off output formatting first. Something like: $page->of(false); $page->images->add($imageUrl); $page->save();
    2 points
  6. If we are talking about content changes only (no template/field changes), then I'd also recommend ProDrafts. But it may depend on your use of repeaters, an images field within a RepeaterMatrix may be critical, for example, but in general repeaters are not a problem with ProDrafts. If "larger content changes" may require changes in fields and/or templates, than ProDrafts probably does not work. If it would be ok that any change goes through the staging process and all changes go live concurrently, then using two sites running on the same server may be the way to go. One directory serves the live site, another directory holds the draft site. Changes are only done on the draft site. Once finished, you simply switch document root to the draft path. Afterwards you'll clone the new live site (i.e. using Duplicator) and setup a fresh draft instance for next iteration. For intermediate content changes on the live site some hook on pagesave may be used to either log these into a file (for later import) or update the draft site automatically (sending some POST request).
    2 points
  7. Actually it seems that ProDrafts already supports Repeaters – this was announced in a blog post along with ProcessWire 3.0.75, and that detail just never made it into the description at the store. In case you have any questions regarding ProDrafts, I'd recommend sending a direct PM to @ryan ? VersionControl isn't really suitable for this purpose. Repeater support is one thing (though I seem to recall that the module might kinda-sorta work with Repeaters), but a bigger issue is that there's no draft feature. I could definitely hack it to do something like export a version and import it on another site (definitely something I'll keep in mind, sounds interesting!) but currently that's not doable. I haven't really used ProcessPagesExportImport, but I know that in case of Ryan the "beta" or "development" label doesn't necessarily mean that it isn't usable. I seem to recall that much of the data for the new processwire.com site was migrated using this feature (someone correct me if I'm wrong), and although I've heard some reports of missing features and such, as far as I know it should be pretty solid already. My first choice would definitely be one environment with the ProDrafts module. I'd only consider other options if that one doesn't pan out.
    2 points
  8. Had forgotten about it also!! Hope you are up to this version of PW: https://processwire.com/blog/posts/pw-3.0.111/ Maybe this would work? //In the context of the hook $p->name = $this->pages->names->uniquePageName($this->sanitizer->pageName($p->title));
    2 points
  9. v0.1.2 released - this update allows the 404 page markup to be replaced.
    1 point
  10. So I tried Midori and it rendered ProcessWire website all funny. The Firefox that shipped with BunsenLabs (BL) seemed to be fast enough so I thought, what the heck, maybe Chrome will run just fine as well? We'll, what do you know! Of course it's eating up RAM like it's Google's Birthday but I reckon @OrganizedFellow was right about Solus being 'slow' on my machine due to the visuals. Since BunsenLab has a very light footprint, Chrome still has enough to chew on. I then tried Sublime Text. I've always loved Sublime but after using VSC, going back was difficult. I decided to install VSC to see if it would run OK in BL. Surprise! So far, it seems to run just fine. I haven't opened multiple files (and I don't need to in this machine). I'm just happy I am able to use the tools I am used to without hiccups. One other thing I liked about BL (yes, we are on first names now ;-)) is that it has a post-install script that runs and asks you if you want to install useful tools like a LAMP stack, etc. I let it install the LAMP stack and here I am, up and running. Apache2, PHP 7 with many useful extensions, phpMyAdmin, etc. ps: @OrganizedFellow, was that you who made the request to BL to port the CB welcome script to BL? :-). If it was, thanks!
    1 point
  11. I started in PW a few years back. I love what I’ve been able to develop, although most have been simple marketing websites. I’m a brand developer by trade but I’ve been doing frontend and light database/ php since the late ‘90s. My perception of PW is that it’s a real tool. You can build stuff and not have so much abstraction that revisiting a project requires a ton of time figuring out what code does. I like that because building stuff with staying power serves my clients well. I think PW attracts the kind of person who loves well crafted things; like a good Italian shoe that can be resoaled versus throwing the shoes away because they’re made cheap. I think that PW could really find a wider base if there was a learning framework. There are key people in this community, including Ryan, that could build a curriculum starting from scratch. Courses we pay for that teach us good fundamentals because there are multiple ways to get stuff done but maybe a lot of us could improve our spaghetti code. Then we could delve into more complicated stuff like writing to pages from frontend pages. Some could even involve getting best use of Pro modules. This is an investment because unlike other systems, PW is so fundamentally sound and non-changing that the information would be sound for years. Thanks for listening.
    1 point
  12. Other than having bought a book there once, I’ve not returned to Leanpub but it does look like a great idea. The multiple-book format is nice. I’ve been buying more through Kindle and bringing writings into Kindle does seem nice. And the other formats make it accessible to all. Maybe you can take suggestions on content. In my opinion, starting small/very basic is a good starting point.
    1 point
  13. I don't know if this is in works, because I have much free time ( Change of Job) , I am thinking of picking this up, using something that generates from Markdown via Github, I have looked at Leanpub, @HMC is right, a table of content is necessary, I will create a thread for this, because I think it is long due for this. However I will prefer somewhere , where people can edit and push for changes, Git seems to fit for this purpose if anyone has any comments, please feel free to chime in.
    1 point
  14. Just wanted to mention Migrator too as a possible alternative/tool. Make sure to read @adrian's first post carefully and the updated readme.
    1 point
  15. Of course, this it_IT locale needs to be installed on our server to work. So, on a Linux server: //List installed locales $ locale // Install yours if not on that list $ locale-gen it_IT.UTF-8
    1 point
  16. May not be much help, but here goes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH https://www.electrictoolbox.com/php-curl-http-referer/ https://www.weichieprojects.com/blog/curl-api-calls-with-php/ https://curl.haxx.se/docs/manpage.html
    1 point
  17. never used PATCH before, so its only guessing... Could it be 'Content-Type' => 'application/json-patch+json', https://tools.ietf.org/html/rfc6902
    1 point
  18. Oki. I have to do some testing but i think i got the gist of it.
    1 point
  19. Thanks to Everyone involved with helping me on this subject. Sometimes you can get confused and then need another set of eyes on the problem to figure it out.
    1 point
  20. Thanks for this useful module. I've limited the whole frontend with the rule: testing??template!=admin but If I type a non existent url it will display the 404 page instead the replacement markup.
    1 point
  21. v0.0.9 adds support for dynamic rowHeaders. Previously they had to be manually defined via JavaScript. Now they can be defined by user input:
    1 point
  22. As @bernhard said, the add returns the whole PageImages array including the new, unaltered image file. You may create variations afterwards but if you need to do some "editing" before, you'll probably have to go through PHP, download the file into a temporary folder, perform any kind of manipulation and then add the local file to the PageImages array.
    1 point
  23. @pmichaelis I'm gonna ask anyway: Why? ? Seems like a weird server config, but I could add this to the variables the module checks by default.
    1 point
  24. I'll look at adding something like this in a future update. Although most devs will already be using a password manager and these usually come with a generator built in. There are lots of different things that users might want to do with the replacement markup - too many to support with dedicated options in the config. That's the reason behind the hookable method. I've just pushed an update that passes the title and message as arguments to the method, so you can do something like this: $wire->addHookBefore('AccessByQueryString::replacementMarkup', function(HookEvent $event) { $message = $event->arguments(3); // Convert markdown to HTML $message = $event->wire('sanitizer')->entitiesMarkdown($message); // Alternatively use a textformatter // $event->wire('modules')->TextformatterMarkdownExtra->format($message); $event->arguments(3, $message); });
    1 point
  25. I ran Crunchbang++ for years. I loved it. It led me to plain Debian and I ran my own OpenBox configs and learned how to manage my own dotfiles. To run Sublime, do it from command line - 'sublime'.
    1 point
  26. Hi matjazp! You and tpr created a really great modul, I have installed 10+ sites, now, and Page Speed loves, too. ? But. Now, one of hosting provider, I use, sent me an email (Linux based): I have deleted the binaries, aren't need for Linux, so, it's only an information for you.. Regards, Tamas
    1 point
  27. I've switched to Vivaldi about 2 months ago and I really like it. If you were an Opera fan in the old days, this is what resembles the most to it (if I'm not mistaken, old Opera devs are working on it). I was using SlimJet (Chromium-based) for a few years and it was fine, but waking up from hibernation it took sometimes minutes to it to get ready. Now this is entirely gone, Vivaldi is ready in a few seconds at most. I'm on Win 8.1, Core i5 and 8GB RAM notebook. I should have switched to it earlier but the developer tools couldn't be attached to the window and it was a deal-breaker to me.
    1 point
  28. According to the instructions in this thread, you should be able to run it from the command line with "sublime"
    1 point
  29. Maybe not after a fresh install but it can be done: https://laptop.ninja/the-best-linux-distributions-for-touchscreens/ This page https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/please-recommend-a-distro-for-a-tablet-pc-touchscreen-a-must-4175638233/ says "Touch screen support is in the Linux kernel. Any distro should work, as long as the technology of the touchscreen is in the mainstream of touch screens." This page https://www.linuxinsider.com/story/81576.html states "Unity was designed with touchscreens in mind". The suggestion there is either Unity or Gnome (desktop environment). HOWEVER, just load up any Linux ISO as a LiveCD and it should automagically load the necessary 'drivers' to enable touch-screen.
    1 point
  30. While there are many ways of installing Sublime Text on Linux, here is my favorite. cd ~/Downloads/ wget https://download.sublimetext.com/sublime_text_3_build_3200_x64.tar.bz2 tar xvjf sublime_text_3_build_3200_x64.tar.bz2 sudo mv sublime_text_3/ /opt/ sudo ln -s /opt/sublime_text_3/sublime_text /usr/local/bin/sublime sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/sublime 90 By the way: build_3200 is the latest version as of today. I just installed it myself and then went into VSCode and installed the extension Sublime Text Keymap and Settings Importer . I've used Sublime for years and just started VSCode. It is slow loading on this tiny Acer Chromebook (runs Debian + XFCE). If your 'low end touch device' runs slowly on Solus, it's most likely due to the visuals in KDE, GNOME or Mate desktop. I might suggest Debian with OpenBox. It is insanely minimal and super fast. I don't run it because of lacking support on this model.
    1 point
  31. Greetings, There are many methods you can use for forms -- as others have suggested. Remember: ProcessWire allows terrific flexibility to accomplish almost anything. But that flexibility also means you have to be clear about what you want to accomplish. I regularly build front-end interfaces for my ProcessWire projects, largely based on forms (of course). Once you head down this path, the possibilities are endless! I tend to build my forms with classic HTML, as Soma suggested. That method gives you the greatest flexibility. Please provide more information about what you want to accomplish, then we can give better answers. For example, are you trying to create and control ProcessWire content through the foms? I've worked through all this and posted about it before, as have others. Here are some links to get you started: Form to Create ProcessWire Content Using HTML (with file uploads): http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/ Form to Create ProcessWire Content Using ProcessWire Field Modules: http://processwire.com/talk/topic/2089-create-simple-forms-using-api/ Form to Edit ProcessWire Content http://processwire.com/talk/topic/4350-how-edit-a-page-using-api/?p=42620 Follow up if you have other questions. Thanks, Matthew
    1 point
×
×
  • Create New...