Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by bck2sqr1

  1. Thanks for the suggestion! Took a little tweaking but I got it to work! Cheers! $t1 = $pages->get("roles=t1"); if($user->hasRole("t1")){ $posts = wire("pages")->find("template=form_entries,created_users_id=$t1,include=hidden"); }
  2. I'm still a bit of a PHP newbie so bear with me....I currently have roles setup for "Region Managers" and "Teams" for my front-end. Is there a way for me populate a list of pages made by multiple users with the same role? For ex, if Johnny and Ted have the role "T1", I want them to only see pages created with that role. Then for the "Region Managers", I want them to see all pages created with the roles "T1", "T2", "T3" etc. I was hoping there was a command like "created_users_roles" but alas...so I tried something like this and of course it didn't work... if($user->hasRole("region-manager")){$posts = $pages->find("template=form_entries,roles=t1,include=hidden");} if($user->hasRole("t1")){$posts = $pages->find("template=form_entries,roles='t1',include=hidden");} Thanks for any help you might be able to give me.
  3. I've doubled up on javascripts and apparently it's causing an issue. I recently started working on an interactive map on my site, the problem is that since I'm rendering the HTML on an event (click of the state loads .html(<div>...john@email.com...) ), it's loading the replacement text instead of my email addresses. Are there any steps I can take to make it work properly without blocking the template altogether?
  4. That was it! Seems like it's always something easy like that after I've spent hours trying to troubleshoot Thanks a bunch!
  5. I have a site with a main nav bar, on subpages I have a subnav loading up below the main nav bar. The problem I'm running into is on the subpages the active nav command isn't working on the subnav items (the main nav is staying active so I got that going for me). I assume the $page->parent->children hierarchy in the PHP is confusing the command, and this is where I'm running into a wall. Functions file code: function renderSubNav($children) { echo "<div id='subnav'>"; foreach($children as $child) { $classy = $child === $page ? " class='current'" : ''; echo "<a$classy href='{$child->url}'>{$child->title}</a>"; } echo "</div>"; } PHP file code: echo <div id='subnavitems' align='right' valign='top'>"; if(count($page->parents) == 0 && $page->numChildren > 0 && $page->template != "254_home") echo renderSubNav($page->children); if(count($page->parents) == 1 && $page->numChildren > 0 && $page->template != "254_products") echo renderSubNav($page->children); if(count($page->parents) == 2 && $page->template != "254_products") echo renderSubNav($page->parent->children); if(count($page->parents) == 3 && $page->template != "254_products") echo renderSubNav($page->parent->parent->children); echo "</div>"; Any help would be appreciated!
  • Create New...