Leaderboard
Popular Content
Showing content with the highest reputation on 11/15/2017 in all areas
-
Part 1 of a 2 part Module & Service Reveal. I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page. Aims My aims for this module are as follows... Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn... Making discovery of a module's changes prior to upgrade a trivial task. This is done by adding a "What's changed section" to the upgrade confirmation dialog. This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository. At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version. It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.) An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module... An example of a tag-to-tag commit list from the same module... An example of a changelog - formatted to show just the changes (formatting styles will change)... Finally, an example of a fallback list of commits - sorry Adrian ... Making breaking changes obvious. This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis. For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)... Make reading of a module's support documentation, post-install, a trivial task. This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section... Here is Tracy's README file from within the module settings page... Make module authors start to think about how they can improve the change discovery process for their modules. There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features... Make sure display of external information doesn't introduce a vulnerability. This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file. If you discover a vulnerability, please get in contact with me via the forum PM system. Ongoing... For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported. Links Github: ModuleReleaseNotes PW Module Repository: Here14 points
-
This is the first collaborative project that my wife and myself have worked together on. The goal was simple --- Create a public online experience that showed off the "Custom Artisan" jewelry that she has made for years. https://yellowrosecreations.biz The website is built around an e-commerce platform. Through ongoing work with a new client of mine, I had gotten to know about Ecwid as an e-commerce solution that was tied in closely in with Square (a financial services, merchant services aggregator and mobile payment company). My work with Ecwid for the past few months afforded me with the opportunity to get this web project up and online in no time. Let me be clear, while this e-commerce solution works fine, our long term goal is to use Padloper for the online store. That long term goal is more about controlling where our data resides and being able to freely enhance the total shopping experience. I already know that a solution based on ProcessWire will give us the ultimate e-commerce flexibility. The great thing about the ProcessWire platform is that there are numerous tools that enable you to get things done. To my delight, I discovered that using the Hanna Code module allowed me to easily integrate Ecwid (which actually means e-commerce widget) code into a ProcessWire website. I will write a separate article about how that works at a later time. The website makes use of the UnSemantic Responsive CSS grid with Zurb Foundation components added/mixed in. This is an unconventional combination to use, but it works for us. On the ProcessWire side, there were a few critical modules that contributed to gettng this website online: TextformatterHannaCode ProcessDatabaseBackups CronjobDatabaseBackup AdminLinksInFrontend ProCache FormBuilder PrevNextTabs WireMailSmtp ImportPagesCSV ProcessEmailToPage MarkupProcesswirePhotoswipe Hanna Code snippets were used throughout to populate the Ecwid Online Shopping Bag, the Ecwid Main Online Store, different Ecwid Product Category Listings, the green Foundation Buttons in the website sidebar and some other webiste features. ProcessWire Page Table and Page Reference fields were instrumental in generating the product descriptions that are used on the Ecwid Online Store. Each jewelry item has it's own page within ProcessWire that can be later used with the Padloper e-commerce solution. On the backend side, we were able to create a repository page that keeps track of each product, SKU, pricing and their current disposition status related to the Online Store. This has been a fun and fascinating project to work on. It took us a few weeks to get everything worked out. As I have said before, ProcessWire makes projects of this type possible because you are not limited by the front-end framework you can use. Even when there are not dedicated modules to incorporate a feature that you like, this platform and it's openness allows you to do things that are impossible to do on other systems. It just takes a little ingenuity, planning and time on your part to make things work.10 points
-
Hey @Robin S I haven't used a website to app conversion tool, but I have built a few apps using hybrid technologies - most recently with Ionic. You can easily distribute Android apps with an APK file. iOS are of course more difficult. If you went with Ionic, they have an app called Ionic View which makes it easy to run an app on iOS and Android devices without submission to app/play stores. There are also things like these tester app distribution tools (https://rollout.io/blog/testflight-alternatives-ios-beta-testing/) which might get the job done for your needs. Hope that's a helpful start.4 points
-
PS, this is a really good reason to be using 7.1 over 7.0: http://php.net/manual/en/migration71.incompatible.php#migration71.incompatible.fatal-errors-to-error-exceptions3 points
-
i'm working on something in this direction i have to polish up a lot though. don't know when i find time...3 points
-
3 points
-
Had a similar challenge, ie client needed access to PW generated documents when there was no internet access. My solution was to convert the PW pages to PDF and save them to a DropBox folder that synched with their mobile devices. There are many roads up the mountain3 points
-
So I'm trying Uikit 3 again. I wanted to get to know this framework in order to better understand making an admin theme. Testing it on a simple HTML page, with a structure: test - uikit - build - dist - src - etc... - index.html I just git cloned it rather than NPM install because I wanted to use their build script. Then I created a custom folder and a file at /uikit/custom/styles.less with the following: @import "../src/less/uikit.theme.less"; // mixin to add new declaration .hook-card() { background-color: orange; color: white; } Running 'npm run watch' recompiles, I get the output at /uikit/dist/css/uikit.styles.css and results in: So all seems to work. What I don't understand is how to make a theme. I see a file at /uikit/src/less/theme/uikit.theme.less Basically I can't seem to put two and two together. I'm well familiar with preprocessors but this has me stuck. 1) Can anyone elaborate (further than the docs) on how to set this up? Am I supposed to modify the theme folder to create my theme? In which case, would be overwritten when I update. 2) If I use their build process, how do I include my own app.js file into their build process and have it output at /uikit/dist/js/uikit.app.min.js? Any advice would be awesome thanks.2 points
-
Sounds amazing! It would be good to get some guidance/opinions on what is the optimal way to prepare release notes. I'd rather not have to duplicate the same information in release notes, tags, changelog and detailed commit notes, but don't really want to be "told off" by the module for not doing it either.2 points
-
of course it it possible i would recommend you to stay inside the pw backend and adapt it to your needs rather than building a frontend on your own. it's really versatile and easy to use once you get the basic concepts of inputfields:2 points
-
It sounds like easiest approach would be to change it to look like this: Properties ---User 1 -------Property 1 -------Property 3 ---User 2 -------Property 2 -------Property 4 I understand that might be an issue for the url structure on your site. There are ways around this though. The other option is https://processwire.com/talk/topic/1176-hiding-uneditable-pages-from-users/?do=findComment&comment=84916 - read that post and the post that it links to and the rest of both threads. There are ways to do this that should work fine and in your scenario I don't think the mentioned problems will be an issue. Let us know if you need help with any of the linked scripts.2 points
-
HELLOOO!!!!! If its mainly text, then an offline web app with service worker would be fine as most devices allow yo to save upto 50mb without being prompted and then usually more if you give permission. A web app would work too for offline use if you had it all as flat html, css and js files. Using Cordova you can bascially convert directly to native app if its a simple site. You can also use things like PhoneGap or Ionic (others are available), but they are all mostly layers on Cordova which actually is the library for the conversion. Hope that helps2 points
-
I figured how to do it: $wire->addHookBefore('Inputfield::render', function(HookEvent $event) { $field = $event->object; if($field->name != 'myfield') return; $page = $this->process->getPage(); $parent = $page->parent(); if ($parent->template->name == "mytemplate") { $field->entityEncodeText = false; $field->notes = 'My new notes!'; } }); Please correct me if I did something wrong.2 points
-
Hey @Tom., I added THIS profile the day before, but somehow it is no here. Just I tried sending it again called Class (SiteTwilight), but it looks like it is in profiles. I do not know why is not visible? on the modules page. This is not my first profile that I added, this profile it was also added earlier. I generally like @ryan words from this Roadmap: https://processwire.com/blog/posts/roadmap-2017/ Which describes how he would like to put it all to some degree in 2017. I'm also advocating his approach to creating two profiles. 1. CSS Framework for fast building sites. 2. The UIKIT Profile that contains the Blog. I do not know if you've understood my message about modern site profiles, maybe I did not get it right as I started writing. I do not want to add new site profiles just enrich existing profiles with 2 files, such as gulpfile.js + package.json (5kb), which gives me and many programmers the ability to quickly create new profiles, as in the above video. I like modern solutions that make my job easier. I do not want to create new startup profiles for myself, i like just start right away with the ones that give me the Processwire installer. I would like to also have such users also be able to quickly install Blog Profile from default Installation Processwire: After reading all the statements, it would be worthwhile to test it on the Processwire Weekly Which leads if I'm not mistaken @teppo ( Thanks to you Teppo for this Newsletter ). My sugestion to polls: 1 - Leave one blank profile. 2 - One CSS starter + One startup blog based on Uikit 3 3 - One CSS starter + Startup blog based on Uikit 3 + New Multilingual Profile 4 - Remove all the profiles and leave only Administrative Core like Laravel Voyager https://laravelvoyager.com/2 points
-
On the other hand some languages seem to promote (or at least make it easy to author) fewer lines of code or fewer characters over readability. In my experience expressive syntax often results in code that is easier to read and grasp. Of course you can write unreadable or readable code either way, so again it's very much up to the developer2 points
-
I guess what you are asking is how do we get more casual developers interested into ProcessWire? As in you said, you don't want to learn how to connect these frameworks up to ProcessWire. I don't think ProcessWire currently fits in a market where everything is module or theme. While it has the features to be. It just doesn't have the audience. I would say nearly everyone here is a developer that writes bespoke websites for their clients. I think trying to compete with WordPress in its versatility to just pick up, install a theme and a couple of modules and off you go. Could damage ProcessWire. For example a lot of WordPress websites get hacked due to the fact that modules/plugins installed aren't secure. I personally like where ProcessWire sits, it's really easy to pick up and learn, the API is by far the best of any other CMS available. However it takes the patience to learn. However not everything is handed to you. Go out and learn how to hook these frameworks into ProcessWire. I promise you, you won't regret it. And then why not release it as a profile? That's how the community and library gets bigger.2 points
-
I've had no issues with the PW core and PHP 7.1. It should be noted that 7.2 does result in this warning though: https://github.com/processwire/processwire-issues/issues/408 - it's only a warning though, so not a deal breaker. There will be many modules that also fall victim to this, so I would recommend that module authors upgrade to 7.2 as soon as possible to get these dealt with.2 points
-
I recently worked on a project where I adapted an engineering manual (from the print-ready PDF) to a responsive online document. Over time more documents will be adapted. It wasn't part of the original brief, but after the work was completed the client asked if there was some way the online document could be viewed offline on a mobile device, in situations where there is no internet coverage. It seems like there should be solutions to this but I'm not up to speed on what is possible in this regard. A few questions if anyone can help... 1. Has anyone used a website-to-app conversion tool or service that they recommend? Is this a good way to go or best avoided? I Googled it and found a few options but they were either fairly pricey (e.g. Mobiloud) or pretty limited (e.g. AppStrand). I don't need much in the way of features and there isn't much interactivity required - basically just static text and images. 2. Is it possible to distribute an app outside of the Apple App Store and Google Play? In my scenario this would be a non-commercial app with virtually no appeal to the wider public so I suspect that Apple and Google would not accept it into their stores. Is it possible to provide an installable app via a private website? 3. Besides an app, are there other options that would allow a website to be browsed offline on a mobile device? There is software like HTTrack that will crawl a website and save it for offline browsing on a desktop computer, but I'm pretty sure this won't be a solution for mobile devices as they don't have a proper file system. I've know vaguely of service workers but not sure if that's a good solution either. Would a service worker allow an entire website to be browsed offline or only pages the user has previously visited? TIA for any tips or experiences.1 point
-
Thanks for the encouraging feedback folks! @Robin S There's an option to turn off the timed author-auto-shock-via-email(tm) feature which should stop it telling you off too much Actually, the module gives you some options here - including doing nothing more than using git to commit your code - which we all do already. But I think I take your point; I guess the module could induce some of our users to nag us about keeping the upgrade process free of yellow notes. Regarding guidance, I think it partially comes down to your own style working and issuing releases. For example, I commit lots of small changes - which makes my commit log pretty long and difficult to review. In my case, forcing myself to either keep a concise changelog file or to git tag my releases and then use the github release-notes feature, can be better for my module users. Even if I didn't want to start using Github's Release Notes or keeping a changelog, simply learning to add a git tag on each version increment is an improvement, as it allows the length of the commit list to be automatically limited to what is relevant. For someone like Ryan, who tends to commit larger changes at lower frequencies, just using the git-tags feature to limit the list of commits to those between your installed version and the newest version is probably all that is needed.1 point
-
1 point
-
@Robin S -if you have original files (InDesign or compatible) you might want to take a look at Adobe's DPS: https://digitalpublishing.acrobat.com/welcome.html I haven't looked into it in a while, but what I wish would happen would be wide spread adoption of EPUB 3 so we could build layout style publications that reflow properly on smaller devices.1 point
-
Thanks for all the replies! In my scenario (which I'm investigating mostly out of curiosity as the client is not pressing me for a solution to this) there would not be a budget for an entirely new app development. The desire is to present an existing website via an app wrapper. It seems like there are a bunch of SaaS providers who offer this (the ones I found all looked kinda dodgy) but with the catches being: 1. An internet connection is required, because the app user is essentially just browsing your live website inside a wrapper. What I'm looking for is something that could crawl a website and then save the content for offline browsing. For Android there is this: Offline Browser - which looks pretty good, but it's for general-purpose browsing. I'd like something that can be packaged up and distributed for just for one website. 2. You have to pay an ongoing subscription for the provider to do basically nothing. 3. If the provider goes bust (and several I looked at did not inspire confidence) your app goes bust too. Thanks, will look into that. Seems like development would be faster than some other options, but I think it would still be a fairly costly addon for the client to pay my development time. In this project there were a lot of images so would definitely go beyond 50mb. Also still not sure if the service worker can crawl the entire site without users actually browsing to those pages. Cool idea, but in my example the end users are forestry roading engineers working in different locations across the country so probably not viable to give each their own Raspberry Pi. Would also need a pretty rugged housing. That's not the objective - it's actually sort of the opposite of the objective. The source format is PDF but the problem is that the PDF layout is for a large-format printed book. It does not adapt well to small screens. Also I think the client is enthusiastic about the prospect of making easy document edits via the PW backend. I think there is a gap in the market here (anyone looking for a startup idea?). Off the top of my head I can think of half a dozen previous projects where I think the client would have liked to be able to deliver basic static website content offline to mobile devices. Worldwide there would be a big audience for this. What's needed is the same sort of native wrapper idea the SaaS providers are selling, but with the crawl-and-store features of the Offline Browser app. And sold as a one-off purchase because I think buyers know there is not a lot of ongoing service being provided that justifies a subscription, and would like the confidence that the app keeps working if the provider goes bust. It sucks that Apple are so restricting about the delivery of iOS apps, but I suppose there are security concerns and a lot a malicious agents out there.1 point
-
@szabesz yes but stranger things happen on the web! The original PDF's are 'print-ready' so not web optimised and Robin S didn't say how they were 'adapted' to responsive web docs. Just putting an idea out there as an alternative to developing and maintaining a separate app... can all be done within PW.1 point
-
1 point
-
It would be funny to convert PDFs to responsive online documents and afterwards back to PDFs Or am I missing something? +1 for Ionic BTW. Ionic Creator (which is the Ionic framework's little brother) is even click and play.1 point
-
Hi @cstevensjr - nice looking site and story. I hope it proves successful for you wife. One small thing - I noticed that all the links in the sidebar open in a new tab - I assume that this isn't intentional? Cheers, Adrian1 point
-
1 point
-
Thank you adrian, you are so quick, thanks alot, i guess the links you shared can possibly solve my problem and i am also thinking about the way you presented the paging approach. thank you. will update you soon.1 point
-
From what I gather so far, I might be wrong here, but I think you could: 1) Git clone the admin theme. 2) Go to '/AdminThemeUikit/uikit/'. Copy the '/custom' folder into the same level, rename the old folder 'custom.original' or something in case things go pear shaped. Your theme must be inside a folder called 'custom'. The folder inside this is called 'pw', but you could leave that as is. 3) Crack open terminal, navigate to the uikit directory. In my case: cd /Users/Sam/Desktop/AdminThemeUikit/uikit npm install // installs webpack and other random node stuff npm run compile // to compile everything npm run watch // to watch for changes 4) Add your overrides into '/AdminThemeUikit/uikit/custom/pw.less'. Saving this then compiles your new colours/padding/whatever etc. It would just be a case of just using this new admin module with your new css in /site/modules/ as the paths to the css/js would remain the same. The final compiled file transforms from 'pw.less' (which pulls in 'uikit.theme.less' and 'pw/_import.less': _import.less in turn pulls in the components) into: /AdminThemeUikit/uikit/dist/css/uikit.pw.min.css All the available scripts you can run are in: /AdminThemeUikit/uikit/package.json Prepend with 'npm run...' npm run build-scss', 'npm run compile-js' etc. "build-scss": "mkdir -p src/scss/theme & mkdir -p src/scss/components & node build/scss", "compile": "npm run compile-less && npm run compile-js", "compile-js": "node build/build", "compile-less": "npm run icons && node build/less", "compile-rtl": "npm run compile-less -- rtl", "icons": "node build/icons", "prefix": "node build/prefix", "scope": "node build/scope", "release": "npm run compile && npm run compile-rtl && npm run build-scss && node build/release", "watch": "npm-watch", "test": "webpack-dev-server --inline --hot && open http://localhost:8080/tests/" Then you can run: npm run test I got some errors, but strangely, after a couple of attempts and refreshing the page, I get a test page at: http://localhost:8080/tests/ Sadly, I can't upload my screenshots because: Drag files here to attach, or choose files... Max total size 0.02MB I don't know why but it's happening to me constantly, and it's quite limiting to say the least! Anyway, I might be wrong and I haven't modified anything yet, but I believe it's along these lines. One thing that's strange to me is that: /AdminThemeUikit/uikit/custom/pw/ ...has both less and css files within. This doesn't seem right, the css should only be in the dist folder. Anyway, this is as far as I've investigated. Maybe this helps a little. I'll probably try and build a theme just with custom colours tomorrow to see if this is the correct method. Ultimately, I want an admin theme with a sidebar, no overlay sidebar at all and a minimal masthead.1 point
-
If the main objective of this project is to view PDF files/manuals offline, then do you need to build an app for viewing PDFs? Perhaps there's some security requirement we're not aware of. If not, can you not use off-the-shelf solutions/apps like Adobe/Fox It etc to view and use Dropbox/OneDrive/Some Cloud Storage to sync?1 point
-
Hi awebcreature, I'm actually developing 2 projects which are similar to this. In on project it's possible to manage time entries for projects an in the other project the people can manage keys, smartphones, cars, clients, entries for clients, documents which are nessecary for clients. So my advice is that you plan everything on a white sheet of paper and then you can code it with ease in ProcessWire. You can manage the structure of the project with the help of ProcessWire1 point
-
ah, i forgot to mention that i also played with ionic some weeks ago - but i think the ionic view app needs an internet connection. at least when you want to update your app. don't know how long it keeps apps in the storage for offline use (if it does at all).1 point
-
Interesting project throwing in another idea: could it make sense to use a raspberry pi zero as hotspot&webserver? then you could browse the manual hostet from the pi with any device that connects to the pi just as if the connected to the online manual. at home where you have web access you could update your docs via cronjob so the pi would always have the current version of the docs. http://www.raspberryconnect.com/network/item/331-raspberry-pi-auto-wifi-hotspot-switch-no-internet-routing https://www.heise.de/ct/ausgabe/2017-22-Digitales-Flugblatt-Raspberry-Pi-mit-Batterie-als-anonymer-WLAN-Hotspot-und-Webserver-3851689.html (german)1 point
-
1 point
-
The brief is to have something that is viewable offline. Jasonette needs to call home every time you access it. https://docs.jasonette.com/ Edit: Above not true; see correction below1 point
-
I read about Jasonette (https://docs.jasonette.com/examples/), a way of creating an app via json files. It seems very interesting, maybe you can give it a try.1 point
-
@ziu I think this is what you are looking for, but not positive of your exact scenario: http://modules.processwire.com/modules/admin-restrict-branch/1 point
-
Sorry, @bernhard - yes I did see it. I haven't investigated fully yet. I am still not totally convinced of the right way to go - the Github Pages site is ready to go and can accept PRs, but @netcarver also has something cool up his sleeve: Amongst its many features, makes the ReadMe file viewable from the Module settings within PW, so maybe that is actually a good place for docs after all? So, not forgotten, just percolating. Thanks again for the suggestion!1 point
-
Hello @Robin S In general, the simplest stack gulpfile.js + package.json is about 5kb in size, its not a big file, and it speeds up front-end frameworks. I like the new UIKIT Starter and I would like to be able to edit it quickly with these tools without learning how to properly connect them to the profile. Processwire is not only a framework for PHP developers, but there are many who are faced with the front end. Note that the new users would like to see what Processwire can do and without Profiles it will not know anything else. The new ones will not know how to add a profile to the Processwire installer, and not everyone will go to the Processwire forum to find out more. You mentioned the reduction of the core and I agree with you 100% to throw out the profile but you could add an installer that gets profiles from github like the October CMS that can install automatic templates. I do not know if it's possible in Processwire (I know the basics of PHP but no more to create a new Download System). And this profile above I created using ProcessExportProfile, which works great, I made it for new users who might have installed it sometime and discover it that in addition to Wordpress, Joomla and Drupal is also ProcessWire ( Except that they need to know how to add to the installer ). I would like more developers and regular users to notice Processwire. But maybe the change I wanted was not the best way. Thanks to Robin for your point of view.1 point
-
Thanks flydev! I pasted your code into my template, and I got the attachment in the email! I owe you a beer. I've been slowly reading the php documentation on file uploading, to try to understand the theory behind all this stuff, so I can better understand the tips you guys are giving me. Thanks again!1 point
-
The documentation for my arduino sensor kit I received the other day written in Chinglish made more sense. For bootstrap, I just installed with npm and made a gulpfile to do all the preprocessing with some tools of choice. 'use-strict'; var gulp = require('gulp'); var sass = require('gulp-sass'); var autoprefixer = require('autoprefixer'); var postcss = require('gulp-postcss'); var sourcemaps = require('gulp-sourcemaps'); var postcssFixes = require('postcss-flexbugs-fixes'); var cssnano = require('cssnano'); var rename = require('gulp-rename'); var uglify = require('gulp-uglify'); var paths = { sass: 'src/scss/', css: 'src/css/', js: 'src/js/' }; gulp.task('sass', function() { var processors = [ autoprefixer({browsers: ['last 2 versions'], cascade: false}), postcssFixes() ]; return gulp.src(paths.sass + 'styles.scss') .pipe(sass({ includePaths: ['node_modules/bootstrap/scss'] })) .pipe(postcss(processors)) .pipe(gulp.dest(paths.css)) }); gulp.task('watch', function() { gulp.watch(paths.sass + '**.scss', ['sass']); }); gulp.task('minifycss', function () { var processors = [ autoprefixer({browsers: ['last 2 versions'], cascade: false}), postcssFixes(), cssnano() ]; return gulp.src(paths.css + '*.css') .pipe(sourcemaps.init()) .pipe(postcss(processors)) .pipe(rename({suffix: '.min'})) .pipe(sourcemaps.write('.')) .pipe(gulp.dest('dist/css/')); }); gulp.task('uglifyjs', function() { return gulp.src(paths.js + '*.js') .pipe(rename({suffix: '.min'})) .pipe(uglify()) .pipe(gulp.dest('dist/js/')); }); gulp.task('build', ['minifycss', 'uglifyjs']); Now, theoretically, I could simply 'npm install uikit' and change a few things, use less, point to uikit instead of bootstrap etc. var less = require('gulp-less'); //... includePaths: ['node_modules/uikit/src/less'] Something like that, then pull everything in to a less file, make you theme inside your project directory, not in the node_module folder, thus using 'my own' build process. I have not tried AIOM module yet but that looks interesting. I've noticed a couple few things so far with uikit: 1) The less has all the prefixing in it already for some reason, rather than autoprefixer. 2) The compile time with their out-the-box (less) build process is painfully slow, about 5-6 seconds before I can refresh and see changes. My build process above was pretty much instant (but was also sass). 3) It seems I'm forced to include their JS just to use the grid. So far, I've got /custom/pwtuts.less: // Core @import "../src/less/uikit.less"; // My theme @import "pwtuts/_import.less"; // mixin to add new declaration .hook-card() { background-color: orange; color: white; } @card-body-padding-horizontal: 100px; @card-title-font-size: 51px; // weird number so I can find it easy in the css output file... I'll give it a shot for another week or so and see where it gets me. I'd like to use it but their build script is just too slow and I can't see a way of including my own custom JS into it. I also still have no idea why I've got '/src/less/components/' and '/src/less/theme/' folders. They import slightly different things in their respective '_import.less' file but the penny has definitely not dropped for me yet. Actually, now I've got the core (components), the theme (theme), and a custom theme (pwtuts). lol where's the banging head against wall emoji?1 point
-
If I am not dumb, WireUpload() doesn't create the destination dir in the given path if it doesn't exist and here is the first problem, you should create the dir before uploading the file (are you sure your files is uploaded in $config->paths->assets . "files/useruploads/" ?) , second - as adrian pointed out - is the attachment path. Check below your corrected code, it should work: <?php namespace ProcessWire; $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); $email .= $_REQUEST['email']; if (isset($_POST['submit']) and isset($_POST['email']) and isset($_POST['comments']) and isset($_FILES) ) { //image upload begin $upload_path = $config->paths->assets . "files/useruploads/"; // create the dir if it doesn't exist if(!is_dir($upload_path)) wireMkdir($upload_path); $user_image = new WireUpload('user_image'); // References the name of the field in the HTML form that uploads the photo $user_image->setMaxFiles(5); $user_image->setOverwrite(false); $user_image->setDestinationPath($upload_path); $user_image->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // execute upload and check for errors $files = $user_image->execute(); //image upload end $to = 'me@email.com'; $subject = 'Feedback from my site'; $message = 'Name: ' . $sanitizer->text($input->post->name) . "\r\n\r\n"; $message .='Email: ' . $sanitizer->email($input->post->email) . "\r\n\r\n"; $comments = $sanitizer->entities($sanitizer->textarea($input->post->comments)); $message .= 'Comments: ' . $comments; $success = $email; $success .= $message; $mail = wireMail(); $mail->to($to)->from('me@email.com'); $mail->subject($subject); $mail->body($message); $mail->attachment($upload_path . $files[0]); $mail->send(); } ?> <html> <head> <meta charset="utf-8" /> </head> <body> <form id="option3form" action="./email-with-attachment" method="post" enctype="multipart/form-data"> <label for="name">Name: </label> <input type="text" name="name" id="name"> <label for="email">Email: </label> <input type="email" name="email" id="email"><br /><br /> <label for="comments">Comments: </label> <textarea name="comments" id="comments"></textarea><br /><br /> <p>Click the "Choose File" button below to upload your image.</p> <input type="file" name="user_image" /> <input type="submit" name="submit" value="Submit"> </form> </body> </html>1 point
-
You aren't on your own. The docs aren't mega clear. I got something working with the LESS version and AIOM (which can compile LESS) but it doesn't feel very 'sleek'.1 point
-
@rafaoski, do you know about the Site Profile Exporter module? You can make your own profile (or edit an existing one) and add in whatever technologies you want, then export it and use it for new PW installs. I'm not sure why any of the things you are requesting need to be connected with the PW core as everyone's preferences are different. When it comes to profiles that are bundled with the core I'd like the number to reduce (to, like, 1 maximum) because for me I never use them and it's just unnecessary megabytes that have to be downloaded and unpacked with every new core release. Currently nearly half the size of the PW downloadable core is made up of site profiles that for some users (most?) will just be immediately deleted. I'd rather see each "official" profile in it's own GitHub repo where they can be downloaded only if needed.1 point
-
1 point
-
The below works for me with AJAX updates. In /site/init.php: $wire->addHookAfter('InputfieldPageTable::renderTable', function(HookEvent $event) { $out = $event->return; // Add checks here for specific PageTable fields, specific templates, etc. // Your table header replacements $replacements = [ 'Title' => 'Foo', 'Headline' => 'Bar', ]; foreach($replacements as $find => $replace) { $out = str_replace("<th>$find</th>", "<th>$replace</th>", $out); } $event->return = $out; });1 point
-
Currently on Laragon with PHP 7.1.7 without any issues.1 point
-
@adrian what about using readthedocs? https://docs.readthedocs.io/en/latest/getting_started.html1 point
-
Interesting Conference / Talk from Rasmus Lerdorf, creator of PHP.1 point