Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by joe_g

  1. Ha! Thank you. After working with PW for a decade i still didn't know fields had access rights!
  2. Hi there, I've got a site with pages built with the repeater matrix. In the repeater I've got an images field where the editor uploads images and can then place them in the body text. The placed images only appear if you're logged in as admin. I suppose that has to do with the repeater matrix pages aren't fully visible for guest users, or something in that line. But I don't know what to do about it exactly. One solution is to have an 'images' field on the page itself, and not inside the repeater matrix, but its a hassle because once you are editing a text field inside the repeater matrix and select the image icon to place an image you're not in the parent page, you have to go and find it, like so: What's the solution to allow placeable images inside a repeater matrix? Thanks! j
  3. omg. ...... took me a good hour to realize I had forgotten to actually install the lazy cron module *hand clap*
  4. Hi there, I can't get my LazyCron to fire <?php $useMain = false; $wire->addHook('LazyCron::everyMinute', null, function() { $log->message("1 min passed"); echo '1 min passed'; }); echo 'hooked - '; ?> Some output for good measure I tried making it into an anonymous function (see above), but same result as by using the example in the docs (with regular function). No lazycron*.cache file, No logs, No message - it just doesn't fire at all. Not sure how to proceed? tx!
  5. Hi there, I've got a site where the editors are creating tags using a 'Page Auto Complete' Field. Through this field they can create new tags with "Allow new pages to be created from field". The problem is that any page (tag) created this way ends up only be published in the default language. The site is bilingual, and when trying to access this newly created page (tag) in the non default language it gives a 404. Any tips how to get the page (tag) be published in all languages is greatly appreciated 🙂 thanks, J
  6. Hi there, I've got a peculiar problem in the backend I don't manage to solve on my own. After moving a page, the spinner won't stop spinning: Under Network, in the console I can see continuous requests: Not sure how to fix this one. I run over 10 other PW install on the same server, they all work fine. But this one is the only one with the latest version ProcessWire 3.0.200. So I assume it has to do with something recently changed. thanks!
  7. @Jan Romero Wow, interesting. Thanks, will try this!
  8. I have ~800 things (in this case published texts) that needs to be shown in random order. It's about 20-50 pages or results, depending how many I show per page. Preferably the randomization stays the same, so a refresh (or a page change) doesn't ruin the order.
  9. Hi there, I'm trying to achieve randomizing a large set of pages that needs pagination. It could happen every night or so. I know sort=random doesn't work with pagination so I thought, if I can randomize the position of the pages in the actual backend this could work. This might be a heavy operation, but I also wouldn't know how to do it so it's effective. There is the https://github.com/kixe/PageMove PageMove. plugin that could to this with the method sortChildren(). This plugin doesn't seem to be present in the store. But, in the forums there is mentions of this function being built in to v 3.0, but I can't find the docs for that. Would you know the best way to go about this? thanks! J
  10. @Robin S I can confirm that this works really well. it's a relief, honestly - I expected having to dive deep int sql for this. One thing that doesn't seem to work is to match things in quotations "Alice One" and "Alice Two" will both be considered related because of the same first name "Alice", regardless of quotes or not. But that's fine in my case.
  11. Thanks!, I edited my post above while you responded. In the mean time I've realized that my misunderstanding is that I can't replace parent regions, then the child regions will be destroyed. Like, I can't have this and update both foo and bar directly using replacement <div id="region1"> foo <div id="region2"> bar </div> </div> i would have to do <div id="region1"> <div id="region1inner"> foo </div> <div id="region2"> bar </div> </div> However, as you suggest, I can add to the parent like (using the code from my previous post) <div id="maincontent" pw-append> added this to main </div> <div id="testregion"> replaced </div> ..as long as i don't replace the whole parent. This makes sense, since I suppose this is some form of string replace behind the scenes awesome, and thanks again Ryan! J
  12. Thanks for getting back about this! Here is a test (using tailwind css). _main.php (global) <body> <div id="maincontent"> </div> </body> _testregion.php (appended to template 'test' under files tab) <div id="testregion" class="border border-red-600"> default value from _testregion.php </div> test.php (actual PW template) - note the nested divs, how testregion is inside maincontent. <div id='maincontent'> <div class="p-8"> <div id="testregion"> should be inside red border? </div> </div> </div> What I'm trying to do is to apply my own "markup pattern" called testregion to an arbitrary position, but it doesn't do what I expect. Instead of getting "Should be inside red border" inside the red boder, i get _testregion.php appended after the output of _main.php. The result looks like this: However, it does work if I specify the innermost region in test.php, like <div id="testregion"> should be inside red border? </div> That means i can't match arbitrary regions that are inside each other, it would always have to be the innermost region(s)? This means that the site structure (the markup hierarchy) has to be entirely defined inside _main and I can never specify some markup that is simultaneously a parent and child. Maybe this is a good thing, I'm not sure. But this is what got me before.
  13. Hi there, I just discovered markup regions while looking for some templating solution. I've got a couple of layouts that are shared across a bunch of regular PW templates, and I'm looking for a way to abstract this, so that i don't need to have the same code duplicated across multiple places. I would like to keep the HTML "direct", so rather <div class="<?=$somePhp?>"> than, say echo "<div class=\'{$somePhp\}"> I think that rules out all regular delayed output strategies. Markup regions seemed perfect on the first look, but there are some limitations, if I understand it right 1. There is only one global markup region file (ie. _main). I can't use an arbitrary template file for some specific situation (like _myArticleLayout, for example) 2. I cant inherit templates, or chain, or stack them, or similar. I can't apply first _main, and then another one _article, for example 3. Related to this, I can only do appendTemplateFile globally in config.php, but I was hoping I can do this in the top of each template, or maybe even for parts of templates Now, some questions. Is there a better way to do this? Another templating engine? Is there a way I can use the magnificent markup region replacement engine myself, separately? Or did I simply misunderstood how this works? As a sidenote it seems I can't get nested regions to work, perhaps because I'm not using this the intended way? many thanks
  14. Hello, I'm lost with my Matrix (profield) and how to look for data using selectors: I have a matrix ("grid"), it has a 'matrix repeater type' mp4 that contains the fields 'mp4' and 'ratio' (and others): Under admin / repaters in the backend, things look a bit cryptic: Now, how do I find the mp4s that doesn't have a ratio? I would imagine something like wire('pages')->find("template=repeater_grid,mp4!='',ratio=''"); ..but I can't get any meaningful results back. If I could only get all mp4's, that would already be a good start... many thanks J
  15. Thanks, I used your code and did this: if($input->get('setlang')) { $session->set("userLanguage", $user->language->id); } else { $langId = $session->get("userLanguage"); if($langId) { $newUrl = $page->localUrl($langId); if ($session->get("userLanguage") && $langId !== $user->language->id) { $session->redirect($newUrl); } } } ..but then I realized it doesn't work together with caching... Duh. I guess it's localstorage or nothing?
  16. Hi there, I've got a client who would like to store the selected language, if it's not the default language. The only way I can think of is to use localstorage from js, but that would mean loading the whole front page, then reloading it again in the right language - ew! Is there a better way that vibes with the built in language functionality? I'm hoping to avoid session cookies and such. Also, I'm not sure how the language redirect really works. I suppose it's done in htaccess somehow, but to capture it before it happens I wouldn't know where to 'inject' that functionality. maybe the best solution is to not bother?
  17. Thank you both! I feel I have a lot to discover now! Hopefully I won't make another vue app for a while ? J
  18. Hi there, I had a brief look at livewire and hotwire - and I love the concepts behind them. I really dislike having to choose between making a SPA or a server side site, the two paradigms are so different and hard to mix. If I understand live-/hotwire right it could mean a single paradigm for both client and server data manipulation, which I haven't experience since visual basic 6 :P To be able to model a regular PW site and then sprinkle it with app-like behaviours here and there would be absolutely incredible. I almost considering stepping over to Laravel for this reason, but it's a big step for me. Neither livewire or hotwire seems to exist without Rails or Laravel. So this seems to be a must. Anyone had experience with this, or something similar? Is there something similar that would work with PW?
  19. Oh wow, if this works the way i think it does this could really be it. I can combine **= with limit=20, for example and only get the most related. Thanks! ps. I've been meaning to learn more about selectors, they've really expanded last couple of years.
  20. Popularity has it's use, and I'm doing that as well for a different visualization. But in this project I'm mainly looking for similarity. "obscure" similarity is more important than "popular" similarity. Lets say a project have 1000 project that share some popular tags, but there is only 2 that share the same (obscure) tag - on top of the popular ones - those 2 are the most important to show. If I prioritize popularity those 2 projects will be buried somewhere. This probably needs to be some custom sql, just not sure how to write it.
  21. Thanks both. RockFinder looks great, didn't know about that module before. But I wonder if it can do what I need. I suppose bot findRaw and rockFinder would need to first load all pages that has 1 or more keywords in common - in my case that can be a lot of pages since some keywords are very generic. Lets say I have 20k projects and half of them might have the keyword "collaboration". What I need is the intersection of the most common, and only the first 'X first' hits. I suppose the only way that can be done is with sql, since the data is purely relative (unlike how rockFinder works, there is no dataset to "start" with - i can't start with 10k pages). Now, how to solve it haha - that's going to be a bit challenging.
  22. Hi there, Is there I can sort by "number of things in common". For example, I have "projects" with "tags". I'd like to show the 20 projects that is "most related". So first show the projects with 3 tags in common, then 2 tags in common, etc. Perhaps something like: $pages>find("template=project,limit=20,tags={$tags},sort=in-common-[tags]") Is there a way I could do this in a scalable manner? (As in, avoid getting all results and loop through them)? Custom SQL? thanks!
  23. Thank you! Indeed it worked, after adding the namespace. It's embarrassing but I still don't full understand namespaces. Or rather, I kinda do but I'm not sure when I need to declare "namespace ProcessWire;" in a PW template...
  24. Hi all, I'm trying to generate .ics / iCalendar files from PW, but PW strips custom headers. Is there a way I can do this? Many thanks. (This is a repost, sorry - trying a better title for better traction)
  • Create New...