Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can one page gets content dynamically from others?
#1
Hello. I have site in PHP and try to move it to GS.

My index.php founds files and adds content from them to itself:
<?php
$files = glob( 'tariffs/tariff*.php' );
foreach( $files as $file ) {
include( $file );
echo $tariff_about;
}
;?>

But in GetSimple there is no separate *.php files as I add content to GS, so I cant use this peace of code.

I want to know is there a way to create same behaviour with GS? I mean that main page dynamically is being got content from some pages (I found a plugin here to add custom page types).
Reply
#2
Of course there is! GS operates on xml files, thus you have to use appropriate methods to work on them.
Search for excerpt plugin in extend and look into its source code. It will give you an insight of how to work with GS xml content files.

Mayb in GS wiki you will find something useful too.
Addons: blue business theme, Online Visitors, Notepad
Reply
#3
You could do something like this
Code:
<?php $items = getChildren(return_page_slug());?>
            
                <?php foreach($items as $item): ?>    
                     <div class="col">
                     <?php echoPageContent($item); ?>
                    </div>
                <?php endforeach;?>

Create the pages that you want to include on your main page as child pages and the above code will display the child page content in the main page.

You could also install the Custom Fields plugin and pull only certain fields using
Code:
<?php echoPageField($item, CUSTOMFIELD); ?>
Reply
#4
jay_m Wrote:You could do something like this…
Thanks a lot, I'll try.
Reply




Users browsing this thread: 1 Guest(s)