-
Posts
794 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Jonathan Lahijani
-
Maintain separate configs for live/dev like a boss :)
Jonathan Lahijani replied to bernhard's topic in Tutorials
In regards to dev vs live htaccess, you can also use htaccess's "if" conditional for blocks of code you want to selectively enable/disable depending on the site being loaded. By doing so, you don't need two separate htaccess files to maintain. When using ProCache combined with it's htaccess recommendations at the top, I wrap it inside a conditional like this: ################################################################################################# # ProcessWire ProCache recommended .htaccess tweaks for expires and gzip performance settings. # PWPC-3.0 Keep this line here for ProCache identification purposes. ################################################################################################# <If "%{HTTP_HOST} == 'my-live-website.com'"> ...the code here... </If> -
You can upgrade every component in this new Mac Pro... it's basically a normal tower. Also, you could upgrade the CPU in the trashcan... it was just difficult (my friend runs a Mac business and has upgraded them hundreds of times).
-
Regarding the price, it remains to be seen how much "Apple Tax" there will be in it, but with higher end hardware, Apple's price offering sometimes matches comparable non Apple systems, and you get Apple's cool design and better resale value.
-
No, web development doesn't need that kind if power, not even close. This system is targetted to high end video and audio production. Plus I'm a Windows guy.
-
"Modular" is just a fancy word Apple used to say it's a normal tower design whereby the components can be upgraded and are not soldered in.
-
It will be free, open-source, like other starter tools out there.
-
For the last couple months, I've been working on a module that does exactly this. It's not a site profile, it's not a theme. I don't know what term would accurately describe it, but its a ProcessWire module that's an opinionated, update-able starting point, oriented towards developers, and brings in a bunch of boilerplate like: an installer that will create fields, templates, pages, hannacodes; it runs through a thorough check before doing anything that may result in an error (module installation errors are aggravating; i'm testing it very thoroughly) the installer will rename your 'templates' dir to something temporary, and then copy a starting 'templates' folder that's prepped for the module (you should only do this on dev) if you try to add it to an existing site with a bunch of data, it will work as long as there are not collisions in some fields and templates; if there are, the module won't install and tell you what you need to change around to allow it to install establishes some new $config variables ('env', 'disableTemplateCache', a few others) built with UIkit 3 in mind, but not hardcoded to it a menu builder based on Repeaters with its own Process Module has its own seo+og+twitter+sitemap metadata fields and uses Profields FieldGroup since that is the best module for handling such a grouping has it's own templates inside the module which can be used, or overridden in /site/templates/; this includes blog sitemap.xml maintenance search in addition to template files being able to be overridden, partial files can be overridden too! some module configuration fields (site_name, maintenance, etc.) the module has documentation and other statistics built into it for easy reference takes full advantage of setting() and markup regions; applies attributes like UIkit 'uk-grid' and other data attributes without "touching" the html; keeps the module flexible and easily allows you to rip out UIkit and swap it for another CSS framework (Bootstrap 4); you'll never need to touch edit the _main.php file because of how regions has been set up has it's on RepeaterMatrix fields with boilerplate matrix-types (headline, text, slideshow, etc. etc.); if the user makes new custom matrix types and a later version of my module brings in a new matrix-type, it will update the RepeaterMatrix field and merge it correctly (tricky to do!); the matrix types use many of the same base fields, thereby allowing you to switch from one matrix type to another without data being destroyed (this was only possible as of 2 weeks ago with the new matrix update) to avoid creating a bunch of 1-off fields for the matrix field for block configuration, it uses the new and quite amazing Mystique fieldtype in a unique way (this was tricky to do); this module is critical to establishing a page-builder that is clean (this was only possible as of April 2019 since the module is brand new) brings in PW's debugger to the frontend (brings in jQuery UI); can be disabled all field and template names don't use any prefixes; this would allow you to dump the module one day in the future if you don't like it, without having a bunch of field and template names that sound too specific to the module Laravel Mix based asset compiler pre-configured with UIkit works with FormBuilder and other modules I often use; works and may require certain Pro modules; eliminates the need for any modules that do blogging, menu building, sitemap, maintenance or seo since this module does it using native ProcessWire login/logout/account/register templates it may include a 'collection' generator for common things like events, products, people, properties, along with some templates for those. don't like the templates my module provides? then just create your own template file in /site/templates/the-template-file.php which will override /site/modules/my-module-name/templates/the-template-file.php Right now I just started building a few sites with it (spent the last 2 months developing it) which will hammer it out further. I will release it late summer, early fall.
- 18 replies
-
- 21
-
-
If you follow high-end, professional grade hardware like I do, then this announcement today by Apple will blow your socks off: https://www.apple.com/mac-pro/ Hopefully Nvidia graphics cards will be supported in the near future.
-
Gutenberg For ProcessWire ?!
Jonathan Lahijani replied to Mustafa-Online's topic in Module/Plugin Development
RepeaterMatrix is going to be the best choice for any type of page builder in ProcessWire (at least at this time). The recent updates to the module improve its flexibility further, such as being able to change the matrix-type of an item that's already been added to a page (this is similar to Gutenberg functionality of being able to change block-types... nice). After using RepeaterMatrix and its equivalents in other CMSes over the years (such as WordPress ACF Flexible Content field), my suggestion is you're better off NOT providing fully customizable layout functionality within your builder (that is, avoid the capability of allowing users to add things like containers, rows, columns). I've personally found that even other CMSes that do this well and are built around that concept are just too clunky. It's the nature of the beast. The better approach in my opinion is to provide a good set (5-10) of matrix-types/blocks that can instead achieve this. Once again, the recent feature addition whereby matrix types can be changed is going to help here since switching a matrix-type retains its content as long as the matrix-type you are switching to uses the same fields. -
Unexpected FileCompiler behaviour with "require"
Jonathan Lahijani replied to noodles's topic in General Support
While rare, there are some situations where the FileCompiler may not convert code correctly. If you are using an older version of PW it may have already been resolved in a newer version. Besides, you could probably simplify that code to something more simple. Adjust this accordingly with your language variable if needed: -
You should be able to. Just assign the Hannacode Textformatter to the fields of your choice and it should work.
-
One huge strength of ProcessWire is the ability to create fields and templates on the fly in the admin and the beautiful architecture of it all. WordPress on the other hand does it the 'postmeta' way which is more loose, but flexible in that fields don't have to be 'registered' and custom templates are purely handled through the existence of a PHP file. Many pros and cons to each approach, but for modules, the WordPress way allows module developers to not have to worry about field settings and such since the configuration of it is NOT stored in the database. (the new Mystique module is similar to the postmeta approach, very cool) ProcessWire's approach gets a little complicated in situations where a custom module relies on a set of fields (native fieldtypes) and/or templates. The MarkupSEO module does this... upon installation, it creates a set of regular ProcessWire fields that the module relies on. But what happens if a future version of the module requires changes to the settings of a field, needs a new field or needs to delete a field (same for templates)? At this point we're talking about 'migrations' found in webapp frameworks like Rails, Laravel, etc. There's the Migrations module, but that's more general purpose. ProcessWire uses the system updater to update core changes. Is there a best practice for keeping fields and templates in check for 3rd party modules? Are there any examples of modules that do this?
-
This still seems to be the case in 2019... the files set in $config->prependTemplateFile and $config->appendTemplateFile must be in /site/templates/: https://github.com/processwire/processwire/blob/649d2569abc10bac43e98ca98db474dd3d6603ca/wire/modules/PageRender.module#L362 If there's a way around this, I'd really like to know. Note: Regular template file locations can effectively be anywhere with the hook mentioned in this GitHub issue: https://github.com/processwire/processwire-requests/issues/204
-
Would you be able to briefly talk more about that here?
-
There is a module in Ruby called Deface which is widely used in an ecommerce system called Spree: https://github.com/spree/deface It's been around for a while. "Deface is a library that allows you to customize HTML (ERB, Haml and Slim) views in a Rails application without editing the underlying view." MarkupRegions essentially works in a similar way. It's a bit of a shift in thinking but it's quite nice if you set things up the right way. I'm experimenting with a site profile that takes this approach extensively. How have you used MarkupRegions in creative ways?
-
In the answer here, the value of '$last_depth' should be -1 instead of 0: https://stackoverflow.com/a/14963270/1397709
- 2 replies
-
- repeater matrix
- depth
-
(and 1 more)
Tagged with:
-
Actually this is possible with the update: https://github.com/processwire/processwire/commit/12aede03fe297421b538ea6ef16c0f42424077a4#diff-fc95d41f7bed91883ef3f4f16d8c92cdR1104
-
Nice update, although I don't think the version bump was committed.
-
Why not just use Chrome's built in password manager that syncs with your Google account? Works flawlessly. I used 1Password for several years and it became a buggy mess, in addition to the whole subscription fiasco vs. desktop app. While Chrome's password manager doesn't have certain categorization features or editing capability after a password is saved, I realized it's really not that necessary.
-
UnionFS for "parent" and "child" site profiles?
Jonathan Lahijani replied to Jonathan Lahijani's topic in Dev Talk
This is a good argument and something to think about. Of course the drawback as you said is that any new code in the generator would have to manually be added to sites that were generated in an older version of the generator. Very nice demo. I'm using UIkit 3 of course. I'd love to check it out. -
UnionFS for "parent" and "child" site profiles?
Jonathan Lahijani replied to Jonathan Lahijani's topic in Dev Talk
It works for overriding a template file (let's say /site/templates/child-templates/basic-page.php for our example), but with partials that get included using PHPs 'include' function, it fails. For example, in /site/templates/_main.php I have: <?php include './_menu.php'; ?> The location of _menu.php is in /site/templates/_menu.php. But since we're overriding basic-page.php, it expects _menu.php in /site/templates/child-templates/_menu.php as opposed to falling back to /site/templates/_menu.php. I wonder if there's a way around this using either include or wireIncludeFile. I was hacking away at this last night but couldn't come up with a solution. -
UnionFS for "parent" and "child" site profiles?
Jonathan Lahijani replied to Jonathan Lahijani's topic in Dev Talk
Nice Robin. I will experiment with this code. -
I'm creating what's essentially a starter site profile that I'll release one day, in the same vein as Underscores or Sage, which are WordPress starter themes. Both of those themes are meant to be used as standalone themes, meaning they should not be a "parent" theme that is overridden by a child theme. For my starter theme, I do actually want to see what methods exist for some sort of override approach for the /site/ folder, or perhaps just the /site/templates/ folder. This wouldn't be a requirement however. ProcessWire does not have such a feature natively, but I read about UnionFS which seems quite slick. I did a little experiment with it on some simple folders and files, and Apache does handle it well with a few simple adjustments. If anyone has any techniques or thoughts on ProcessWire overriding template files at the PHP level or UnionFS (which is at the Linux filesystem level), I'd love to hear your thoughts.