Jump to content

How can i integrate HTML Kickstarter with processwire?


siulynot
 Share

Recommended Posts

Thanks Joss,

What I have actually ended up doing is using the example.html file from KS as a starting point and using that as my main.inc and everything is working beautifully :)

I guess Ryan's example was before some significant KS changes.

Link to comment
Share on other sites

  • 1 year later...

Hello,

Can someone tell me how to add/prepend the homepage link to this code from Ryan's html-kickstart-processwire archive/profile? Thanks in advance :).

<!-- Menu Horizontal -->
<ul class="menu"><?php

    function topMenu($currentPage, $startPage) {
        $out = '';
        foreach($startPage->children as $page) {
            $class = '';
            if($currentPage->id == $page->id) $class =  " class='current'";
            $out .= "<li$class><a href='$page->url'>$page->title</a>";    
            if(count($page->children)) {
                $out .= "<ul>" . topMenu($currentPage, $page, $level+1) . "</ul>";
            }
            $out .= "</li>";
        }
        return $out;
    }

    echo topMenu($page, $pages->get('/'));

?></ul>

Link to comment
Share on other sites

Hello,

Can someone tell me how to add/prepend the homepage link to this code from Ryan's html-kickstart-processwire archive/profile? Thanks in advance :).

<!-- Menu Horizontal -->

<ul class="menu"><?php

    function topMenu($currentPage, $startPage) {

        $out = '';

        foreach($startPage->children as $page) {

            $class = '';

            if($currentPage->id == $page->id) $class =  " class='current'";

            $out .= "<li$class><a href='$page->url'>$page->title</a>";    

            if(count($page->children)) {

                $out .= "<ul>" . topMenu($currentPage, $page, $level+1) . "</ul>";

            }

            $out .= "</li>";

        }

        return $out;

    }

    echo topMenu($page, $pages->get('/'));

?></ul>

Add this:

<ul class="menu">

<li><a href="<?=$config->urls->root?>">Home</a></li>

<?php ...

or use this: 

http://modules.processwire.com/modules/markup-simple-navigation/

  • Like 2
Link to comment
Share on other sites

I think I wasn't trying to find the simplest way :).

I also remember having seen that piece of code in the API but surely haven't inserted it the right way and/or to the right place at that moment.

I've done this now: <li><a href="<?=$config->urls->root?>"><?=$pages->get('/')->title?></a></li>

Thank you again Joshua :)!

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...