-
Posts
716 -
Joined
-
Last visited
-
Days Won
26
Everything posted by Jonathan Lahijani
-
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.
-
From time to time, I copy/paste snippets of code in the forum here to my editor (SublimeText). Unfortunately, I think the forum software sometimes throws in invalid, INVISIBLE unicode characters that break the copied code and usually will throw PHP errors that at first sight don't make any sense. These characters are impossible to detect in SublimeText, but with the following plugin I just discovered, it will identify them: https://packagecontrol.io/packages/Gremlins
-
Just a note, better to update the recipe code to: if($page->template=="admin" && $page->parent->id==2 && $page->name=="settings") $input->get->id = $pages->get("/settings/")->id;
-
Module Page Image Manipulator | API for 1 & 2
Jonathan Lahijani replied to horst's topic in Modules/Plugins
@horst I filed this bug report a few weeks ago (includes a video of the bug). Any insight as to why it may be re-generating already generated images? https://github.com/horst-n/PageImageManipulator/issues/4 -
New post: Weekly update for 18 Jan 2019
Jonathan Lahijani replied to ryan's topic in News & Announcements
In regards to API Variables in the documentation, is there a reason why the $notices variable is not listed with all the other API variables? It does have its own documentation page: https://processwire.com/api/ref/notices/ Also, same for $options, which I got a mixed response about here (2015): -
New post: Weekly update for 18 Jan 2019
Jonathan Lahijani replied to ryan's topic in News & Announcements
This is great life advice! -
Going here causes internal server error: https://processwire.com/blog/posts/
-
How about a new favicon of the ProcessWire logo instead of being lost in the clouds? I attached two 512x512 PNG files (PNGs can be used for Favicons by the way and all browsers support it; worth ditching .ico).
- 290 replies
-
- 10
-
I'm not a Mac user, but for Windows, Xyplorer is freaking amazing. It's like the ProcessWire of file managers. ?
-
Working on this, which I hope to finish off at some point in a couple weeks after the main site launch: It will be 2 minutes and 11 seconds long, which is the length of the audio (full audio here). I will try to make it show off the power of ProcessWire as much as possible (tree, fields, matrix, front-end editing, api, docs, formbuilder, procache, github activity). I may need to extend the music a bit for it all to fit. Anyway, this is happening!
- 290 replies
-
- 11
-
When scrolling down the home page, the animations of the 8 callouts cause a horizontal scrollbar to temporarily appear while they animate in. Adding the 'uk-overflow-hidden' class to the #content-container div should fix that.
-
The offcanvas toggle icon is using the slightly older approach (the markup got updated at some point during UIkit 3's development): Replace: <a id=offcanvas-toggle class=uk-hidden@m href=#offcanvas-nav uk-toggle> <span uk-icon='icon: menu; ratio: 1.3'></span></a> With: <a id='offcanvas-toggle' class="uk-navbar-toggle uk-hidden@m" uk-navbar-toggle-icon href="#offcanvas-nav" uk-toggle></a>
-
Tampermonkey will let you modify the code of a page: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en You could create your own CSS file, and then establish a setting in TM to load that file (other's would have to do it on their browsers as well however).