GetSimple Support Forum

Full Version: get_page_content(FALSE)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need a function which returns whether the page has content or not. So i modified the function get_page_content() in this way

PHP Code:
function get_page_content($echo true) {
    global 
$content;
    
exec_action('content-top');
    
$content strip_decode($content);
    
$content exec_filter('content',$content);
    if(
getDef('GSCONTENTSTRIP',true)) $content strip_content($content);
    if (
$echo) {
        echo 
$content;
    } else {
        return 
$content;
    }
    
exec_action('content-bottom');

Can you include it in the core so that it can be called by get_page_content(FALSE)?

Thx

Alex
Hi Alexander,

Thank you for showing your php code in this new use of the function get_page_content()

I think it would be better not to change anything in the GS core for maximum GS portability.

We can always write our own customized functions and put them inside
/theme/your_theme/functions.php

Grts,
F.
(2019-10-23, 23:15:15)Felix Wrote: [ -> ]I think it would be better not to change anything in the GS core for maximum GS portability.

So do I - therefore i asked to include it in the GS core on next update :-)

Alex
you can get page contents to put into a variable for testing and process without echoing it,using the function
returnPageContent()
PHP Code:
$stuff=returnPageContent('page_slug'); 
does this do what you want ?

lesh