Jump to content

DarsVaeda

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by DarsVaeda

  1. I've just moved it down to the function without anything popping up in error log. Load is down by 90% at least, site speed has improved dramatically as well. I'd suggest you really look into this asap ?
  2. @Mike Rockett // Get the correct table name for ProcessRedirects $redirectsTableNameQuery = $this->database->prepare('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = :db_name AND TABLE_NAME LIKE :table_name'); $redirectsTableNameQuery->execute(array( 'db_name' => $this->config->dbName, 'table_name' => $this->redirectsTableName, )); if ($redirectsTableNameQuery->rowCount() > 0) { $redirectsTableNameResult = $redirectsTableNameQuery->fetch(PDO::FETCH_OBJ)->TABLE_NAME; if ($this->redirectsTableName == $redirectsTableNameResult || strtolower($this->redirectsTableName) == $redirectsTableNameResult) { $this->redirectsTableName = $redirectsTableNameResult; } } Mike, why are you doing this? And why are you doing this in the constructor? As far as I can see it is just used in the "___executeImport" function. Which I suspect is called only once when doing whatever kind of import that is. I don't even have that table in my database. Yet as the code is placed in the constructor every time a page is called there is this request to information_schema. This leads to a high database load due to a lot of permission requests. I suspect you can move that to the import function?
  3. yes fixing file rights fixed the 404
  4. I actually just found the error this morning. Whilst uploading something went wrong with file rights of the template. When going to the template it actually states so (that it can't access the template and no pages with that template will be displayed). But on frontend it's just a 404 and no log entry. Would be nice to get that error as log entry so debugging is a bit easier.
  5. I think I asked this already in another thread. But couldn't this be solved by allowing fields to be reused in a template? So instead of having to generate multiple fields (like the text areas in my example) you generate one field but are able to use that one field several times in your template but with different values. You would need to put one more level into the table to know which field is which value. And maybe allow to set an identifier for each field so you can specifically call it in the template rather than having to do something like "$page->text_area[x]". Isn't this how repeaters works anyway?
  6. I've just updated my PW to 3.0.98 and installed ProCache. Unfortunately now I'm getting a 404 on all blog pages. Also I see ProCache doesn't even list the blog templates. Any advice?
  7. For me repeaters is no problem. And it is no problem for front-end editing. But some users don't use front-end editing and for some cases f-e-d isn't even possible. That's why I can't use them. Some users can't grasp the concept and fail to link where the content goes. Also you can't disable reordering afaik and that also puzzles users. Using repeaters would help in most cases actually bringing down the field count a lot.
  8. I don't see any performance issues so far. It's merely a "keeping the overview" thing right now. I don't think there would be any impact in having like 2000 tables in the database. Though it kinda sucks to have one table for one field in one template in one page that has just one row.
  9. Yes I know about template context of fields. That's why I have something like: text_1, text_2, text_...n in my field list. @AndZyk Unfortunately they change a lot as they are tweaked constantly. But if I would place it into the template, I as a developer, would have to change, test and deploy them. I just want the content person to do this without having me involved in it. I'll try to see if I can produce an example to make it more clear, but maybe I'm just on the wrong track ? ---- example: I have a page that has several content areas. So first of all I made fieldsets to group them. (Here I could optimize a bit by making general fieldsets instead of landingpage specific ones but I'd still need several of them) Each set contains a number of textareas that have specific, non-generic content. That's why they are grouped. Code looks something like this. <section class="content background_dark"> <div class="container"> <div class="row"> <edit textarea_number_1><?= $page->textarea_number_1 ?></edit> </div> <div class="row"> <edit textarea_number_2><?= $page->textarea_number_2 ?></edit> </div> <?php if (!empty($page->textarea_number_3)) :?> <div class="row"> <edit textarea_number_3><?= $page->textarea_number_3 ?></edit> </div> <?php endif; ?> </div> </section>
  10. Ah that was what I was hoping for. Thanks!
  11. Yeah I've seen form builder. Though this was just an example I had recently. It is not restricted to forms though.
  12. I still try to grasp the "field" concept of processwire and yet did not manage to do so. Maybe someone can help me to understand the concept? I have 14 templates currently. Most of these have fields that are very specific to a template so I wasn't able to reuse fields much. It's not like every template has: an input, a link, a list and an image. Thus I already end up with ~150 fields aka 150 tables. Imagine opening the fields menu... Let's say I need to make a new page that has an html form. The form has 15 input fields. So I need 15 x titles, 15 x placeholder texts at least, maybe error & success messages for JS validation and so on. This means I need at least 30 processwire text fields just for this one template / page. I could use something like a repeater but I don't find this very usability friendly for something like forms for instance. How would you go about this? Do I miss something that would make my life more easy here or is processwire just not made for that use case?
  13. Does processwire have a feature or is there a module that supports browser cache invalidation upon new deploys? Like appending a hashes to source urls or alike. I'm not really up-to-date what is the best possibility right now.
  14. It's strange. I guess this has nothing to do with jumplinks. https://mydomain.com/de/existing-page/non-existing -> 404 -> I get the jumplink debug page https://mydomain.com/de/non-existing -> I just get the root page @edit: aahhh I found it! URL Segements was turned on but not handled. So everything not existing was just redirected to frontpage.
  15. I don't seem to get it to redirect at all. Or maybe I don't get it right? Is this module compatible with processwire 3.0 with multiple languages enabled? My source (old url) is: My destination is a selected page that exists. If I call https://mydomain.com/de/foobar I just get a 404 instead of the page I'm looking to redirect to.
  16. I'm trying to send a simple form like this: <form action="<?= $page->url ?>" method="post"> <div class="intro_text"><edit html_textarea><?= $page->html_textarea ?></edit></div> <?php var_dump($_POST); if (isset($_POST['send'])) { include __DIR__.'/scripts/contact_mail.php'; } ?> <!-- some fields --> </form> This works as long as I'm logged in aka the page is not cached. As soon as I log out the form data is not send seemingly. I can see the page is reloading but the var_dump is just empty. How am I supposed to do this in processwire?
  17. That's how I did it at the end. $page->page_reference_field->someTextArea; So the "page_reference_field" contains a reference to the page that contains the block aka "someTextArea". It was fairly simple at the end. Thanks people!
  18. Yes the content should change on all pages when I change the content of the reusable block.
  19. Hi, I have created a template and will create several pages with it. One block on these pages is always the same text that I need to reuse. But it should be editable. What is the appropriate way to achieve this? I thought I might create a separate template and create a page with it. Then include that page into the other pages via a field. But I could not find a field that is working like this. Any help is appreciated!
  20. Is that documentation up to date? It doesn't work for me with option C. I get a popup which is not usable. Would need to dig into what is wrong with the html/css. But option B works for me without any problem (despite the need to set the permission on the system template as you suggested).
  21. This is the actual problem. It doesn't work with this implementation. If I use this: foreach($page->repeater_field as $item) { >? <li><?= $item->edit('list_item') ?></li> <?php } Then frontend editing works. Thanks @design-a-point!
  22. So I couldn't figure it out in a reasonable time, so I started fresh from a backup before switching to multi-languages and switched again. This time it works. So I guess something went wrong whilst installing the appropriate modules.
  23. The problem is that although the data is available in the backend, for some reason the data field of the page does not have the fields (+data) when displaying the page. Haven't found the reason though yet. Maybe some connection got lost in the db while switching from single to multilanguage mode? But well then the data wouldn't be available with "<?= $pages->get(1)->text ?>" either, wouldn't it?
  24. I enabled language support and now I get "Trying to get property of non-object" for lines like: <p><?= $page->text ?></p> The content is still available in the backend. On another page I get text from the frontpage with: <?php $somepage = $pages->get(1); ?> ... <p><?= $somepage->text ?></p> This outputs the text although on the frontpage it doesn't. I also do this on the header. On the frontpage I added some fields that are thus "shared" among all pages the content fails with the error for `<?= $page->text ?>` but not for `<?= $pages->get(1)->text ?>`. On a third page everything works as expected All three pages have different templates. Additionally if the field is wrapped with frontend editing like so: <p><edit text><?= $page->text ?></edit></p> The page source will end up like this: <p></edit></p> Before having to dig deep into this: Any idea what it could be? I var_dumped $page and that gives an object.
×
×
  • Create New...