Jump to content

gebeer

Members
  • Content Count

    996
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by gebeer

  1. @ dragan this is a localhost issue. Try it on a life server and it should work. As far as I'm aware of, Gmaps don't work from localhosts. Since Gmaps API v3 there is no need for a key.
  2. Our machines can do multitasking but we seem to be condemned to sequential operation
  3. Hello, I'm using latest version of this module with PW 2.3 and it's working fine so far. But when in debug mode, it throws 2 notices/warnings: Notice: Trying to get property of non-object in .../wire/core/Page.php on line 275 Warning: Invalid argument supplied for foreach() in .../wire/core/Page.php on line 275 My form has no fancy fields and is sending the input to an email. There's one select field for a salutation (Mr., Mrs...). In the message that gets sent, the option values are put out instead of the option name. How can I change that? Cheers gerhard
  4. Hello all, I would like to add a standard Gmaps info window (the white balloon type with shadow) to my marker. I have a single marker on the map and use standard $map->render function. From the Gmaps API documentation about info windows I see that I somehow have to add something like var infowindow = new google.maps.InfoWindow({ content: contentString }); How would I go about that, can I create something like a hook event to extend the standard render function from the module or can I just add a piece of JS to the page? Any enlightenment would be much appreciated. Cheers gerhard
  5. Thank you for clarifying this. I'm on stable branch.
  6. @teppo & Martijn thanks a lot. I knew there would be a better way to do this EDIT Martijns solution doesn't seem to work in my case. I first get the page by ID $aktuell = $pages->get(1041); If I then do if (!$aktuell->is('unpublished')) the if condition is being ignored. But with if (!$aktuell->is(Page::statusUnpublished)) everything behaves as expected.
  7. Hello, I need to find a good way to check for the status of a page, whether it is unpublished or not. If I do echo $page->status I get these values: published: 1 unpublished: 2049 hidden and published: 1025 hidden and unpublished: 3073 My page is hidden by default. So to check for unpublished state I do if ($page->status == 3073) which is working fine. Only thing that worries me is that I know nothing about these status codes and whether it will always be 3073 for hidden and unpublished. So if you know a more generic way of doing this, please share it here. Thank you. Cheers gerhard
  8. @Ryan your code threw a little error because $summary was not defined. The first $text in the function should be $summary. Here's the complete fixed function: function truncateText($text, $maxlength = 200) { // truncate to max length $summary = substr(strip_tags($text), 0, $maxlength); // check if we've truncated to a spot that needs further truncation if(strlen(rtrim($text, ' .!?,;')) == $maxlength) { // truncate to last word $text = substr($summary, 0, strrpos($summary, ' ')); } return trim($text); } Cheers gerhard
  9. I think for number 2 you need the $page->render() function. On the API Cheatsheet it says: Returns rendered page markup. echo $page->render();
  10. Where did you add the code? It should go into the code for the month menu <!-- NAVIGATION FOR MONTHS --> <div> <ul id='topnavmonths'> <?php $monthpage = $pages->get("/events/months/"); $children = $monthpage->children; foreach($children as $child) { $class = $page === $child || $child->children->has($page) ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; }; ?> </ul> </div> $page and $child represent the month page that you are currently on. $child->children represents the day pages of that month. has($page) now checks if the page we are currently on is in the day pages of the month we are in. This should do the trick.
  11. Hi Matthew, thank you for the hint. There's so many possibilities to discover. It's amazing. Cheers gerhard
  12. Thank you, Ryan, for sharing this with us. Using strip_tags and wrapping the output in <p> or whatever tags seems to be a great solution. And I don't think this needs to go in the core because everybody can implement their own favourite solutions.
  13. Thank you Soma Working great and so easy once you know it
  14. Hello all, this is a real beginner's question, I guess. Got stuck on how to select the nth child of a page. Couldn't find the right selector at the API cheatsheet or am just to stupid to understand them right. Also searched the forum. What I want to achieve is something like $page->child(2nd); I tried $page->child("start=2"); but the script then just stops there without throwing an error. I'm sure that should be pretty simple but have no clue atm. Thanks in advance gerhard
  15. Glad it helped. For keeping class on for month when you are on the day page: $class = $page === $child || $child->children->has($page) ? " class='active'" : ''; Worked fine for my case. Or the other way around like diogo suggested a few posts above: $class = $page === $child || $page->parents->has($child) ? " class='active'" : ''; Hope it helps. PS: nice picture from Bkk
  16. Try changing this line in your code $daypage = $pages->get("/events/months/$page->parent->name/"); to this $daypage = $page->parent; Give it a try and let us know.
  17. @pwired I stay there for max 5 month a time. So I get a tourist visa for 60 days with 3 entries which gives me 180days total and at the moment costs 90€. @Martijn I know that feeling.
  18. @BFD Calendar what is the $page->parent->name, when you are on a days page?
  19. I was asking if you visit Thailand often Ko Lipe is nice, indeed. I live in Ranong and love the little Island Koh Chang in the Andaman sea.
  20. Kop khun maak krap. Bai pratheet Thai boi mai?
  21. @Martijn cheers for the welcome. I can already see how PW can be addictive. Was sitting and playing around with it late last night, the night before and the night before...
  22. Hi Marcura, thanks for your thoughts on this. Custom error messages would sure be a great option to have in Form Builder. To build my own form code in the template and then use FB for processing seems like a little overkill to me as in my case I only need to send the form by email. As I saw in another thread, this should be fairly easy by using mail().
  23. @Soma Thank you for the suggestion. I would do the positioning by CSS only as a last resort. If it was up to me, generic error messages would be just fine. But unfortunately here my client has the say. So I need to do without Form Builder this time. Fortunately you posted great info on how to output forms in the frontend here in the forum. That should give me a good start. Cheers gerhard
×
×
  • Create New...