GetSimple Support Forum
Plugin shortcodes problem - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8)
+--- Thread: Plugin shortcodes problem (/showthread.php?tid=3402)



Plugin shortcodes problem - bogyvet - 2012-08-05

I'm finish TIDEngine News/Blog Version 2.0. But......

Just one more problem that I can not solve. No idea. I add shortcodes and you can use PHP functions to add menus etc.

eg.
Code:
<?php tide_news_breadcrumbs(); ?>

Code:
{%{TIDE_BREADCRUMBS}%}

I use this function:

Code:
if ($general_settings['shortcodes_use'] == 'checked') {
        add_filter('content', 'tide_shortcodes');
    } else {
        add_filter('content', 'tide_evaluate_php');
    }
When I add shortcodes to page Shortcodes are working. When I add them to theme.php nothing happened.
In other hand when I call function from template everything is OK.

When I output content I get just page content not whole page.

I try with index-pretemplate and index-posttemplate, nothing happeneds.

Thanks in advance.


I get this solution, not the best I must change core (index.php)

Code:
ob_start();
# include the template and template file set within theme.php and each page
if ( (!file_exists(GSTHEMESPATH .$TEMPLATE."/".$template_file)) || ($template_file == '') ) { $template_file = "template.php"; }

include(GSTHEMESPATH .$TEMPLATE."/".$template_file);
$data = ob_get_contents();
ob_clean();
exec_filter('page-content', $data);

And I call function :
Code:
add_filter('page-content', 'FUNCTION_TO_CALL');

I think this is cleanest solution, and could be implemented in core. In this way and caching system can be implemented. And base functionality is not changed.