Jump to content

kaz

Members
  • Posts

    253
  • Joined

  • Last visited

Everything posted by kaz

  1. @TomPich Thanks, that was helpful, error found. I had a } error in schema.org in my prepand file. No idea why I didn't see that.
  2. Google sends me an e-mail with a reference to an error: Incorrect structure: “}” or name of the object member is missing I searched through my files manually, but can't find any unopened tags. Debug logs shows no error. The page has a problem with a logo that is not displayed when the page is called up. As soon as I click on a link, it is displayed. The code of the embedded logo is correct, I am sure, because it is used frequently. Is there a way to locate such an error localhost?
  3. @da² I removed the entries in the field. The error message remains.
  4. @da² Yes, I edit pages in the admin area. In the template I have a textarea field / CKEditor. I don't have hooks for the editor. I have custom styles, saved in the CKEditor field > extraAllowedContent. The styles are displayed and works fine. I think that's not the problem. /site/templates/assets/ckeditor/ckeditor.css ckeditor:/site/templates/assets/ckeditor/ckeditor.js With a change of the 'public function set($key, $value) …' code I get the same error message, it makes no difference. I cleared the cache, what else can I do? What more? config: I added own styles to the editor which change the appearance of the RepeaterMatrix links. RepeaterMatrix links doesn't look very nice, so I set them as buttons. No big deal, just CSS, no JS or PHP. $config->styles->add($config->urls->templates . 'assets/css/admin.css'); I activated and deactivated the ACF settings ... the error message remains. When I delete the field and create a new one, will I probably lose all entries from the database?
  5. PHP 8.3 ProcessWire 3.0.229 I get this error message in the CK Editor when I select a page for editing: Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/username/Sites/project.com/wire/modules/Inputfield/InputfieldCKEditor/InputfieldCKEditor.module on line 205 How do I get rid of this message?
  6. PW 3.0.229 ProcessExportProfile 5.0.1 I receive an error message after completing the export (as ZIP): Warning: Undefined array key "success" in /Users/username/Sites/sitename/site/modules/ProcessExportProfile/ProcessExportProfile.module on line 800 I think it's just the confirmation message, I would just like to point out.
  7. @wbmnfktr Of course, I solved it this way, it's a bit more work. I added URL fields to the global settings. These fields are output as simple ul list, that's it.
  8. I write what the client wants. Why discuss a client's wishes. If it can't be implemented technically with PW, I set these menu links manually in an template. The question is answered, thanks.
  9. Two doctors would like to have two external links on one page, which are to an external provider for appointments. I have built a redirect template and will display these links in the sidebar.
  10. @Jan Romero I have already tried this out. It does not work. It's not a redirect, the link is displayed as a text link in the body. Not what my client needs.
  11. I have a URL field that should be redirected externally via target=_blank if ($page->external_url) { $session->redirect($page->external_url); } Is there any solution to add target?
  12. @ryan I usually use the project name as the password for the database during the local installation. $config->dbHost = 'localhost'; $config->dbName = 'project'; $config->dbUser = 'project'; $config->dbPass = 'project'; $config->dbPort = '3306'; $config->dbEngine = 'InnoDB'; I may have done it differently for this project; I have the password written down in my notes, but it doesn't work. Because the database is set up in MAMP, I contacted appsolute GmbH for help. I hope that there is a way to renew the password. Thanks for the help!
  13. @BitPoet I have the superuser password, I think I probably remember the database password wrong. I will contact MAMP, there will surely be a way to reset the database password?
  14. @ryan I have entered the $config dates. salt entries I've taken over from the live version, the online version works fine. The error message remains. I guess I will try to renew the database password in MAMP, I hope that's possible? The other data should fit if salt is the same as the online version.
  15. I accidentally overwrote the local config.php with the online version via Transmit. Clearly, the data does not fit locally. I have already updated the correct user, database name and password in these local config, but it does not work. Access is denied: Dangit… Error: Exception: SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES) (in wire/core/WireDatabasePDO.php line 505) I don't know what to do now? What, for example, is userAuthSalt and tableSalt? Of course I don't have these data. Is it possible to renew the access data in the local database with PhpMyAdmin? If there's no way to renew the config, how do I keep the project alive? I have the data, the database, only the config is gone.
  16. @bernhard Thanks that works great. And also thanks for the training. I am quietly learning from a book by Christian Wenz and Tobias Hauser, but some parts only become clear when I use :)
  17. I have an address in the global settings which is displayed on all pages in the sidebar. <?php if ($global->businesshours): ?> <?php include('businesshours.php'); ?> <?php endif; ?> The client asked me to hide the address on only one page, id 1127. I can have an element displayed on a single site via a query, if ($page->id == 1042 ), but can I also exclude a page in an include?
  18. @TomPich If it can't be changed, it should be fine.
  19. I need to implement double quotation marks with a line break in an if query. my current code: <script type='application/ld+json'> { '@context': 'https://schema.org', 'sameAs' : [ <?php if ($global->facebook): ?><?= $global->facebook; ?>,<?php endif; ?> <?php if ($global->instagram): ?><?= $global->instagram; ?>,<?php endif; ?> <?php if ($global->linkedin): ?><?= $global->linkedin; ?>,<?php endif; ?> and so on ] } </script> and this is how it should look, if there is an entry: <script type="application/ld+json"> { "sameAs" : [ "https://www.facebook.com/company", "https://www.instagram.com/company", "https://www.linkedin.com/company", and so on ] } </script> <?php if ($global->facebook): ?>"<?= $global->facebook; ?>",\n<?php endif; ?> <?php if ($global->google): ?>"<?= $global->google; ?>",<br /><?php endif; ?> The double quotes work because I used single quotes for the the rest. The line break (\n or br) is not generated in source code. The code is output as text, maybe because it hangs in the echo? The source code looks as follows: "https://www.facebook.com/company",<br /> "https://www.instagram.com/company",\n https://www. How do I set line breaks correctly, in this combination?
  20. @cstevensjr I have the same question. I can't find it under General Support or Form Builder Support. Where the post was moved to?
  21. kaz

    if query

    @zoeck interesting, I didn't know that in an array the search is different
  22. kaz

    if query

    Funny, how an if statement behaves. I wanna check whether a field has content. So I asked about the field: if ($article->gallery_images) If yes, I only want to output only the first image as a preview in an summary page, that's why I only retrieve these first image: if ($article->gallery_images) { echo " <div class='' uk-grid> <div class='uk-width-1-5@m uk-width-1-1@s'> <img src='{$article->gallery_images->first->url}' alt='{$article->gallery_images->first->description}'> </div> <div class='uk-width-4-5@m uk-width-1-1@s'> $content </div> </div>"; } else { <div class='uk-width-1-1'> $content </div>"; } The query does not work, even if no data is uploaded to the gallery_images field, is else not displayed. Now the funny part: When I add ->first to the if query, else is displayed, the query will work: if ($article->gallery_images->first) { echo " <div class='' uk-grid> <div class='uk-width-1-5@m uk-width-1-1@s'> <img src='{$article->gallery_images->first->url}' alt='{$article->gallery_images->first->description}'> </div> <div class='uk-width-4-5@m uk-width-1-1@s'> $content </div> </div>"; } else { <div class='uk-width-1-1'> $content </div>"; } I have hardly any PHP experience, so perhaps I don't understand why this is the case, but: it surprised me in terms of logic.
  23. @ngrmm works great, thanks for the hint with a variable!
  24. A client would like to have a checkbox or similar for an image field in order to apply a style. echo " <img class='{$page->check}' src='{$page->image->url}'>"; I have thought about creating a checkbox, but it's not so easy because the class must given out in an echo. How to pass a class, a style in an echo?
  25. @gmclelland I have it in the /views folder, not /fields, because in PageTable I have to select a template. PageTable does not allow to select a folder, so my templates are in the /views folder ? I would prefer to have the widget templates in an own folder, but it's not possible with PageTable. This is the code of my bodysection file (PageTable Field): <?php namespace ProcessWire; // Loop through each element in the PageTable field foreach($bodysection as $section) { // Get the template of the page in the PageTable field $template = $section->template->name; // Depending on template, render the content switch($template) { case 'section-content': // "section-content" template rendered here echo $section->render(); break; case 'section-gallery': // "section-gallery" template rendered here echo $section->render(); break; case 'section-…': // and so on break; } } Only the Page IDs are received in frontend, at least the IDs are correct, yeah: 1122|1124
×
×
  • Create New...