Jump to content
August

Use functionalities of skyscraper in Regular Profile

Recommended Posts

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 ...

image.thumb.png.b6de32fad373148bf2374272475458cd.pngimage.png.22e7ec04f3369e3ea257a01a9d3c2162.png

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:

image.png.9b906c056f0bd3eab03093e219fe66dd.png

 

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!

 

Share this post


Link to post
Share on other sites

Try adding: 

<?php namespace ProcessWire; ?>

To the top of the file where that function is used and defined. 

Share this post


Link to post
Share on other sites
			<?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>

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...