Jump to content

Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates

  1. Past hour
  2. Tomek! HUGE thanks for your work! I use your translation (modified here and there) on few sites and I'm building (veeeery slowly... πŸ™ˆ) two other sites so I'll definitely dig into this version at some point. Cheers! Chris
  3. Today
  4. Just open your PW Admin Panel -> Modules -> Install Language Support Languages Support - Fields Languages Support - Page Names Languages Support - Tabs
  5. Hi @wishbone Glad that you sorted it out. Keep happy coding with ProcessWire. Gideon
  6. Yesterday
  7. This looks a nice idea and I was looking to implement something similar on a site of mine. However, many pages have repeater matrix fields. If these are changed directly, rather than through the host page edit, then the modified date for the host page is not changed (even though the updated results are shown). I guess there are two ways of fixing this: hook on saving the repeater item to set the new mod date for the host page check all mod dates - for host and repeater pages - rather than just the host page Any ideas which approach is more efficient? I guess I'm more inclined to option 1.
  8. Thank you very much. I don't know that this is possible with ProDrafts.
  9. OMG you're a genius. I don't know how I missed that, but thanks. I just needed to run $child->save(); thanks
  10. That's an interesting finding. PrivacyWire hooks into the page->render method for the rendering: $this->wire('page')->addHookBefore('render', $this, 'initiatePrivacyWire'); Is this still called when accessing a URL created with URL-Hooks? If not, what would be an alternative point to hook=
  11. the layout functionality is creating the initial page structure, but It's not creating a template with fields on the fly, if that's what you mean. The page structure is defined by the items you add to your page. PageGrid creates a hidden page for every item that gets added to it (similar to how PageTable or Repeater Matrix work). Each item is based on a block template. A template can have multiple fields to hold your data (native ProcessWire templates and fields). You can use all the fields ProcessWire provides or add even more fields using external Fieldtype modules. But you have to create these templates yourself, as well as the markup that gets rendered. If you want to get started quickly, I also developed some block modules that you can install optionally, these will create templates, fields as well as a template files automatically, without the need to write any code. These blocks will cover the basic needs for most websites (containers, text, images, video, slider, maps, etc..). More information and documentation is coming soon. Until then have a look at the first post πŸ˜‹
  12. Perfect! And thanks again for your module and these changes / helper
  13. Thanks @kongondo for clarification and the swift update. I’ll print this out and put it on my wall πŸ˜‰
  14. Last week
  15. Thank you really with include=all everything works and shows well. As for your first question, this page is available for viewing. I have a part of the assortment of the cafe displayed on the main page. The administrator puts a check mark that this element should be shown. That's all.
  16. Hi all. This is where my lack of actual PHP knowledge is getting to me. I've inherited a never-completed WordPress website that I'm trying to redo in PW. There are products, categories and product options all supplied as separate CSV files. (These will be edited and uploaded every day, so I will need to eventually import the data with a chron script). Importing and displaying the category and product data isn't a problem, but the product options files contains numerous fields with comma- and pipe-delimited strings which need to be converted into arrays. So, when viewing the product-page (template) for 'Chair 123' (product code 'c123'), I'd normally get all the options like '$options = $pages->find('template=options-page, pcode=c123'); But since there are fields in the options-page that look like "505|501|512" (for color codes), I'll need to get these into an array. Thats' very simplified; the actual options page has about 45 fields, used to present various options in 3 worldwide territories with multiple parts/color combinations for each conditional territory! I should also mention that I have the old WordPress site and can see the custom functions the previous guy had set up and (for me) it's very complicated. Most of it is standard PHP, so I was hoping to use much of it 'as is' as I can. For instance, there's a function on the products page that returns an associative array that looks like this (in the WordPress php): $bt_options = bt_get_product_options($entry["code"]); foreach($bt_options['spec_docs'] as $key => $bt_spec_doc) { $bt_show_download = ""; if($bt_options['spec_docs_territory'][$key] == "E" && $bt_this_territory == "EU") { $bt_show_download = "Y"; } elseif($bt_options['spec_docs_territory'][$key] == "U" && $bt_this_territory == "US") { $bt_show_download = "Y"; } ... } And the bt_get_product_options function starts with this (again from WordPress) function bt_get_product_options($id) { global $wpdb, $bt_colours, $mysql_table; $entriesList = $wpdb->get_results("SELECT * FROM ".$mysql_table['options']." WHERE web_product_code = '".$id."' ORDER BY id ASC LIMIT 1"); $entriesList = json_decode(json_encode($entriesList), true); /// CONVERT TO STANDARD ARRAY if(count($entriesList) > 0){ $output = array(); $output['jquery'] = ""; foreach($entriesList as $entry) { ... /// COMBINATION TERRITORY elseif($key == "comb_territory" || $key == "addnl_subtabs_territory" || $key == "spec_docs_territory"){ $ter_array = explode("|", $tt); foreach ($ter_array as $k => $tr) { $output[$key][] = $tr; } } ... loads more like this ... } } return $output; } TL;DR: Can I use the above in my PW code, provided I swap the WP MySQL bit with $entriesList = $(wire)pages->find("template=options-page, product_code=$id, limit=1) ? (I tried this on a limited set of fields but didn't return anything). Or do I need to do a MySQL request too? And from what I can tell, thet json_decode/encode line should covert the page object to an associative array, correct? Should that work in this case? Thanks for reading this far.
  17. Sorry, just solved it, I had two consecutive Ajax request, hence the duplicate entries.
  18. thx @szabesz Hi @Andy thx for your kind words! well... I like to do thinks in code rather than clicking around a GUI, because then I have all in GIT and can automatically deploy it to production. In addition to that I love how you can write form code once and get frontend and backend validation of your forms automatically. The next point is that I don't like the embed methods via Iframe and I never got used to the other output method - how is it called? Direct output? Another point is that I try to avoid hook hell as much as possible. Hooks are great, but I started to adopt concepts where things that belong together are in the same file or folder. That's why every form that I create for RockForms is one single PHP file, that defines all the necessary pieces (fields, after submit action like sending an email, markup for the frontend, error messages...). <?php namespace ProcessWire; /** @var RockForms $rockforms */ $form = $rockforms->form('newsletter', [ 'token' => false, // disable csrf for use with procache! ]); $form->setMarkup("field(email)", "<div class='sr-only'>{label}</div>{control}{errors}"); $form->getElementPrototype()->addClass('mb-12'); $form->addText("email", "E-Mail Adresse") ->setHtmlAttribute("class", "text-gray-dark w-full focus:border-violet focus:ring-violet") ->setHtmlAttribute("placeholder", "Ihre E-Mail Adresse") ->isRequired(); $form->addMarkup("<button type='submit' class='btn btn-sm btn-pink !px-12 mt-6'>Newsletter abonnieren</button>"); if($form->isSuccess()) { $values = $form->getValues(); if($form->once()) { /** @var RockMails $mails */ $mails = $this->wire('modules')->get('RockMails'); $mails->mail('newsletter') ->to('office@example.com') ->subject("New Newsletter Subscription") ->bodyHTML($form->dataTable()) ->send(); $this->log('sent mail'); } $form->success('<span style="color:black;">Thank you for your subscription</span>'); } return $form; This is an example for an easy newsletter subscription form. For me it is also better to code my own module because then I have a lot more freedom and can add extensions and new features while working on any project that uses the module. For example the $form->dataTable() is something I need very often (send form data via mail or show form data in the backend). I guess I'll release this as commercial module soon - if anybody reads this and is interested in a closed alpha write me a PM πŸ™‚
  19. I am trying to get some sites to remain in Unpublished status until certain conditions are met. However, I have a problem with the message ProcessPageEdit: Published Page. Overall, wire()->addHookAfter("Pages :: saved") seems to work for existing pages. And I can put them into Unpublished status whenever I want after I have saved them. But when creating a new page, the order of events is different. The newly created page is set to Published status when someone clicks Publish in the second step of the page adding process. But it runs after my code. How to solve this problem? Is there any documentation about the order of events?
  20. 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
  21. Hi, I have problem with image extensions in my pages. I added extensions allowed in the config file. Thank you for any help
  22. I looked at my HTML output today and all this chaotic whitespace triggered my OCD. This module simply hooks into Page::render and removes whitespaces from frontend HTML with a simple regex replace. I mostly put this together for cosmetics. I like my View source neat and tidy. This is not well tested yet, please open an issue if you run into problems. GitHub: https://github.com/timohausmann/MinifyPageRender
  23. About the config file: okay, thank you 😊 About the module errors: I haven't done anything but install PW though - not messing about with modules or anything, these errors showed up right after installation. (Also, I can't find the "missing" tab you mentioned, I have: Site, Core, Configure, Install and New).
  24. Thank you kindly for this and for such a swift response mate! Happy weekend to you
  25. Hey @adrian, thanks for the great module! I have an issue with .webp files, they are not renamed at all on page save. JPG are renamed without any problem. What could I do to find a solution to this ? Using PW v3.0.200, PHP 8.1, no errors in Tracy.
  26. I have a strange occurence which I have a hard time explaining/debugging. I have a module that contains a .JS file. I load this JS file using a hook, that is called when the template != admin... meaning it will only be called on the frontend. This works on my LIVE environment, but my DEV environment seems to decide to load the file somewhere. Since it contains a script that prevents scrolling, I cannot scroll in the admin. Is there a circumstance in which modules load JS files placed in their folder? Perhaps when it has the same name of the module under certain PHP versions?
  1. Load more activity
  • Create New...