Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple page in template / Content Slider theme
#12
n00dles101,

By searching the WIKI, the definition of the "GetChildren" I arrived on the "config: caching". I discover features! What was I thinking? Why I switched besides that?

Anyway ... THANK YOU!

I managed to implement the "getpagecontent" the way I wanted except for one detail:
When I used your code, I did not differentiate on the "menuOrder". So I'm going directly into my XML files. Surprise! Only the "home" has this field, it does not appear in the other pages!

To make this work so I had to improvise, here is my code:

Code:
$pages=getChildren('index');
    $mypageArray=array();
    foreach ($pages as $page){
        $mypageArray[(string)$page]['menuOrder']=returnPageField($page,'submenuorder');
        $mypageArray[(string)$page]['url']=returnPageField($page,'slug');
    }
    $pages= sort2d($mypageArray,'menuOrder','desc', FALSE);

    foreach ($pages as $page){
        $content=returnPageContent($page['url']);
        // you can use returnPageContent if your not going to need any other fields...
       if ($page['url']=='home'){
            echo '<div id="'.$page['url'].'"';
            echo ' class="content">';
            echo '<h1>'.$page['title'].'</h1>';
            echo $content;
            echo '</div>';
        }else{
            echo '<div id="'.$page['url'].'"';
            echo ' class="panel">';
            echo '<div class="content">';
            echo '<h1>'.$page['title'].'</h1>';
            echo $content;
            echo '</div></div>';
        }
        // echo your output in DIVs or whatever here...
    }

So I set up a condition in order to have the main page (here "home") with the class "content" and other pages with the class "panel". This works, but if main page isn't named "home" it doesn't work!

The interest of field "menuOrder" is precisely to differentiate the pages as normally the main page will be in first position.

I don't understand why I didn't enter anything in all my pages (only in "home" XML, menuOrder set to 0)?!
Reply


Messages In This Thread
Multiple page in template / Content Slider theme - by didou038 - 2012-04-07, 07:13:25



Users browsing this thread: 1 Guest(s)