Issue In Creating New Page Template in OSSN Premium Version 4.3.1

Ashwin Shahi Posted in Component Development 7 years ago

Hello , i am working on a custom component where i want a new page , but that's not happening for me.

The code for the same is :

define('__OSSN_POSTVERIFICATION__', ossn_route()->com . 'OssnPostverification/');
require_once(__OSSN_POSTVERIFICATION__ . 'classes/OssnPostverification.php');
/**
 * Initialize Ossn Postverification Component
 *
 * @return void
 * @access private
 */
function ossn_postverification() {
    ossn_register_com_panel('OssnPostverification', 'settings');
    if(ossn_isAdminLoggedin()) {
        ossn_register_action('user/post/verification', __OSSN_POSTVERIFICATION__ . 'actions/user/post/verification.php');
        ossn_register_page('post_verification','ossn_post_verification_page');
    }
}

function ossn_post_verification_page(){
    header('Content-Type: application/json');
    $title = ossn_print('Post Verification');
    $contents = array('content' => ossn_plugin_view('pages/view', $contents),$param);
    $content = ossn_set_page_layout('newsfeed', $contents);
    echo ossn_view_page($title, $content);
}

ossn_register_callback('ossn', 'init', 'ossn_postverification');
Replies
in Ashwin Shahi Replied 7 years ago

Thank you Arsalan,

We have started to work with OSSN and will keep that noted in future not to use the native naming conventions

Thanks

Indonesian Arsalan Shah Replied 7 years ago

The reason is because you are doing it wrong in page function.
Create a a file OssnPostverification/plugins/default/postverification/pages/view.php and place contents in file called view.php replace your ossn_post_verification_page() from ossn_com.php with new one below:

function ossn_post_verification_page(){
    $title = 'Post Verification';
    $content = ossn_set_page_layout('newsfeed',  array(
                  'content' => ossn_plugin_view('postverification/pages/view')
    ));
    echo ossn_view_page($title, $content);
}

Further see this : https://www.opensource-socialnetwork.org/wiki/view/909/naming-convention-for-creating-themes your naming of component is violating the component development standards.