dab

Members
  • Content Count

    76
  • Joined

  • Last visited

Community Reputation

21 Excellent

About dab

  • Rank
    Full Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1,384 profile views
  1. dab

    Sorry...this still wasn't working correctly, but this fixed it $thumb = $language->getUnformatted('flag_icon')->first; <?php foreach($languages as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? if($language->id == $user->language->id) { echo "<span class='currentlang'>"; } else { echo "<span>"; } $url = $page->localUrl($language); $hreflang = $homepage->getLanguageValue($language, 'name'); $thumb = $language->getUnformatted('flag_icon')->first; echo "<a hreflang='$hreflang' href='$url' title='$language->title'><img src='{$thumb->url}' alt='$language->title'/></a></span>"; } ?>
  2. dab

    Yes, an old post, but if you are having the same problems as @ChriWolf with the primary icon not showing when you swap to the 2nd language. It seem to fail when the field is called "language_icon", but works with the field called e.g. "flag_icon"...so omit the use of the word "language" for your image field name.
  3. dab

    @adrian thanks for the work on this! It's a super module that just got even better! Hope it's of use to others in its new multi-language support mode.
  4. dab

    Many thanks @Robin S, I was using the first option, initially as just the page id (obviously the request_id wasn't getting called, & then I tried "/login?return={id}" - but clearly the syntax was wrong. Thanks, I've spent hours going through the the forums & trying various combinations of code - I'm so grateful for your help.
  5. dab

    @Robin S, thanks kindly for your suggestion. I tried this, but instead, the logged in user get redirected to "home" on login instead of the requested page. The html output is <form action='./?id=1' What I don't understand is why the "get" $request_id is not working.... // get id var from request $requested_id = (int) $input->get->id; I'll see if I can find anything else on the forums.... With thanks.
  6. dab

    ..I did some more digging & identified that the chrome issue happens when I use: $content.="<form action='./' method='post'>"; rather than @Soma's code which was originally: $out = '<form action="./?id='.$requested_id.'" method="post">'; Note: I had to change some of the quotes on @Soma 's post to: $content.="<form action='./?id=".$requested_id."' method='post'>"; as the original gave a parse error with delayed strategy templates. but the resulting html output from my edit is: <form action='./?id=0' method='post'> So something is not quite right with the code, as the requested id is not being picked up from the code... if ($user->isLoggedin()) { $content.="You are already logged in."; } else { // get id var from request $requested_id = (int) $input->get->id; if ($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if ($session->login($user, $pass)) { // login successful $t = $pages->get($requested_id)->path; $session->redirect($t); } else { $content.="Login Failed. Please try again."; } } $content.="<form action='./?id=".$requested_id."' method='post'>"; $content.="<label for='name'>Usename:</label> <input type='text' name='user' id='name'/>"; $content.="<label for='password'>Password:</label> <input type='password' name='pass' id='password'/>"; $content.="<input type='submit' name='submit' value='Login' class='button fit special' />"; $content.="</form>"; } Not sure what to try next....
  7. dab

    I'm using @Soma 's nice code for a custom login & it's working great on IE, Edge & FF (thanks!) but on Chrome I just get a blank page after the login. After refreshing the page the password protected page loads OK. I've no plugins on Chrome blocking page reload etc. The pages has a template with access denied to guest, but set to allow access via a specific role/user with access. The template for the page is set to redirect the user to the login page when a user attempts to access. Not sure if this is significant, but the password protected page url stays the same when the the login page is presented to the user... Has anyone else come across this (Chrome issue)? Thanks
  8. I've had this with several sites when trying to up from 3.0.62 to 3.0.90 - but I've still not resolved it. I suspect it is a languages issue, as the sites were setup using the multi-language template, but in the end the sites just used a single language. I also get a 404 when trying to edit some (but not all) of the pages via the admin login PW editor back end. NOW RESOLVED: If you have all the language modules installed, ready for a multi-linugual site & are not using them you will get 404 issues. I've converted fields to single language, removed all the language modules from the core tab & after upgrade no issues are seen.
  9. dab

    Found a fix for posts with multiple images... Replace // output video with: <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> e.g. <div class="instagram"> <?php foreach ($feed as $media): ?> <?php if ($media['type'] === 'image'): ?> <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> <?php else: ?> <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> <?php endif; ?> <?php endforeach; ?> </div>
  10. dab

    Has any one noticed a problem with Instagram posts with multiple images not showing? I get the output: // output video suggesting that "multiple image" posts are not picked up as media type "image". <?php if ($media['type'] === 'image'): ?> With thanks...
  11. Make sure in your CSS you set the width to 100% & specify the height in px. I use: width: 100%; height: 600px; position: relative; overflow: hidden;
  12. dab

    Got it! So simple really $events = wire('page')->course_start_date_repeater;
  13. dab

    no problems, any ideas/input welcome
  14. dab

    @louisstephens Thanks.... It's got to be called via a hook, rather than a regular call from a page function getEvents() { $events = wire('pages')->get("/courses/hill-skills/")->course_start_date_repeater; foreach ($events as $event) { echo "'$event->course_start_date' : '<span>BOOK BELOW!</span>',"; echo "'$event->course_finish_date' : '<span>PICK THE START DATE!</span>',"; } }
  15. dab

    I'm using the "wire ('pages')->get" hook for an event calendar. The wire hook below is "hard coded" & works fine $events = wire('pages')->get("/courses/skills/")->date_repeater; But I want to get the repeater for the current page (being viewed) I've tried lots of ways of replacing the "->get" to get the repeater from the current page, but no luck. I've tried $currentpage = $page>path; & replacing the get("/courses/-skills/") with $currentpage but no joy.... Any hints would be a huge help.