• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] How to create a custom page?

Started by hamnawa,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hamnawaTopic starter

Hello,

Could you guys please explain how to create an empty page int he new version?
  •  

Marius P.

Here is a very fast structure :

Create a file com/com_mypage.php
<?php 
//Page title
function modify_title( $text ) {
 return 'This is my title';
}

//Page content
function modify_content( ) {
$text = '<h1>This is a heading</h1>';
$text = .'<h2>This is a heading</h2>';
$text = .'<p>This is the content</p>';
return $text;
}

add_filter( 'phpvibe_title', 'modify_title' );
add_filter( 'the_defaults', 'modify_content' );
//Time for design
 the_header();
include_once(TPL.'/default.php');
the_footer();
?>



Open index.php (main/root one):


find:


case "register":
      $com_route = ABSPATH."/com/com_register.php";      
      break;



after add


case "mypage":
      $com_route = ABSPATH."/com/com_mypage.php";      
      break;



This small example should be seen at {your-site-url}/mypage/


This is just a small code example, you can change it to fit your needs.


I'm adding a dynamic pages engine to 3.4
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

vingar

I have a problem with latest beta, this hack dont work, any suggest?
  •  

PHPVibe A.

You don't need this hack, now you can create pages from the admin panel, this was written 1 year ago.

vingar

thanks, but my problem is insert a php code with div etc, the page change my code. how can i solved this problem?
  •  

PHPVibe A.

You can't insert php code, if you wish to add html use the "source" on the editor.

zeepakos

Hello alexander i followed all these rules i created this file on com/com_mypage.php and next what i need to do i find in all sides but not able to search index.php where i need to put this code -- > case "mypage":
      $com_route = ABSPATH."/com/com_mypage.php";     
      break;
please help me Thanks.
  •  

Similar topics (7)