Leaderboard
Popular Content
Showing content with the highest reputation on 10/25/2022 in all areas
-
Meanwhile we have a great new feature: You can now simply paste a google fonts url into the module settings and RockFrontend will automatically download all files to /site/templates/fonts (this is not new) and (this is new) also create the file /site/templates/fonts/webfonts.css and add this file to the sites' styles array. That means if you need another weight of your font (eg you need Gudea 900) you simply add 900 to the url, hit save and your frontend will have that font available ? I realised that before this update there were still some steps required with the old webfont downloader to copy and paste the whole CSS to the correct file etc etc... Now RockFrontend does all that for you ?3 points
-
`$svgFont->filename` solved it! Thank you very much for your help @monollonom!2 points
-
Sounds reasonable!! Please check v2.1.12 @Andi Thx for your help!1 point
-
@bernhard Hi on the site directory templates topic, I think it is just a matter of detecting the template root across the board in terms of /site/templates or /site-subsite/templates... If I download uikit from the RFE module settings, for example, it does get saved in the site-subsite/templates/ directory. If I download a webfont, the same - a fonts directory is creates in site-subsite/templates/ and font files are brought over. However, the sample CSS provided on the backend assumes /site/templates/fonts/ as the root for font files. Likewise, the injected CSS assumes /site/templates/ instead of grabbing the site root directory. <!-- rockfrontend-styles-head --> <link href='/site/templates/bundle/head.css?m=1666711953' rel='stylesheet'> <link href='/site/templates/fonts/webfonts.css' rel='stylesheet'> The actual site root for this site is site-mgtc - so /site-mgtc/templates should be detected. I hope that makes sense. The uikit styling issues were an unrelated VPN issue caused locally - ignore that piece. Lots of convenient stuff here - really liking the operation so far. This is with v 2.1.11 BTW - I upgraded and cache cleared to be safe.1 point
-
Somehow i feel like getPath is doing it's thing correctly..., It's supposed to return false if the path is not valid, or am I getting confused here? ? But in AssetsArray.php -> addAll(), there seems to be a check missing for $path. If I change that to public function addAll($path, $suffix = '', $levels = 2, $ext = ['js']) { /** @var RockFrontend $rf */ $rf = $this->wire('modules')->get('RockFrontend'); bd($path, 'before'); $path = $rf->getPath($path); bd($path, 'after'); if (!$path) return; // ******* <-- add this line ********* $files = $this->wire->files->find($path, [ 'recursive' => $levels, 'extensions' => $ext, ]); foreach ($files as $f) $this->add($f, $suffix); return $this; } The errors are gone... Although I'm not quite sure about what to return there ?1 point
-
So, back on this. If I create an empty folder "site/templates/layouts", there's only two errors coming up.. So I guess for the 3 directories that do not exist, instead of not doing anything, the script somehow falls back to trying to look up files in the server root '/site/templates/layouts' <-- does not exist, error 1 '/site/templates/sections' <-- exists '/site/templates/partials' <-- exists '/site/assets/RockMatrix' <-- does not exist, error 2 '/site/assets/RockPageBuilder' <-- does not exist, error 3 Let me know if you need anything else and thanks again! RF is really fantastic already, and loving the new features.1 point
-
That's what the regular PageReference field (FieldtypePage) is for. Add a new Page Reference field to your template On the Details tab, select "Multiple pages (PageArray)" as the value type On the Input tab, select an Inputfield that supports multiple pages (e.g. AsmSelect) If the dropdown shouldn't show all pages in the site, add limitations in the "Selectable pages" section1 point
-
Hi @BitPoet - I'm pretty sure I did try both with and without defining it as hookable, but will do another test to double check and report back.1 point
-
Error is still there on 2.1.10 unfortunately.. Here's the bd.. I need to run now but I'll happily provide more information later today. '/home/sites/XXXXXXXXX/public/site/templates/site/templates/layouts' '/home/sites/XXXXXXXXX/public/site/assets/site/templates/layouts' '/home/sites/XXXXXXXXX/public/site/templates/layouts' '/home/sites/XXXXXXXXX/public/site/templates/site/templates/sections' '/home/sites/XXXXXXXXX/public/site/assets/site/templates/sections' '/home/sites/XXXXXXXXX/public/site/templates/sections' '/home/sites/XXXXXXXXX/public/site/templates/site/templates/partials' '/home/sites/XXXXXXXXX/public/site/assets/site/templates/partials' '/home/sites/XXXXXXXXX/public/site/templates/partials' '/home/sites/XXXXXXXXX/public/site/templates/site/assets/RockMatrix' '/home/sites/XXXXXXXXX/public/site/assets/site/assets/RockMatrix' '/home/sites/XXXXXXXXX/public/site/assets/RockMatrix' '/home/sites/XXXXXXXXX/public/site/templates/site/assets/RockPageBuilder' '/home/sites/XXXXXXXXX/public/site/assets/site/assets/RockPageBuilder' '/home/sites/XXXXXXXXX/public/site/assets/RockPageBuilder' Thanks a bunch!1 point
-
The issue is most likely RockFrontend->getPath() not returning the correct path for your setup. Can you check this: Add 2 bd() calls in AssetsArray::addAll /** * Add all files of folder to assets array * * Depth is 2 to make it work with RockPageBuilder by default. * * @return self */ public function addAll($path, $suffix = '', $levels = 2, $ext = ['js']) { /** @var RockFrontend $rf */ $rf = $this->wire('modules')->get('RockFrontend'); bd($path, 'before'); $path = $rf->getPath($path); bd($path, 'after'); $files = $this->wire->files->find($path, [ 'recursive' => $levels, 'extensions' => $ext, ]); foreach ($files as $f) $this->add($f, $suffix); return $this; } The output should look something like this:1 point
-
Hey @Andi not sure but I think I'd add a bd(Debug::backtrace()); right above WireFileTools.php:765 to see which files are triggering the error, can you try that and see if you find something useful?1 point
-
Hi @Frank Vèssia, I finally found time to recreate this once in my test environment. Unfortunately, I cannot reproduce the error. My routes definition looks like yours: $routes = [ 'v' => [ '1' => [ 'category' => [ ['OPTIONS', '{slug:\S+}', ['GET']], ['GET', '{slug:\S+}', AppApiTEST::class, 'getCategory'], ] ] ] ]; When I simply dump $data->slug, I get the full "variety" slug when calling the /v/1/category/variety url: class AppApiTest { public static function getCategory($data) { $data = AppApiHelper::checkAndSanitizeRequiredParameters($data, ['slug|pageName']); var_dump($data->slug); die(); } } Can you try out if maybe my latest v1.2.6 update, where I improved the route-merging logic, fixed the issue for you? Or could it be something else which is special to your environment (PHP version? Modules or hooks, that could interfer with the AppApi handlers? Maybe it helps to deactivate the new ProcessWire URL Hook in AppApi's settings?)1 point
-
hi @elabx you're completely right, and following you on the elaboration path, my savage little script is just the php way of doing what @mel47 was trying to write with any kind of array and number of columns but, honestly, nowaday, if i had to do this, as much as i love php i would probably simply iterate the array in the template inside one div/container and use css to generate the columns... ? have a nice day1 point
-
Just to elaborate on another possible method, since getOptions() returns a SelectableOptionArray inheriting from WireArray, you could also do: $columns = $options->slices(3); https://processwire.com/api/ref/wire-array/slices/1 point
-
Hi, i think this is more a php question than a pw one, then i'll answer in my savage php way ? let's assume $intruments is an array and you don't know how many intruments there are, you don't need those first, second col and so on, just iterate $isntruments $total = count($instruments); $colmax = ceil($total / 3); $i = 1; $out = '<div class="column">' . "\n"; // or .= if $out is initialised above foreach ($instruments as $inst) { $out .= '<p>' . $inst . "</p>\n"; if ( $i == $total ) { $out .= "</div>\n"; } elseif ($i < $total && $i % $colmax == 0) { $out .= "</div>\n"; $out .= '<div class="column">' . "\n"; } $i++; } echo $out; // or return if in a function should do the trick, no matter $instruments contains 15, 17 or 200... instruments ? have a nice day1 point
-
Wow! It gets even better! ? Thank you Ryan for the detail, including an example of actual code (I would never have figured that out on my own). I will definitely be implementing this so I can add my affiliate disclosures at the click of a button! There will no longer be the need to retype the same sentence of text at the top of my articles, or even to copy and paste it... instead I will be able to add it at the click of a button! That is wonderful.1 point
-
Could you share a bit more about your setup ? Is your file input set to receive several files ? I don't really see why you're using glob when you could maybe just use: if(!$page->webfont_archive->count() && !$page->text) return; // we're assuming webfont_archive is set to return a PageFiles and not a single PageFile foreach($page->webfont_archive->find("ext=svg") as $svgFont) { $svg = new EasySVG(); $svg->setFontSVG($svgFont->url); // try ->httpUrl or ->filename if not working /* ... */ } But again it might depend on your setup ?1 point
-
I forgot to attach a file from the old (no longer online) ProcessWire Wiki, just in case you do not have a copy of it. This is somewhat outdated, but you might still find useful info in it. See: "Module Creation - Wiki.html.zip" Module Creation - Wiki.html.zip1 point
-
First off, I won't stop developing ProcessWire unless I'm dead. But lets say that one of you showed up at my door and shot me, and then I'm gone for good. This is free software and you don't get any guarantees there, no matter what CMS it is or how big the community or adoption of it is. But what you do get is the source code and permission to use it and do with it what you need to. There is far more security in that than any proprietary or commercial system. We should all feel very lucky that this project has attracted such a capable development community around it (more than any project I've ever seen), and there are several guys here that are fully capable of taking over the project if I go down in a hang-glider crash. I'm always reluctant to list off people because there are so many people that contribute to the core and I don't want to forget anyone. Suffice to say, I may hold the keys to the master GitHub account, but this is a project of many developers, at least 5 of which are fully capable of taking over the project if I kick the bucket. I'm certain that some of these guys could do better than me with it. Please don't take that as an invitation to show up at my door with a weapon. But I would suggest this may be better odds than with the bigger projects you'd mentioned. Lets also point out here that ProcessWire is not WordPress–it does not need daily updating in order to keep running. Most sites I build with ProcessWire are running the version they are launched with. With ProcessWire, you do not need to upgrade your site every time a new version comes out. You can generally upload it and forget it, and it'll keep running till the site as long as the server itself is running. What other CMS can you say that for? (I can't think of any) Personally, I think adoption of something like Drupal, Typo3, Joomla, etc. is more of a risk, because you are dealing with a legacy platform – you are adopting technology from 10 years ago. You are also adopting something that is a target for hackers and spammers. WordPress is perhaps the biggest target, and something I've very apprehensive to setup for clients. Ultimately when a company chooses to adopt a legacy platform because "it's what the clients know" or [more likely] what they themselves know, it's a lazy decision. It's not looking out for the clients' best interests, and it's pursuing mediocrity. When you pursue mediocrity, you pay for it in the long run. There is no better testament to that than the legacy platforms that agency seems attached to. 1-3 years after installing [Drupal/Joomla/Typo3/WordPress/etc.] for the client, they are going to be looking for "something different" in terms of the CMS (we all know this) and they won't be coming back to the same agency. The agency that thinks it's playing it safe is really just hurting themselves when they give their clients something tired and mediocre that anyone can give them. Instead, give them ProcessWire, and they'll know you are different and better (a secret their competition does not have), and they'll be a lifetime client.1 point