Jump to content

Robin S

Members
  • Posts

    5,039
  • Joined

  • Days Won

    340

Everything posted by Robin S

  1. Interesting, but quite a long way to go... Supports PHP (or anything but Python): No Supports Windows or Linux: No Supports JetBrains IDEs: No
  2. The Pager includes prev and next links with identifying classes in the markup when there is a prev and next page to the results. Use CSS to position those links where you want them to be. .MarkupPagerNavPrevious { } .MarkupPagerNavNext { }
  3. It is normal to be logged out after the browser session is closed. You can use the LoginPersist module if you want to stay logged in across sessions.
  4. I think renderReady() is the right place to load any JS dependencies.
  5. Not sure I understand, but you can just enter the options into the field config exactly like that and then there is no need for a hook.
  6. In a single-language site the description is just a plain string, so a user would want to modify the hook accordingly. I like this new feature allowing the select option label to be determined in a hook, but I wonder if choosing a single column in the field config makes the hookable method too limited. For example, in the case of using the description column as a label for an images select, having the label fall back to the sort integer if an image has no description is worse than having the image filename. Is there a way to conditionally grab a different column value from the row inside the label hook? So you could for example get the "data" (filename) column if the description column is empty. Not sure if it's practical but I think it would be cool if there was a hookable method that receives an argument of all the row columns as an array lets you return both the option value and label.
  7. @kixe, when I try this (or use a hook to dynamically select a pages_id) there is always an option preselected in the inputfield. My SelectExternalOption field is not set to 'required'. Is it possible to have the first option in the inputfield blank (no selection)?
  8. If Language Support is installed but no additional languages created then there is a PHP error: PHP Warning: Division by zero in ...\FieldtypeSelectExtOption.module:504 Probably not something that happens very often.
  9. Not only "the processwire way", but also the way that is demonstrated in the documentation: foreach($page->test_matrix as $item) { if($item->type == 'blockquote') { echo " <blockquote> <p>$item->quote</p> <cite>$item->quote_cite</cite> </blockquote> "; } else if($item->type == 'bodycopy') { echo " <h2>$item->title</h2> $item->body "; } else if($item->type == 'gallery') { // and so on... } }
  10. Yes! I had forgotten about your thread there. That is still a work in progress and not released yet, right, or did I miss it? I think AOS and Tracy are the main modules where I find myself wanting a quick way to sync settings, but would definitely be cool to have that available for any module.
  11. Okay, thanks for the info. It would be neat if there was a feature allowing to export/import (copy/paste) the settings JSON without needing to uninstall/reinstall. As new AOS features are rolled out quite regularly (which is awesome) I often want to synchronise my new settings across many sites.
  12. I have tracked the issue down to the "Tooltips" submodule - when this submodule is disabled the Configure anchor links scroll to the wrong place (in the default Admin theme anyway). BTW, have been meaning to ask this for a while: is it possible to use the "Restore settings on next install" feature to copy AOS settings from one site to another? Or some other way to quickly replicate AOS settings on another site?
  13. This syntax works fine for me with plain Repeater fields, so it should work for Repeater Matrix fields too: $results = $pages->find("my_repeater.my_nested_repeater.my_textarea%=foo"); So maybe typos are slipping in somewhere else... Testing this did expose a bug where pages are matched when the repeater fields are empty - will file this at GitHub shortly. Done: https://github.com/processwire/processwire-issues/issues/205 There is another way you could do this, but I think the selector with subfields is more elegant... // returns the root container page for any repeater item no matter how deeply nested function getRootContainer($page) { if($page instanceof RepeaterPage) { return getRootContainer($page->getForPage()); } else { return $page; } } $results = new PageArray(); $repeater_pages = $pages->find("my_textarea%=foo, has_parent=2, include=all"); foreach($repeater_pages as $repeater_page) { $results->add(getRootContainer($repeater_page)); }
  14. Hi @tpr, would it be possible to get the field edit links that show on hovering a field label to work on fields that are inside repeater items? Ooh, and another idea re: field edit links. What if Ctrl-click brought up the settings for the field in the template context? (i.e. the template overrides) Edit: one more thing... The "Configure" anchor links in the Submodules panel do not scroll me to the right options panel, but scroll down quite a bit further. Tested in Firefox and Chrome on Windows.
  15. I think @ryan is unlikely to switch from region attributes in tags to a different system where regions are defined using HTML comments, considering that the Markup Regions feature is already published and currently being used in its existing form. But I do agree with your request to support a region tag that is stripped out of the final output. As you noted, that would be particularly useful for defining multiple regions inside the <head> element. There is a GitHub feature request that covers some of this stuff: https://github.com/processwire/processwire-requests/issues/78
  16. I think you need to set output formatting false before you start setting values to fields: $payment = $pages->get('template=payment,id='.$payment_id); $payment->of(false); if($payment->id) $payment->payment_status = P_PAID; $payment->save();
  17. Yes, the first blog post on the feature says that for now it must be explicitly enabled in $config: $config->useMarkupRegions = true; You have to be deliberately using the feature too in order to be affected by the stripped comments. So contrary to what I said above it isn't so much that useMarkupRegions is enabled, it's when there are comments in the HTML that occur before the doctype or <html> tag. ---- _main.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title><?= $page->title ?></title> </head> <body> <?= $my_var ?> <!-- this comment will be rendered --> <div id="main"> <p>Default main content.</p> </div> </body> </html> home.php <?php $my_var = " <!-- this comment will be rendered --> <p>hello</p> "; ?> <!-- this comment will not be rendered --> <div id="main"> <!-- and this comment will also not be rendered --> <p>Main content from home template.</p> </div>
  18. I have ProCache disabled from the main "ProCache enabled?" checkbox, which turns all ProCache features off including minification I believe. I uninstalled ProCache to be sure and did a bit more testing. Seems to be an unannounced side-effect of the Markup Regions feature. When this is enabled in config.php all HTML comments both inside and outside a markup region in a template file are stripped out of the compiled output (edit: clarified below). I don't mind that as it's useful to be able to put notes and separators into the markup that are better kept out of the front-end source. I was just a bit surprised as this wasn't mentioned in the blog posts.
  19. You are spot on - I have the ProcessWire namespace declared everywhere except in my included file. Thanks!
  20. I just noticed that HTML comments in a template file are not rendered in the front-end source. Which is totally fine with me, very useful in fact, but I'm wondering what part of PW is responsible and when this started happening. I know that ProCache strips HTML comments, but I don't think that is the cause in this case because I currently have it disabled and comments are still not rendered. Was it introduced by the file compiler starting in PW3? Or maybe part of the new Markup Regions feature (which I have enabled) ? Or has this always been the case and I just never noticed? To be clear: HTML comments in _main.php are rendered, just not those in a template file. Wrong forum section sorry. Meant to post this in General Support.
  21. There is probably an obvious answer to this but I am suffering a brain-fade: In my auto-prepended "_init.php" I have a function defined... function myFunction() { echo "hello!"; } I can use that function in my auto-appended "_main.php" or in a template file (e.g. "home.php") no problem. But why is it undefined if I call it in a file that is included in _main.php or home.php? include "./my_include.php"; my_include.php // results in "Call to undefined function myFunction()" myFunction(); I was expecting _init.php to have been prepended by the time myFunction() is called inside my_include.php - or does my_include.php get included before _init.php? I guess I'm not clear on the order of operations here. Do I have to include _init.php inside my_include.php, or is there some other simple way to make myFunction() available globally?
  22. Yes, the full rule is... #ProcessListerResults select, #ProcessListerResults textarea, #ProcessListerResults input[type="url"], #ProcessListerResults input[type="email"], #ProcessListerResults input[type="text"] { width: 100%; } ...in ProcessPageListerPro.css So you could override that specific rule or use a more generic rule like in my previous post to try and force the filterbox input to always be width:auto - whichever you think best. Thanks.
  23. @tpr, I noticed that the filter box icon is out of alignment on Lister Pro pages. Not sure if you have Lister Pro available to test on but the culprit is a CSS rule that sets text inputs to 100% width inside #ProcessListerResults. Maybe force the width back to auto for the filterbox? html.aos div.filterbox input[type="text"] { width:auto !important; }
  24. In case you're not using it already... Tracy Debugger is a must-have for debugging.
  25. Welcome to the forums, @danielsl! You could do this: $p = $pages->get('/advert_page/'); $repeater_names = $p->fields->find('type=FieldtypeRepeater')->explode('name'); foreach($repeater_names as $repeater_name) { foreach($p->$repeater_name as $item) { // output your repeater item } } If you have repetitive markup that is used in several places also remember that you can put it an in an include to avoid repeating yourself.
×
×
  • Create New...