Jump to content

gornycreative

Members
  • Posts

    154
  • Joined

  • Last visited

Everything posted by gornycreative

  1. If you want to try the example I built (it looks for css/less files in assets/fonts and templates/ and then parses font families and returns a select options box with unique path/font family pairs) let me know and I'll tidy up an example and attach it. On the backend it gives me this:
  2. @Macrura sorry I meant $wire->files... I did end up finding a way to do what I needed to although I came across a few interesting issues that I can't really explain. The functions were from a module context, so I had to pull them abstract them away from $this and just tried to manipulate them directly, since it seemed like a $wire object should still exist. When I ran a db($wire->files) the bar dump said that this did represent a WireFileTools object, but the find() method was faulting, saying that the object was null when I tried to use $wire->files->find($something, $somewhere). Are the API helpers only available in certain contexts? What I ended up doing was the following: First, I brought my functions into a separate _theme_fn.php file. If I included them in the main Inputfields generating file, I got a cannot redeclare error, perhaps the settings factory config file is iterated in some way. I put both my settings factory config file and the external functions file in the PW namespace. Second, in the external functions file I brought in a $wf = wire('files') and $wc = $wire('config') to the functions which allowed me to grab default paths, run the file searches and create the appropriate select options arrays. Third, in the main settings factory file, did an include_once on the functions file and then I just set variables to call those functions and then inserted that into options. This lets me generate select options arrays dynamically. If you want a concrete example, let me know. It is hard for me to determine sometimes whether I am able to use an API variable or have to actually call functions to create my own object on the customization side. Front end side and modules seem much clearer.
  3. This module has been very useful. As I have been playing around more with module configurations for my own work I have started using $wire->file methods to find files and populate options for dropdowns for my modules. Regarding Settings Factory, I have set manual select options in the past, but it would be great to know if logic can be placed in the settings file to generate options using wire objects. I realize the PHP style settings factory configuration file uses InputfieldWrapper, etc. The settings file itself isn't namespaced and doesn't seem to instantiate anything. $wire->file itself, in the context of the settings file, seems to be null. Are there any objects available to use to manipulate file via the wire object (find files, grab config paths), or would I need to write those functions with php? Have you used logic to dynamically build select options? Thanks again! ~J
  4. I'm sure the answer is yes, but... This replaces RockLESS functionality, correct? RockLESS can be replaced/removed since the styles array and vars covers the same ground?
  5. Looking at the modules install() code it doesn't actually do a duplicate check when a module is first installed - at least I couldn't find any calls to methods that suggested it. Once a module config is in the db table the flags flip and duplicate data entries appear in the JSON payload when the modules cache is refreshed, but there doesn't seem to be any reference to that information under other circumstances - so until one version is installed and the config is saved in the db, PW doesn't recognize duplicates exist in the filesystem. Not a high priority item, but I'll make an issue for it on github. Could save some headaches down the line.
  6. For some reason on a new site on 3.0.208 a duplicate module is not being detected. I have the standard release and a multisite modified version. On my established sites I am able to choose between the two module base directories but on a new installation with 208 and the same module folder it only detect the first module of the pair and will not install it because of a class name conflict. I've tried clearing cache, setting the appropriate cache disabling rule on cloudflare, deleted compiled files and tried removing one version, installing the remaining version and then adding it back it. The duplicate module is not seen. This is for two module codebases that define the same class and exist in two different folders in the /site/modules/ directory. Sites upgraded to 208 don't seem to have the issue. I can install and configure the module on upgraded sites and select the version on the configuration page.
  7. I usually do post rock: Sigur Ros Under Byen Album Leaf Godspeed You! Black Emperor, etc. Sometimes some shoegaze My Bloody Valentine (duh) Fleeting Joys Blonde Redhead, etc. Often game soundtrack bits: Amos Roddy (Two Kingdoms franchise) - this gets LOTS of play - just super calm and thoughtful ambient. Disasterpeace (Fez, Hyper Light Drifter) Bioshock scores and the Black Mesa score Love the Limbo soundtrack - its just too short. He's got some tracks in a few other games but they just aren't as interesting IMO. Lots of Fripp and GC stuff, some Eno also. Sometimes the prog side but usually that's too engaging to code. Dunno, all over the place in general. Lately I've been on an old Tame Impala and old Phantogram kick. My playlist is all over the place. Sometimes classical - Holst, Bartok, etc. I think the only rule is I have to be familiar with it. I can't just throw a new Tool album on or something and think I'm going to be able to concentrate.
  8. You don't have to support multisite with your tools - it just will make sense to mention that in your feature set. If a person installed multisite according to the tutorials/instructions provided on the PW site: https://processwire.com/docs/more/multi-site-support/ Under option #1 they typically will have a directory structure where their main website install is under /site/ and subsequent sites start in tmp/site and then are moved under /site-1/ /site-2/ or something similar. For example, a person installs a new /site-3/ and decides they want to try your front-end plugin. They add your module to /site-3/ and want to install a new uikit profile there. They might be shocked and upset to find their /site/ folders and files were modified. I'm guessing you'd hear about it.
  9. Hi @bernhard: I tried to use this in a multisite environment, but /site/ is hardcoded in a few places rather than use of the $this->wire->config->paths->site value. In particular the StylesArray.php class where paths get passed to LESS methods, Also the excludeDefaults paths in LiveReload.php In the main RockFrontend.module there is hardcoding in the renderMatrix method - I haven't used it yet, but I noticed it going through. A way to reproduce might be an installation where you rename the /site/ folder to something else - as in multisite the different site folders are generally called something like 'site-domain' or something similar. I guess I am the only one who still has some multisite installations, but for some projects it make maintenance simpler and more consistent.
  10. I recently came across another interesting palette visualization option used in astronomy visualization and enhancements. cubehelix - https://www.mrao.cam.ac.uk/~dag/CUBEHELIX/ It gives a broader spectrum of colors while maintaining linear perceived brightness levels. Was messing around with its implementation in chroma.js https://gka.github.io/chroma.js/
  11. Getting a strange error on PHP 8 fresh install, v 3.0.207 Module version is the latest. Looks like $configData['CKEaddons_plugins'] is not getting initialized properly? It's coming across as NULL even though the defaultConfig array defines the default as an array. Not sure if this has anything to do with the transition to TinyMCE?
  12. It's been awhile since I have installed another site on a multisite instance, and for some reason the new installer with separated site-profile folders just doesn't work for this setup. I can resort to cloning another database schema and try to make it work manually but there is really no clear documented method for managing this scenario. I've also tried putting the site-blank profile folder in all sorts of places and it simply never gets detected. I'm going to dig into the code to try to find the answer, but honestly this should be documented if there are going to be hard stops now in the installation process. EDIT: Looks like I need to rename my /site/ folder - put the site-profile folder in the root directory, do the installation and then rename the directory to whatever it needs to be for multisite redirection. Gah.
  13. Not meaning to raise a zombie thread, but in case others have this question... Instead of symlinks, it may make sense for you to set up a root installation that holds all of the things you'd like to share and then alter config paths in your config file... So for example, in a /site-realsite/ installation with a root /site/ install where you keep all of the module code you want to share between multisite installs: $config->paths->siteModules = $config->paths->root . 'site/modules/'; $config->urls->siteModules = $config->urls->root . 'site/modules/'; My guess is you could also do the same thing with scripts and styles paths? or at least your templates path.
  14. What's the best way to access $adminTheme methods from a module setup? I'm trying to add $adminTheme->addClass('body','chroma'); as I would in an admin template file replacement but I am not sure where it is in the wire modules hierarchy or if there is a hook. I've tried calling it as a module from the ready() function but it's an abstract class. Not sure what to do.
  15. I don't know if this is a bug or a feature, but I discovered when trying to @import (optional, inline) '/path/to/some/file.css' The code from the css file is brought into LESS but the relative url references do not get adjusted (thus they break). A standard LESS @import of css happens like any other type of import. I was trying to consolidate my css. So as an example, I'm trying to import a css that declares a font-face: @font-face { font-family: 'Acherus Grotesque'; src: url('acherus_grotesque_-_regular-webfont.woff2') format('woff2'), url('acherus_grotesque_-_regular-webfont.woff') format('woff'); font-weight: normal; font-style: normal; } The css file resides in a subdirectory with the font files - pretty typical. It works fine when I run it as @import (optional), but when I bring it inline it shows up unmodified in the final LESS. As a result, it looks for font files in the site/assets/ folder where the admin.css file gets written. Is there a workaround/option I'm missing? I've tried setting the option to process as less files - no difference.
  16. UIKit uses four different color designations: You mentioned above that UIkit conventions only have two colors. I was just saying that there are four colors to be concerned with if you are trying to create dark and light themes. I don't use slang, but I do tend to use what are called sentence fragments if I am writing a quick note. These fragments are probably not easy to translate. I will avoid them if I can.
  17. There's blue and black in the primary and secondary, but we can't discount default (white) and muted (gray) in UIKit specs. Particularly if there is a desire to be able to engage light or dark options. Haven't installed it yet - I'll add it to the checklist though as I plan on using it.
  18. Yup I get that. Just a suggestion that if a link is going to be included in a tutorial 'Next Steps' a step should actually exist, or perhaps suggesting that a person look at the source code in core for documentation is in order. The documentation in the source is very helpful - I think that's a feature that gets buried often and isn't brought up to new users. It was awhile before I realized how much extra information was in there for devs.
  19. I am working through several color calculation options that will be part of my style module. I will let folks know when it is ready. Yes, UIKit's use of default, primary, secondary, muted provides a lot of color options. My interest is in being able to offer option for selecting up to three colors and having caluclations to provide adequate palettes for each, including UI contrast concerns. And yes, those highlights are part of the issue, as well as highlights/focus color changes on certain inputfields, and yes, there are buttons that appear in different places with either reno coloring or default coloring (like the delete button in certain areas). Likewise, the alert color schemes don't always necessarily fit well with different color schemes. That's what I am experimenting with at the moment.
  20. No that was just really quick pseudo. I just wanted to make sure I wasn't putting things in the wrong place generally. I was able to get the information reliably.
  21. ConfigurableModules class link from those pages leads nowhere helpful... a dead end. https://processwire.com/api/ref/configurable-module/
  22. Hi, I'm trying to wrap my head around configurable modules. The issue I am running into is that I'm not sure when or how to get the configured values to be used for other backend processes. At first, the config saved but nothing on the backend in terms of methods was using those value. Now when values change, the backend methods pick up the changed values to the config and uses those in my method calls, but if a value didn't change it doesn't get brought in to my public vars. The structure I have in place (roughly) is:\ class ClassName extends WireData implements Module, ConfigurableModule { getModuleInfo() { } public var declarations public function ready() { $mod_config = modules()->getConfig('ClassName') //I have code here that assigns values from the $mod_config array to my public vars if values exist } public function getModuleConfigImputfields() { //Here I've got my fields set up properly and the config saves fine and values load fine from the DB. } } Is there something else I need to do to utilize those values?
  23. I wish I could live and program in a world of "shoulds" but years of working in the WordPress ecosystem has cured me of holding free module developers to high expectations. I do agree that the module format should have either its own css and/or less asset folder, but I also take into consideration that adding LESS and AdminStyleUIKit features to PW is a very recent endeavor. It's one I support and would have certainly argued for, but in working with many old and new modules in the directory, there are a lot of abandoned modules that are still in production which don't necessarily conform to what has been built recently. It's worth discussing how modules should handle their assets - including scripts and styles - on the admin side. Maybe a new thread?
  24. Because there are modules that other people have created which add inline styles and colors and all sorts of other things that are not covered by the default pw and rock LESS styles. They aren't my modules! 😄 For example, AdminOnSteroids - the admin config interface there has all kinds of crazy styling going on. Left to its own device it looks pretty bad with a dark theme. I have a file that contains override that use the main color variables. Will probably be useful for other folks trying to style their admin and aren't sure what is going on with some crazy config screen. But not every site uses AoS, I don't always deploy it. So why include those style rules for sites that don't have the module installed? There's stuff in core as well that was put together before the UIkit days that have static css - I guess some of these could be resolved by "inherit" maybe? I haven't felt confident enough with the changes I've made myself to suggest pull requests but I can dig into it later. There are a few others. Look at the modules support @flydev has added to his theme to correct/adjust the look of admin configuration interface for some of these modules. For now I'll just load them all and see how bad the bloat is. If it ends up being negligible then great.
×
×
  • Create New...