August Posted November 18, 2019 Share Posted November 18, 2019 I play around with it a bit because I think it's possible. So one Site -Setup for Regular and Skyscraper (from https://github.com/dadish/pw-skyscrapers-profile). After that I merged some things. On the 3rd Site I put in everything, adjusted the pages, especially the _init.php to include the _func.php, search etc. After that, the regular Profile is working fine, the search-forms are shown and a few additional cities are available (just Testing). The first try to list all available cities ends with an error on count, which I solved like here: Now I get the following Errors, I would be very happy if you could help me on the jumps, getting further ... cities-list (template) looks like that: <?php foreach($items as $item): ?> <li><a href='<?=$item->url?>'><?=$item->title?></a> <small class='uk-text-muted'><?=$item->numChildren?></small></li> <?php endforeach; ?> A Tick on List All: And code within other templates - like in the following snippet, works fine .. <p>Test: <?php $prefix = $itemList = ''; foreach(page()->set_test as $item) { $itemList .= $prefix . $item->title; $prefix = ', '; } echo $itemList; /* getting id - only <?=page()->set_test?> */ ?> </p> ProcessWire 3.0.123 in usage.. Thanks on any hint! Link to comment Share on other sites More sharing options...
elabx Posted November 18, 2019 Share Posted November 18, 2019 Try adding: <?php namespace ProcessWire; ?> To the top of the file where that function is used and defined. Link to comment Share on other sites More sharing options...
August Posted November 18, 2019 Author Share Posted November 18, 2019 <?php// include_once("./browse.php"); /* if I uncomment these include, the items (cities) are not shown ..*/?> <?php echo region('mainHeader'); ?> <div class=''> <div id='content' class=''> <?php echo region('content'); ?> </div> <div id='sidebar' class=''> <?php echo region('sidebarHeader'); include("./includes/search-form.php"); echo region('sidebar'); include("./includes/sidebar-links.php"); ?> </div> </div> Hi elabx, of course, I checked the files for the pw-namespace. Thank you. In the _main.php I mix: <nav id='masthead-navbar' class="uk-navbar-container" uk-navbar> <div class="uk-navbar-center uk-visible@m"> <?=ukNavbarNav($home->and($home->children), [ 'dropdown' => [ 'basic-page', 'categories' ] ])?> </div> </nav> together with <?php// include_once("./browse.php"); /* if I uncomment these snippet, the items (cities) are not shown */?> <?php echo region('mainHeader'); ?> <div class=''> <div id='content' class=''> <?php echo region('content'); ?> </div> <div id='sidebar' class=''> <?php echo region('sidebarHeader'); include("./includes/search-form.php"); echo region('sidebar'); include("./includes/sidebar-links.php"); ?> </div> </div> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now