Jump to content

BlindPenguin

Members
  • Posts

    12
  • Joined

  • Last visited

About BlindPenguin

  • Birthday January 2

Profile Information

  • Gender
    Male
  • Location
    Germany, Bavaria

Recent Profile Visitors

270 profile views

BlindPenguin's Achievements

Jr. Member

Jr. Member (3/6)

9

Reputation

  1. Hi there, I'm thinking about starting a sidebusiness with webdev. Specifically ProcessWire and maybe Wagtail for bigger things. Problem is, i'm not particularly great at webdesign. I was thinking of using finished designs or "multipurpose" templates instead. The latter ones would basically be like Lego. Changing colors and so on shouldn't be much of a problem for me. My main target customers would be small businesses. So i guess the expectations shouldn't be as high as bigger companies. How do you guys work? Do you make your own designs, or do you also use finished or half-finished products? Thanks in advance
  2. @bernhard Symfony has a component for that. https://symfony.com/doc/current/components/yaml.html I think it's the only one that is well supported and probably won't die anytime soon. Their components can usually be used alone too. In form of composer packages, that is.
  3. @bernhardNow it's working perfectly. The "|" error is now gone. In PHP 7.4 there is no error. In 8.1 i still have the PDO error. Probably that yaml stuff. I guess as long as i don't use yaml for the migrations, it'll be fine. Thanks for your patience and all the hard work. ?
  4. Ok, i now have an entirely new setup. It has the same problem. And i just thought about turning on debug. That might help. ? I avoid that option usually, because it showers me in a myriad of deprecation errors. First Error: SelectableOption: title may not contain the character '|' ------------------- Second Error: ProcessWire: ProcessModule: Too many keys: PDO::quote(): Passing null to parameter DEBUG MODE BACKTRACE ($config->debug == true): #0 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/spyc/Spyc.php(1124): Spyc->checkKeysInValue() #1 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/spyc/Spyc.php(609): Spyc->returnKeyValuePair() #2 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/spyc/Spyc.php(545): Spyc->_parseLine() #3 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/spyc/Spyc.php(494): Spyc->loadWithSource() #4 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/spyc/Spyc.php(165): Spyc->_load() #5 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/YAML.php(11): Spyc::YAMLLoad() #6 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/RockMigrations.module.php(3025): RockMigrations\YAML->load() #7 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/RockMigrations.module.php(1802): ProcessWire\RockMigrations->yaml() #8 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/RockMigrations.module.php(1979): ProcessWire\RockMigrations->migrateWatchfiles() #9 /home/ferdl/PhpstormProjects/process/test-project/site/modules/RockMigrations/RockMigrations.module.php(2739): ProcessWire\RockMigrations->run() #10 /home/ferdl/PhpstormProjects/process/test-project/wire/core/WireHooks.php(1059): ProcessWire\RockMigrations->triggerMigrations() #11 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks() #12 /home/ferdl/PhpstormProjects/process/test-project/wire/modules/Process/ProcessModule/ProcessModule.module(368): ProcessWire\Wire->__call() #13 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(414): ProcessWire\ProcessModule->___execute() #14 /home/ferdl/PhpstormProjects/process/test-project/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod() #15 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks() #16 /home/ferdl/PhpstormProjects/process/test-project/wire/core/ProcessController.php(337): ProcessWire\Wire->__call() #17 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(414): ProcessWire\ProcessController->___execute() #18 /home/ferdl/PhpstormProjects/process/test-project/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod() #19 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks() #20 /home/ferdl/PhpstormProjects/process/test-project/wire/core/admin.php(160): ProcessWire\Wire->__call() #21 /home/ferdl/PhpstormProjects/process/test-project/site/templates/admin.php(18): require('...') #22 /home/ferdl/PhpstormProjects/process/test-project/wire/core/TemplateFile.php(327): require('...') #23 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(414): ProcessWire\TemplateFile->___render() #24 /home/ferdl/PhpstormProjects/process/test-project/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod() #25 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks() #26 /home/ferdl/PhpstormProjects/process/test-project/wire/modules/PageRender.module(575): ProcessWire\Wire->__call() #27 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(417): ProcessWire\PageRender->___renderPage() #28 /home/ferdl/PhpstormProjects/process/test-project/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod() #29 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks() #30 /home/ferdl/PhpstormProjects/process/test-project/wire/core/WireHooks.php(1059): ProcessWire\Wire->__call() #31 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks() #32 /home/ferdl/PhpstormProjects/process/test-project/wire/modules/Process/ProcessPageView.module(184): ProcessWire\Wire->__call() #33 /home/ferdl/PhpstormProjects/process/test-project/wire/modules/Process/ProcessPageView.module(114): ProcessWire\ProcessPageView->renderPage() #34 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(417): ProcessWire\ProcessPageView->___execute() #35 /home/ferdl/PhpstormProjects/process/test-project/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod() #36 /home/ferdl/PhpstormProjects/process/test-project/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks() #37 /home/ferdl/PhpstormProjects/process/test-project/index.php(55): ProcessWire\Wire->__call() #38 {main} I may have to add that i'm on Manjaro Linux, which is using PHP 8.1.7 by default. Switching to PHP 7.4 appears to get rid of the PDO error. But the SelectableOptions error and the strange duplication behavior remains.
  5. For some reason i stopped getting notifications... Manually creating fields shows me this code: 'manual_select_field' => [ 'label' => 'Manual Select Field', 'flags' => 0, 'type' => 'FieldtypeOptions', 'label1024' => 'Manuelles Select Feld', 'inputfieldClass' => 'InputfieldSelect', 'collapsed' => 0, 'tags' => '', 'initValue' => '', 'showIf' => '', 'themeInputSize' => '', 'themeInputWidth' => '', 'themeOffset' => '', 'themeBorder' => '', 'themeColor' => '', 'columnWidth' => 100, 'required' => '', 'requiredIf' => '', 'defaultValue' => '', 'options' => [ 1 => 'VERYLOW|Very low', 2 => 'LOW|Low', ], 'optionLabels' => [ 'de' => [ 1 => 'VERYLOW|Sehr niedrig', 2 => 'LOW|Niedrig', ], ], ], When i use that in my migration code for another field (with the migrate command), the duplication effect also happens in the German field. When i only give the German labels, then i have the same effect as before. What's also interesting: When i remove the values "VERYLOW" and "LOW" from both fields, including the "|", then the duplication doesn't happen. That strange error message while refreshing is still there. I think i'll try a clean installation, just in case i messed something up. I'll look into it tomorrow.
  6. Sorry, just saw your message today. I tried it with a new field and also tried uninstalling and reinstalling the module beforehand. It does fill the German field, but it also duplicates the values in the original one. I have two languages configured: "default" and "de". $rm->createField('test_field', 'options', [ 'label' => 'Test Field', 'label1024' => 'Test Feld', 'type' => 'options', 'options' => [ 1 => 'VERYLOW|Very Low', 2 => 'LOW|Low', 3 => 'MIDDLE|Middle', 4 => 'HIGH|High', 5 => 'VERYHIGH|Very High', ], 'optionLabels' => [ 'de' => [ 'Sehr niedrig', 'Niedrig', 'Mittel', 'Hoch', 'Sehr hoch', ], ], ]); The result seems a bit different, though: When refreshing the modules, i get the following error: "title may not contain the character '|'".
  7. @bernhard Ok, so my ProcessWire knowledge isn't exactly up to the task to do a PR for your module. But i was able to use PDO statements to work around it. It might not be beautiful, but it works. I've seen several functions in the SelectableOptionsManager, like the "setOptionsStringLanguages" function. My guess is, that this one is used in the backend for saving the translations. I couldn't work out yet how to use it properly. But i think that would be the most promising function.
  8. @bernhard That's weird. I noticed in the database that it seems to create the columns "title1234" and "value1234" automatically. But doesn't RockMigrations overwrite that immediately after refreshing modules? I guess it's possible to check if the field already exists, then add the translations with some database magic. I've seen some promising functions in the ProcessWire folders. Maybe i can work something out. And yes, all that information helps greatly. Thanks! ?
  9. @bernhardI'm also trying it right now and so far i love it. I do have a few questions, though. What is the recommended function to migrate? I see mentions of "createField" and "migrate" at other places, so i'm a bit confused. And does "migrate" update field settings, when i change something like the "tags" of a field? The other thing: How does it work with translations? Can i use the default translation modules that come with ProcessWire? EDIT: Since I'm just playing around with options: How do i translate them? "options1234" doesn't seem to work.
  10. Alright, i think i've figured it out. The location of the layout file is wrong. According to the docs it's supposed to go into "templates/views/layouts", but according to the boilerplate it's actually in "templates/layouts". Putting it in there makes it work. Didn't expect that.
  11. Hi there, I'm currently testing Processwire in combination with Wireframe. Right now, i'm trying to get it to use the Layout file i've defined. But for some reason it doesn't work. Maybe i'm doing it wrong. I defined "wireframe" in all my templates and added the file "wireframe.php" with this content: $wireframe = $modules->get('Wireframe'); $wireframe->init(); // render the page echo $wireframe->render(); Layout (filename default.php inside the layouts folder): <!doctype html> <html lang="<?= $this->lang ?>"> <head> <!-- metadata --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="ProcessWire CMS/CMF"> <?php if ($page->meta_description): ?> <meta name="description" content="<?= $page->meta_description ?>"> <?php endif; ?> <?php if ($page->meta_keywords): ?> <meta name="keywords" content="<?= $page->meta_keywords ?>"> <?php endif; ?> <!-- page title --> <title><?= $page->title ?></title> <!-- stylesheets --> <link rel="stylesheet" href="<?= $config->urls->resources ?>styles/main.css"> </head> <body class="template-<?= $page->template ?>"> <main> <h2>TEST</h2> <div id="content"><?= $placeholders->default ?></div> </main> <script src="<?= $config->urls->resources ?>js/main.js"></script> </body> </html> Then here's the view for "home" in home folder inside views: <?php namespace ProcessWire; /** @var $placeholders */ ?> <div id="content"> <h1><?= $page->title ?></h1> </div> If i've understood it right, the view is supposed to go be printed inside the layout file. But the actual out put in the browser is like this: <div id="content"> <h1>Home</h1> </div> So something on the way is going wrong here. And i'm not sure what exactly. I thought it should print into that "$placeholder" stuff? I used Laravel and Django before, so i'm familiar with the theory behind it. Just need a push in the right direction. ?
×
×
  • Create New...