Jump to content

elabx

Members
  • Posts

    1,242
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by elabx

  1. What version of PW are you using? Can you try doing Modules > Refresh? Would seem like the LogEntriesArray class was not compiled into the processwire namespace.
  2. Wow! In general I think it's a huge benefit for the community to have a more opinionated way of doing frontend, so congrats on this is amazing module! I have no further comments until I try it fully but from what I see in the video it looks fantastic.
  3. Perfectly understandable! I have learned the bad way (writing docs that no one reads lol) that some people just prefer videos! So I think it's a really good resources despite the effort it requires! They give so much information that might be taken for granted in a text documents. So rather than one or the other I think both tackle different "moments" throughout a person's learning process and also preferences. I prefer without music, but that's just a preference I guess?? It is a REALLY great video!! I skipped a few parts, but watched around 50% of it, will watch it fully later. Not sure if you have previous experience recording/editing etc, but nonetheless this video is RockSolid (...?)! Also the audio is really good! Not an expert myself, but no noise or anything distracting on this end. I guess each topic on video production is a rabbit hole!
  4. This doc page has a very good example on how to setup a hook when the page is saved: https://processwire.com/api/ref/pages/saved/#pwapi-hooking, so something like this placed on site/ready.php should work: $wire->addHookAfter('Pages::saved', function(HookEvent $event) { $page = $event->arguments(0); // parent-page-template is the name of the template that is parent of the pages you want to edit if($page->template != "parent-page-template") return; $page->children->each(function($child) use ($page){ $child->another_field = $page->another_field; $child->save('another_field'); /* another option I like when setting multiple fields $child->setAndsave([ 'title' => $page->title, 'another_field' => $page->another_field ]); */ }); });
  5. There's also: https://processwire.com/api/ref/wire-array/get-values/
  6. Looks like access control issue ? Can you try: $pages->get("name=reports")->children("check_access=0,report_meta_details.report_type.title=Global")->each("report_meta_details.report_type.title"); I wonder, if you try this one, does it behave the same way? $pages->find("parent.name=reports, report_meta_details.report_type.title=Global")->each("report_meta_details.report_type.title");
  7. Yeah mate! I was there in your exact same position, way less inexperienced when I arrived here barely knowing programming, web development, etc.. and here I am, breaking less things by the day thanks to everyone around here. ? Let me know how it goes! By the way, what development environment are you using??
  8. You can access it like: $this->database->getIndexes('my_table') Or wire('database')->getIndexes('my_table'); EDIT: Your code seems correct ? Can you paste the error thrown?
  9. Hi @Jacques! Welcome to the forums! I'd say the easiest would be to install it with composer if you are able to install composer and I'd argue that it's worth the investment in time to learn a bit of composer! At least just to run a composer require command, which is all you need right now! Have you seen this blog post?? https://processwire.com/blog/posts/composer-google-calendars-and-processwire/#installing-the-module-with-composer You don't need to install composer on the server, composer will download dependencies in a folder called /vendor in the installation's root folder and you can upload this folder just fine to the server. I would be really hard to break the site by just doing "composer require square/square", but in any case it does happen after that command, just delete the vendor folder. Are you familiar with CLI tools?? Maybe it's the first step! To learn how to execute a CLI program?? Are you on mac or windows?? If you're on mac I might be able to help. I see a manual installation guide to on square docs page! Did you see that? It might suite best with the knowledge you have now, though you'd need to adapt it to your own templates. Development aside, looking at the actual problem, maybe Pro module FormBuilder would be helpful if you have the budget to spend on it, and instead of Square you could use Stripe and that might might just be and almost plug and play solution depending on additional logic that do want to handle. Don't hesitate to come back and ask even if it seems like something "super obvious" or "dumb" in your view, this is a welcoming community for everyone no matter their experience.
  10. OMG what is this gem I hadn't seen! Thanks @Gideon So!
  11. I had not! ? Thanks! Let me read the module's readme and I might come back with questions ?
  12. So it goes like this, you create a migration file under the Setup > Migrations. This is a "Default" type of migration. Which is the one I only use, since with RockMigrations the whole API work is abstracted so nicely that working with the "data schema" (meaning ALL the config in processwire) is really more simple, so no need for the specific migrations types. <?php class Migration_2022_06_02_11_42_58 extends Migration { public static $description = "Do some awesome migrations stuff"; public function update() { // Put your migration code here $rm = wire('modules')->get('RockMigrations'); $rm->migrate([ 'fields' => [ 'button_label' => ['label'=> 'Button Label', 'type' => 'text'] ] ]); } public function downgrade() { // Put your rollback code here } } Then this runs either through the UI under Setup > Migrations or the CLI included in the Migrations module. We could say one "caveat" is that to use the CLI you need to install the Migration module through composer as the CLI tool has dependencies assuming them. So every time I wan to to push a migration to the live site, the pipelines I use for deployment (Bitbucket Pipelines) rsync's the new files, then triggers on the server: php /path-to-website/site/modules/Migrations/bin/migrate run Or for anyone reading this not familiarized with CI/CD pipelines, just log into the server and run the command. So "migrate run" runs all "pending" migrations. Previously run migrations are already tracked as migrated, so they won't run again. cc @MrSnoozles. I DO NOT, have an automated rollback solution yet, in terms of the CI/CD pipeline. So if I break something, I just move forward with another migration. Let me know if it sounds I'm skipping something, wrote this a bit quickly!
  13. @MrSnoozles You could take a look at using Migrations + RockMigrations (which work great hand by hand!) which satisfies exactly this. So you only substitute the "migration files" system, but use the invaluable abstractions from RockMigration. @bernhard interesting idea the tracking within the fields!
  14. No worries mate! I precisely saw this issue commented here: https://github.com/processwire/processwire-issues/issues/1569 Did you see that or arrived to the solution by chance?
  15. remove() takes the key as argument, not the value. I'd wonder, if the WireArray is numerically indexed, would there be a way to use a selector to find the item to delete first?
  16. Hi @LexSanchez made a PR to support TikTok embed, thanks for this great module!
  17. You need to get $inputfieldTextTags from the field itself: $inputfield = $page->getInputfield('tags_field'); $list = $inputfield->getTagsList(true); foreach($list as $item){ // echo tags ? }
  18. This is useful? https://processwire.com/api/ref/inputfield-text-tags/get-tags-list/
  19. Oh yes, fix the ids selector! <?php foreach ($pages->findIDs('id=1223|1224|1225, sort=-created')->children as $item) : ?>
  20. I might have complicated this way tooe much maybe simply: $item->parent->id == 1234
  21. if($item->matches('parent=1223')){ ... } Maybe try this?
  22. Iterating for output shouldn't be an issue, could you post a more complete code sample?? I only see an empty for loop on your previous post.
  23. Before editing/saving any repeater item call: $item1->of(false); $item1->title = "new title"; $item1->save(); More info here: https://processwire.com/api/ref/page/of/ Repeater items are themselves RepeaterPage objects which is a class that inherits from Page, hence the formatting flag applies too.
  24. Can you try: wire('pages')->find("template=repeater_grid, mp4!='', ratio='', check_access=0"); find() won't find the repeater data pages since they would be restricted due to access control.
×
×
  • Create New...