gebeer

Members
  • Content count

    788
  • Joined

  • Last visited

  • Days Won

    7

gebeer last won the day on March 26

gebeer had the most liked content!

Community Reputation

738 Excellent

About gebeer

  • Rank
    Distinguished Member

Profile Information

  • Gender
    Male
  • Location
    Thailand/Germany

Recent Profile Visitors

7,397 profile views
  1. 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.
  2. 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.
  3. 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) { // ... } ?
  4. @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.
  5. 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.
  6. 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:
  7. gebeer

    Unfortunately this is not well documented in the API reference?
  8. 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
  9. @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.
  10. @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.
  11. @Fantomas can you post your request header please?
  12. 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?
  13. gebeer

    if ($prod->images) will always return true, since your images field can hold more than one. Use if ($prod->images->count) instead. That should resolve the error for empty image fields.
  14. gebeer

    @Karl_T Glad it works. Using markup regions implies the use of the delayed output strategy. So your good to go $useMain was introduced in the advanced site profile that ships with PW and has been around for quite a while. Since many people adapted that, you see $useMain mentioned a lot throughout the forum. But it has nothing to do with the API.
  15. gebeer

    PW is still supoorting it if you are using the delayed output strategy in your templates. $useMain has become kind of a convention when using this strategy, but infact, it is just a user defined variable. You could call it $includeMain or whatever you want. How I use $useMain: 1. in my _init.php I define $useMain = true; So it is true by default and the _main.php will be appended to all template php files. In the top area of the _main.php I do somethinmg like this if(!$useMain) return; // if $useMain is set to false in a template php file, then do not render _main.php Then in the template where I don't want _main.php to get appended, I set $useMain = false; In your case, when you don't want to have _main.php appended for AJAX calls you can do this in the template that receives the AJAX request if($config->ajax) $useMain = false; Of course this concept only works for the delayed output strategy.