• Content count

  • Joined

  • Last visited

  • Days Won


gebeer last won the day on March 26

gebeer had the most liked content!

Community Reputation

746 Excellent

About gebeer

  • Rank
    Distinguished Member

Profile Information

  • Gender
  • Location

Recent Profile Visitors

7,510 profile views
  1. gebeer

    @Peter Knight What do you want to do with products that do not have images? In your foreach you define the $image variable only when there are images. Then you echo the images even if there are none. This will give you a PHP notice for $image is undefined. You'd need another if condition within your echo to check for isset($image) and only output the image if there is one. The way you setup your images field it should definitely return an empty array if there are no images so the if (count($prod->images)) should work as expected.
  2. gebeer

    This is an option only for visitors with JS enabled. I decided to copy the module to site/modules and extend it there. Though it would be really nice if we could extend the comments form with hooks.
  3. Hello, I need to add a checkbox to the comments form to make it GDPR compliant and I guess I'm not the only one... Doing a search and looking at the FieldTypeComments module file it seems that the only way to add custom fields to the form is by copying the module to site/modules and apply the changes there. I am just wondering why the comment form is not driven by the PW form API and also why none of the methods in that module are hookable? Would be much appreciated if you could share your approaches on handling this.
  4. don't think so since the error method is not hookable nor is any other method in that class that would give you access to what you need.
  5. If you don't want to change the core Inputfield.php that @PWaddict points to, you can copy the whole Inputfield module folder to site/modules and apply your changes there. When you then refresh the modules in the backend PW will ask you from which location the module should be loaded.
  6. gebeer

    Have you tried <?php // get all pages in page field sorted by manual sort order $resultsAllSorted = $page->my_page_field->sort('sort'); // filter $resultsCategory = $resultsAllSorted->filter('category=1474'); // loop foreach($resultsCategory as $result) { // ... } ?
  7. @Fantomas Thank you for letting me know. I had tried the second notation that you mentioned with exactly the same code I put in Rest.php. But on my server environment this wouldn't work. Because HTTP_AUTHORIZATION was always empty. I never tried REDIRECT_HTTP_AUTHORIZATION. It did not occur to me since in the .htaccess rewrite rule it defines HTTP_AUTHORIZATION. So you pointed me to the final piece of the puzzle. Thanks again for that. I now can implement this in a way that it will properly work in most server environments.
  8. gebeer

    @uliverse You can still use the Leaflet module and read through this thread from the link I recommended in my last post. Then have a look at how BrendonKoz and patman solved it in their forks. Seems like they have a readily available solution.
  9. gebeer

    This module is meant to give a lt/lng position of an address so we can display a marker on a map. It is not an address field type. When you set the marker on the page that you edit, it will get the address for the lat/lng that you have set in the GUI by reverse geocoding it through the Google geocoding API. This returns the long address string that you can get in your template with $page->mylocationfieldname->address. To answer your question, there are ways to get a properly formatted address but all of them involve some work: 1. extend the module yourself to store address parts. Or read posts in this thread from here on and than use @BrendonKoz or @patman forks: 2. add fields to your template for postcode, street address, city, country. Fill them manually when you edit the page. Then you can render them in your templates. This should be the easiest way. 3. switch to the Map Marker Module which uses Google Maps and read from this post on where @adrian has extended the functionality to give you exactly what you want:
  10. gebeer

    Unfortunately this is not well documented in the API reference?
  11. gebeer

    You can send an $options array with the render method and use that in child.php So in your Hanna code echo $child->render(array("useMain" => false)); Then in child.php before your other markup <? if(isset($options['useMain'])) $useMain = $options['useMain']; // this will give you false when rendered from Hanna code ?> and somewhere in the top area of your your _main.php <? if(isset($useMain) && !$useMain) return; ?> This will take care of not rendering _main.php
  12. @Fantomas @Batyr Place this at the top of your .htaccess and try again SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 This should make $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] available in fastcgi/cgi environments. It works in my server setup. Please report back if this fix also works for you.
  13. @Fantomas Is you server setup Apache with PHP running in fast cgi mode? Then $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] will not be populated. I just setup my tutorial in a fast cgi environment and could reproduce your problem. I also found the problem and a possible solution and will implement that into the Rest.php gist and let you know once it is updated.
  14. @Fantomas can you post your request header please?
  15. gebeer

    very good writeup and great website! Would you be willing to share your rsync setup for uploading changed files? I love rsync and use it a lot. Does your setup connect to git commit in any way?