Jump to content

Yipper

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Yipper's Achievements

Newbie

Newbie (2/6)

1

Reputation

  1. yes, after adding the "fields-" in the logos.php the message is back, but the problem is gone. so this was the problem in my test block (where I have no idea where I got that from)
  2. u mean here, right? //site/modules/RockFields/blocks/Logos/Logos.php (is this used or only copyied from there to site/templates/RockPageBuilder/blocks/Logos/Logos.php 'templates' => [ $this->getTplName() => [ 'fields' => [ //removed "-" self::field_logos, ], ], ], removed the - on both logos.php and tried commenting out the whole migrate section there. strange this is, the message from above disappears, but the field is still set back to normal text field. Edit 1: searching for 'fields-' => showed that this is also included in the /stubs/.Block.php (which I thought I had from here https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/stubs/#example-custom-php-stub , but there is no "fields-" there?! public function migrate() { $rm = $this->rockmigrations(); $rm->migrate([ 'fields-' => [ // Optional: Hinzufügen von Feldern, z. B. für Farben oder Inhalte "{$this->prefix}title" => ['type' => 'text', 'label' => 'Titel'], "{$this->prefix}content" => ['type' => 'textarea', 'label' => 'Inhalt'], ], 'templates' => [ $this->getTplName() => [ 'fields' => [ "{$this->prefix}title", "{$this->prefix}content", ], ], ], ]); } and therefore was added with a test block. removing the "-" alone doesn't solve it either. but commenting out the migrate() function in that test block and the logos block solves it (for now)
  3. I started setting up a website and then in the process installed RockPageBuilder (and installed all the example blocks). Before that I have set the system "title" field to "TextLanguage". Now I wondered why my Headlines lost their multilanguage settings and saw that log: Fields: Deleted field "title" data in 0 row(s) from 0 page(s) using template "rockpagebuilderblock-logos". [page-by-page] +2 I'm not sure how that template does that and where?
  4. but wouldn't the more dynamic solution from the accordion template be more versatile? That way you wouldn't even have to touch the demo block phps to have it when u activated pw language.
  5. Just getting into PageBuilder (and still figuring out PW in general). Where I was stuck currently is how the get the blocks working with multilingual fields. For example I simply wanted to have the /RockPageBuilder/blocks/Text example block to show the TinyMCE Inline field as Multilanguage Textarea. // from RockPageBuilder/blocks/Text/Text.php.. public function migrate() { $rm = $this->rockmigrations(); $rm->migrate([ 'fields' => [ self::field_text => [ 'type' => 'textarea', 'inputfieldClass' => 'InputfieldTinyMCE', 'contentType' => FieldtypeTextarea::contentTypeHTML, 'label' => 'Text', 'rows' => 5, 'icon' => 'align-left', 'inlineMode' => true, // 'rpb-nolabel' => true, // hide label in backend 'settingsFile' => '/site/modules/RockMigrations/TinyMCE/text.json', 'textformatters' => [ 'TextformatterRockFrontend', ], ], ], 'templates' => [ $this->getTplName() => [ 'fields' => [ RockPageBuilder::field_eyebrow, 'title' => [ 'label' => 'Headline', 'icon' => 'header', ], self::field_text, ], ], ], ]); } in the Accordion example block is the easy solution: 'type' => $this->wire->languages ? 'textareaLanguage' : 'textarea', Maybe this should be in every example block and in the vs code snippets, cause that would've saved me some time.
  6. Hi everyone, I just started using ProcessWire this weekend and try to get an overview over everything. I'm a bit confused about output strategies and markup regions, because I saw a lot of different approaches and couldn't really tell which the current recommended one is. Somehow I ended up like this: _main.php <body class=""> <!-- Header --> <?php include "_header.php"; ?> <!-- Navigation --> <?php include "_navigation.php"; ?> <!-- Main --> <main class=""> <?= $content ?> </main> <!-- Footer --> <?php include "_footer.php"; ?> </body> _header.php - ..and on the other layout _*.php files, just using HTML inline php like this: <header class=""> <a href="<?= $home->url; ?>"> </a> </header 1-home.php for the home page template 2-about.php for an about page template - numbered for better overview - using $content .="" for markup regions <?php namespace ProcessWire; $content .= "<h1 class=''>{$page->title}</h1>"; $content .= "<div class=''>{$page->introduction}</div>"; 1. Can you please tell me if this is a good way (in late 2024) to structure templates? 2. A problem that I have with the $content .="" approach is that code highlighting and automatic code formatting doesn't really work in VS Code for me then (could be a setup problem). Thanks in advance for tips and best practices
×
×
  • Create New...