Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter
Powered by Vanilla. Made with Bootstrap.
Theme built by Kasper Kronborg Isager
using feindura on a single page layout
  • Hello and thanks for this great system.
    i have to mantion first that im not very strong in PHP coading :)
    my question is : how can i use this system on a single page website layout? (such as a jquery-mobile site)
    what i'm interested in is sevral content areas on the same index.php doc. that each one has a separate page on feindura.
    thank you,
    ofer ziv
  • simple, you just can call the showPage method and give it an id of the pages like.
    <div class="row1">
    <?php
    $page = $feindura->showPage(1);
    echo $page['content'];
    ?>
    </div>
     
    <div class="row2">
    <?php
    $page = $feindura->showPage(2);
    echo $page['content'];
    ?>
    </div>
     
    <div class="row3">
    <?php
    $page = $feindura->showPage(3);
    echo $page['content'];
    ?>
    </div>
     
    <div class="row4">
    <?php
    $page = $feindura->showPage(4);
    echo $page['content'];
    ?>
    </div>

    But when you want to be able to add pages in the backend, so that they show up in the frontend automatically you have to do it like this:
    <?php
     
    $pages = $feindura->listPages('category',0); // 0 for the non category, change it if you need to
     
    $count = 1;
    foreach($pages as $page) {
    echo '<div class="row'.$count++.'">';
    echo $page['content'];
    echo '</div>';
    }
     
    ?>

    Note that the class="row1" etc are just inveted by me, so change it to what ever class you use.

    hope that helps.
  • WOW, that was quick. thanks a million!
    i think the first solution is good enough for me.
    i dont need the client to create new pages, just to edit the existing ones.
    thanks again :)
  • no problem.
    but the second one is more elegant :)