Hello Guest
No Avatar
Sign In to Remove
Posts: 
17
Reputation: 
3
Posted: April 17, 2013, 11:21 PM  -- Last Edit: April 18, 2013, 2:48 AM by MLM
  • Group: Member
Hi,

Would it be possible to create a custom page based on the Vertex Theme as I would like to create a page separate from the forum with different things on
Posts: 
400
Reputation: 
20
Posted: April 18, 2013, 2:47 AM  -- Last Edit: April 18, 2013, 2:49 AM by MLM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Great Question, I have done a lot of this but there is very few topics on the issue. This will work with any theme and even adapt to the theme chosen. This is the basic concept of SMF's SSI system.

Use the attached file for in depth instructions and template file!

but if your lazy... Here is a basic template page:
Code: [Select]
<?php

// What action/tab do you want to show active?
$_GET['action'] = 'custompage';

// Set the banning active
$ssi_ban true;

// Path to SSI.php
require('forums/SSI.php');
writeLog();

// Page title. This will appear in the browser
$context['page_title_html_safe'] = 'Page Title';

// This is self explanatory
template_header(); 

// Here we define the link tree
$context['linktree'] = array(
'href' => $scripturl,
);


// All your content below this:
echo '
Heya, I\'m a custom page.
'
;


// no displayable content should be below the footer...
// This is self explanatory too.   
template_footer(); 

?>


Instructions:
  • Change $_GET['action'] in this file to something unique and desciptive to the page (lets call this {action})
  • Change $context['page_title_html_safe']  in this file to the title that appears in the tab
  • Add your content below the comment in this file
  • In your-theme/languages/index.english.php add $txt['{action}'] = 'Actual text you want to show up here.';
  • In your-theme/languages/Who.english.php add $txt['whoall_{action}'] = 'Viewing that custom page';
  • Upload this file wherever you want it. Ex. Change to index.php and make a folder along side your forums folder called {action}

Optional Instructions: Add to the nav bar
  • Open up Sources/Subs.php
  • Find $buttons = array(
  • Add a element to the array using this template
Code: [Select]
'{action}' => array(
'title' => $txt['{action}'], // Text of nav bar item
'href' => $scripturl, // Link to your custom page so you might need to change...
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),

If you are using $_GET variables on that page to show different content. Ex. /about/?about=yourmom
The nav item will not be active if you do so use this trick:

Find:
Code: [Select]
// Default to home.
$current_action

Add Below:
Code: [Select]
if (!empty($_GET['{action}']))
{
$current_action = '{action}';
}
<3 Nerve, Sk8, Labradoodle, Austin