Flashmaster82
Members-
Posts
182 -
Joined
-
Last visited
Everything posted by Flashmaster82
-
Find template in ready.php page reference (hooks) admin
Flashmaster82 replied to Flashmaster82's topic in General Support
Thanks for your reply but still no results... if i remove , sports_team=$relative It will show all profile names so i works almost. If i put that string on the actual page either id or name it will show just those profile names but on the admin maybe there is something different you have to write im clueless.. -
Hi, can you guys help a beginner with a problem.. On my template (profile_page) i have a dropdown (page reference) where i can choose a sports team (team_page) that is related to that profile which is also its parent. Then on my Competition1 page (competition_page) I have page reference field (profiles) a dropdown that i want to display only profiles that has choose a specific sports team (template=team_page) the page parent to be specific. Structure/Template Sports_team1 (team_page) Profile1 (profile_page) Profile2 (profile_page) Profile3 (profile_page) Competition1 (competition_page) ready.php <?php $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == 'profiles') { $relative = $page->parent->name; $event->return = $event->pages->find("template=profile_page, sports_team=$relative"); } }); ?> This returns with no results in the dropdown. If i remove sports_team=$relative then it displays all profiles that have profile_page as template, so it works almost. But i will have more sports teams so this is just an example. I only want to display the profiles that has choosen the parent team on there profile page in admin not front end. I hope i was able to explain it so you guys can understand a little bit. Need some help please! /Thanks
-
Hi, i´m building a sports website where you can sign up and get your own profile that is also linked to a team page. On the team page i want 1 user to be admin and could edit the page as well. I also trying to build/implement a Tournament Bracket example (https://codepen.io/rzencoder/pen/JaQreL) or (https://codepen.io/mattpantoja/pen/eYmzKjR) page where the user could set up there local tournament with say 8/16 etc competitors based on the users on the team. I have set up a tournament_page.php and a page reference to the team (option), but i dont know how to save the value of the options (front end) to the page. Also i want to make a result list afterwards based on the values. The example link above is jquery, maybe its better to work on a simpler php solution instead im really lost here. If there is someone out there that have a better idea of something that could make this work i would highly appreciate it. I´m just a beginner at php so i really need some help from you guys /thanks
- 1 reply
-
- tournament
- brackets
-
(and 1 more)
Tagged with:
-
Not working with Png or Svg images... Any solutions?
-
Because they will still be visible on my website even when moved to archive.
-
can someone please help me. I´m using this module in the PW 3.. and its working as it should. I have a jobboard and when the pages gets archived i want them to be unpublished, is that possible?
-
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Happy dance!!! ? yaaay!!! I think i looks awesome now and it works perfect! Thank you so much for the help you are the best!! -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
This is how it looks like now, when i go over with the mouse the cursor will show upp but when i click on it it wont open? -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
The dropdown wont open when i click on it? Strange.. -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
This is my css now .upper-links { display: inline-block; padding: 0 11px; line-height: 23px; letter-spacing: 0; color: inherit; border: none; outline: none; font-size: 12px; } .dropdown { position: relative; display: inline-block; margin-bottom: 0px; } .dropdown:hover #gf-f { display: block !important; } .dropdown .dropdown-menubar { position: absolute; top: 100%; display: none; background-color: #fff; color: #333; left: 0px; border: 0; border-radius: 0; box-shadow: 0 4px 8px -3px #555454; margin: 0; padding: 0px; } #gf-fbtn { position: relative; display: block; width: 160px; height: 30px; border: 1px solid #ddd; background: #f5f5f5; cursor: pointer; text-indent: 50px; color: #707070 !important; left: 0px; line-height: 29px; } .gf-ful li { height: 22px; } .gf-if { width: 24px; height: 18px; position: absolute; top: 6px; left: 15px; } #glbfooter a { font-size: 12px; } #gf-fbtn { cursor: pointer; text-indent: 50px; color: #707070 !important; line-height: 29px; } #gf-fbtn-arr { position: absolute; right: 10px; top: 13px; height: 4px; width: 8px; } .gh-spr, .gh-sprRetina { background-image: url('../assets/misc/nav/img/sprd-arrows.png'); background-repeat: no-repeat; } #glbfooter a { font-size: 12px; } #gf-fbtn { cursor: pointer; text-indent: 50px; color: #707070 !important; line-height: 29px; } #gf-fbtn:hover > #gf-f { display: block; } #gf-f { position: absolute; width: 160px; background: #f5f5f5; border-left: 1px solid #dddddd; border-bottom: 1px solid #dddddd; border-right: 1px solid #dddddd; z-index: 9; } #gf-f .gf-if { display: block !important; position: relative; left: -28px; top: -21px; } .default { display: inline-block; background: url('../assets/misc/nav/img/se.svg') no-repeat; text-indent: -9999px; text-align: left; background-position: center; top: 8px; left: 10px; width: 20px; height: 12.5px; } .english { display: inline-block; background: url('../assets/misc/nav/img/gb.svg') no-repeat; text-indent: -9999px; text-align: left; background-position: center; top: 30px; left: 10px; width: 20px; height: 10px; } .sinhalese { display: inline-block; background: url('../assets/misc/nav/img/lk.svg') no-repeat; text-indent: -9999px; text-align: left; background-position: center; top: 50px; left: 10px; width: 20px; height: 10px; } .down-blue, .down, .down-s-b, .down-s { display: inline-block; background: url('../assets/misc/nav/img/sprd-arrows.png') no-repeat; overflow: hidden; text-indent: -9999px; text-align: left; } .down-blue { background-position: -2px -0px; width: 24px; height: 12px; } .down { background-position: -2px -14px; width: 24px; height: 12px; } .down-s-b { background-position: -2px -28px; width: 8px; height: 4px; } .down-s { background-position: -12px -28px; width: 8px; height: 4px; } -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Ok now the dropdown showed up! Yaay ? I replaced the sprite icons with 3 of my svg icons that i wanted for the site. Replaced the code with the one you sent me but the dropdown menu wont open? -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Thanks for the css, i put that in the bottom of the nav.php <link rel="stylesheet" href="<?=$config->urls->templates;?>css/dropdown.css"> and changed the paths to the images that you attached. See my attachment for the current result. /thanks -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Thanks Flydev for the reply, i will try to read more about basic php ? I didnt have a _init.php or other files that make some codingthings with the language, so i defined it in the beginning like you sad. <?php $homepage = $pages->get('/'); ?> <div class="navbar_language_wrapper"> <?php $langswitch = ''; foreach($languages as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? if($language->id == $user->language->id) { // current user language $langswitch .= "<li class='current'>"; } else { $langswitch .= "<li>"; } $url = $page->localUrl($language); $hreflang = $homepage->getLanguageValue($language, 'name'); $langswitch .= "<a hreflang='$hreflang' href='$url'>$language->title<b class='gf-if gspr {$language->name}'></b></a></li>"; } echo "<ul class='langswitch'>{$langswitch}</ul>"; ?> Now i have the language in a list so i guess its one step closer to the finish ? Did you have some css for that? -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Hi Flydev and bernhard and thanks for helping a beginner ? Flydev, thanks for learning me about the variable names. Is this more correct of should i use for example <?=$p->phone;?> whats the different? can i use $p for universal of the whole site? <?php $footer = $pages->get("/misc/footer/");?> <?php foreach($footer->navigation as $footer ): ?> <div class="col-12 col-sm-6 col-md-3 col-lg-2 col-xl-2"> <ul> <div class="bold purple bmar2 h5"> <?=$footer->heading;?> </div> <?php foreach($footer->navlinks as $footer) { echo "<li class='footer_links_selected'><a href='$footer->url' class='black footer_links '>$footer->title</a></li>"; } ?> </ul> </div> <?php endforeach;?> <div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-4 text-right"> <?php $footer = $pages->get("/misc/footer/");?> <div class="footer_phone"> <?=$footer->phone;?> </div> <div class="footer_email"> <?=$footer->email;?> </div> </div> About the multi language dropdown. I tried to just replace my code with yours, but it then gave me error (see attachment) <div class="navbar_language_wrapper"> <?php $langswitch = ''; foreach($languages as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? if($language->id == $user->language->id) { // current user language $langswitch .= "<li class='current'>"; } else { $langswitch .= "<li>"; } $url = $page->localUrl($language); $hreflang = $homepage->getLanguageValue($language, 'name'); $langswitch .= "<a hreflang='$hreflang' href='$url'>$language->title<b class='gf-if gspr {$language->name}'></b></a></li>"; } echo "<ul class='langswitch'>{$langswitch}</ul>"; ?> </div> Thanks for helping me! -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
think i fixed it changed it to <?php $page3 = $pages->get("/misc/footer/");?> (page3 instead of page) ? -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Ok i think i know what the problem is. in nav.php this code is making it not work in section1.php <?php $page = $pages->get("/misc/footer/");?> <?php foreach($page->navigation as $page ): ?> <div class="col-12 col-sm-6 col-md-3 col-lg-2 col-xl-2"> <ul> <div class="bold purple bmar2 h5"> <?=$page->heading;?> </div> <?php foreach($page->navlinks as $item) { echo "<li class='footer_links_selected'><a href='$item->url' class='black footer_links '>$item->title</a></li>"; }?> </ul> </div> <?php endforeach;?> <?php $page = $pages->get("/misc/footer/");?> <div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-4 text-right"> <div class="footer_phone"> <?=$page->phone;?> </div> <div class="footer_email"> <?=$page->email;?> </div> <?php $page = $pages->get("/misc/footer/");?> is the problem can i code it in another way? -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Hi, yes i know that but when i have a required section over the "Carpenter" section for example it wont work because in the nav section i have like <?php $page = $pages->get("/misc/footer/");?> dont mind that it is footer in the nav its because i want to have the same navigation as in the footer copied. But that code makes it so that the carpenter section fail. -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
-
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Ok thanks i will try to have a look at that and try to figure out how to make it work. Regarding the structure and the servicearea file. This is the servicearea.php code <!doctype html> <html lang="en"> <head> <?php require("assets/misc/meta/meta.php"); require("assets/misc/scripts/scripts.php"); ?> <link rel="stylesheet" href="<?php echo AIOM::CSS(array('css/hover.css', 'css/animate.min.css')); ?>"> <link rel="stylesheet" href="<?=$config->urls->templates;?>css/nav_start.css"> <script src="<?php echo AIOM::JS(array('js/scrolla.js', 'js/scrollme.js', 'js/smoothscroll.js')); ?>"></script> </head> <body class="pagetransition"> <?php require('assets/misc/nav/nav.php'); require('assets/servicearea/subheader/subheader.php'); require('assets/servicearea/section1/section1.php'); require('assets/start/section5/section5.php'); require('assets/misc/footer/footer.php'); ?> </body> </html> The required files is sections of the page. require('assets/misc/nav/nav.php'); require('assets/start/section5/section5.php'); require('assets/misc/footer/footer.php'); these files are on every page /subpage on the whole site. require('assets/servicearea/subheader/subheader.php'); require('assets/servicearea/section1/section1.php'); And this is where i want to change the content depending on what page/url im on. example ( require('assets/servicearea/section1/section1.php');) <div class="subpage_section1"> <div class="container"> <div class="row"> <?php require('assets/servicearea/sidemenu/sidemenu.php'); ?> <?php $page = $pages->get('template=servicearea');?> <div class="col-12 col-sm-12 col-md-9 col-lg-8 col-xl-8"> <div class="introduction bmar2"><?=$page3->introduction;?></div> <?=$page3->textarea;?> </div> </div> </div> </div> I dont know if you also working with include/required files but in the browser all required files are then displayed next to each other if you look at the page code. As you can se <?php $page = $pages->get('template=servicearea');?> will output only the first of my 6 different pages in PW (different urls) different content same template (servicearea.php). I want each pages in pw display the correct content for the page etc. Hope the was more helpful. Thanks for the help so far. -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
<?php foreach($pages->find('template=nav') as $page):?> <nav class="navbar fixed-top"> <a href="<?php echo $pages->get('/')->url;?>"><img src="<?=$config->urls->templates;?>img/logo_black_purple.svg" alt="logo" title="logo" class="navbar_brand"></a> <div class="navbar_menu_wrapper"> <?php foreach($page->navlinks as $item) { echo "<a href='$item->url' class='black navbar_links'>$item->title</a>"; } ?> <div class="navbar_vertical_line"></div> <div class="navbar_language_wrapper"> <select onchange='window.location=$(this).val();'> <?php foreach ($languages as $language) { $selected = ''; // if this page isn't viewable (active) for the language, skip it if ( !$page->viewable( $language ) ) continue; // if language is current user's language, make it selected if ( $user->language->id == $language->id )$selected = " selected=selected"; // determine the "local" URL for this language $url = $page->localUrl( $language ); // output the option tag echo "<option$selected value='$url'> {$language->language_icon} $language->title </option>"; } ?> </select> </div> <div class="navbar_vertical_line"></div> <div class="navbar_hamburgermenu_wrapper"> <div class="navbar_hamburgermenutext uppercase"> <?=$fields->get('menutext')->$label;?> </div> <div class="ham-bg"> <div class="button_container" id="toggle"> <span class="top"></span> <span class="middle"></span> <span class="bottom"></span> </div> <div class="overlay" id="overlay"> <div class="overlay-menu container-fluid"> <div class="navrow"> <div class="navmenu-col col-12"> <div class="container"> <div class="row"> <?php $page = $pages->get("/misc/footer/");?> <?php foreach($page->navigation as $page ): ?> <div class="col-12 col-sm-6 col-md-3 col-lg-2 col-xl-2"> <ul> <div class="bold purple bmar2 h5"> <?=$page->heading;?> </div> <?php foreach($page->navlinks as $item) { echo "<li class='footer_links_selected'><a href='$item->url' class='black footer_links '>$item->title</a></li>"; } ?> </ul> </div> <?php endforeach;?> <?php $page = $pages->get("/misc/footer/");?> <div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-4 text-right"> <div class="footer_phone"> <?=$page->phone;?> </div> <div class="footer_email"> <?=$page->email;?> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </nav> <?php endforeach;?> <link rel="stylesheet" href="<?=$config->urls->templates;?>css/megamenu.css"> <script src="<?=$config->urls->templates;?>js/megamenu.js"></script> This is nav.php that is on top of the servicearea.php in the structure. This is servicearea.php that is the template file in pw <div class="subpage_section1"> <div class="container"> <div class="row"> <?php require('assets/servicearea/sidemenu/sidemenu.php'); ?> <?php $page = $pages->get("template=servicearea"); ?> <div class="col-12 col-sm-12 col-md-9 col-lg-8 col-xl-8"> <div class="introduction bmar2"><?=$page->introduction;?></div> <?=$page->textarea;?> </div> </div> </div> </div> -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
<?php $page = $pages->get("template=servicearea"); ?> I´d tried with this code but then it only displays like the first page of the 6 on all different URLs -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
<div class="container"> <div class="row"> <?php $page = $pages->get("/misc/footer/");?> <?php foreach($page->navigation as $page ): ?> <div class="col-12 col-sm-6 col-md-3 col-lg-2 col-xl-2"> <ul> <div class="bold purple bmar2 h5"> <?=$page->heading;?> </div> <?php foreach($page->navlinks as $item) { echo "<li class='footer_links_selected'><a href='$item->url' class='black footer_links '>$item->title</a></li>"; } ?> </ul> </div> <?php endforeach;?> <?php endforeach;?> <?php $page = $pages->get("/misc/footer/");?> <div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-4 text-right"> <div class="footer_phone"> <?=$page->phone;?> </div> <div class="footer_email"> <?=$page->email;?> </div> <?php?> </div> </div> </div> For example this is the end of nav.php. misc/footer is just a dropdown copied from the footer if you wonder.. But this is why servicearea.php doesent work like it should. Because i have to specify at servicearea.php that the content should be there from one of the 6 pages in pw. -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Ok i will be more specific. This is my structure of the tempate file. <body class="pagetransition"> <?php require('assets/misc/nav/nav.php'); require('assets/servicearea/subheader/subheader.php'); require('assets/servicearea/section1/section1.php'); require('assets/start/section5/section5.php'); require('assets/misc/footer/footer.php'); ?> </body> as you can see i have 2 files that handles different content. The template name in PW is "servicearea". Because i have other sections/files required and those i have other template names attached to. Like for nav.php i have in the beginning "<?php foreach($pages->find('template=nav') as $page1):?>" etc. Hope that was more info for you /thanks again for the help. -
Need help to output flag icon in drop down (multi language)
Flashmaster82 replied to Flashmaster82's topic in General Support
Ok i will try to find something else that works like you sad with some js plugin. Thanks for explaining and helping though. But from one to the other, i have a totally different question that bothers me right now. can you please help. I have 1 template file that will be base for 6 different pages but the same layout. I dont know how to begin the php file to display each pages with its content. This is how i use to start my files/sections with, but then its only for one page and the same content. <?php $page = $pages->get("/start/section1/");?> <h2 class="h6"><?=$page->phone;?></h2> I´d tried with some other code can´t remember but it displayed all the pages at the same page below each other. I know this maybe is some basic stuff but im lost. Please help...