PDA

View Full Version : Created new page ... How do I get the footer in it?


kkinsey
02-28-2012, 05:14 PM
Hello,

I'm sorry if this is a FAQ. I've searched a bit and haven't been able to glean an answer from what I've read.

Per management, I've added a new page to a development site. Everything looks great, but the page isn't rendering a footer when displayed.

Here's my render code, including a recent attempt to force a footer to show up...
$navbits = construct_navbits($navbits);
$navbar = render_navbar_template($navbits);
$templater = vB_Template::create('kdk_pfs');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('checked', $checked);
print_output($templater->render());

// Can't get the footer to show!! This apparently will NOT work:
$myfooter = vB_Template::create('footer');
$myfooter->register_page_templates();
print_output($myfooter->render());If you're experienced w/hacking vB, you can probably tell that I'm clueless. I don't see any logic in content.php, forum.php, etc. regarding the footer, so I'm left at this point to conclude it's Magic(tm). Any thoughts?

I welcome any assistance anyone can offer (apart from suggestions about job hunting :D ) - thanks! :)

Lynne
02-28-2012, 05:43 PM
REmove this stuff:
// Can't get the footer to show!! This apparently will NOT work:
$myfooter = vB_Template::create('footer');
$myfooter->register_page_templates();
print_output($myfooter->render());

You've already output the page here:
print_output($templater->render());

Did you require_once the global.php page? If so, your register_page_templates should be rendering the footer (and header and headinclude and headinclude_bottom)

If it's not showing, then perhaps you have some error in it somewhere.

kkinsey
02-28-2012, 06:02 PM
Yes, global.php is required, and we get past that point.

And no lint issues:

$php -l pfs.php
No syntax errors detected in pfs.php

I will check the server logs, though --- thanks.

--------------- Added 1330456767 at 1330456767 ---------------

Nothing in the logs. I can workaround this by pasting the footer template code in the template I'm calling for my new page, but it feels so dirty :erm:

I'll be making one more page/script tomorrow (or perhaps I'll be able to start later today). I'll post if I can make anymore headway. :)

--------------- Added 1330456922 at 1330456922 ---------------

If it's not showing, then perhaps you have some error in it somewhere.
Doesn't seem to be an error in the footer, as it works elsewhere throughout the site. But thanks anyway.....

Sarteck
02-28-2012, 09:12 PM
kkinsey, this might be a stupid thing to ask, but are you certain you have a {vb:raw footer} bit in your template?



Here's what I use as a "generic" template, in cae it might help:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">


<head>
{vb:raw headinclude}
<title>{vb:raw vboptions.bbtitle}<vb:if condition="$pagetitle"> :: {vb:raw pagetitle}</vb:if></title>
<vb:if condition="$show['sidebar']">
<script type="text/javascript" src="{vb:stylevar yuipath}/animation/animation-min.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
var sidebar_align = '<vb:if condition="$vboptions['sidebarposition'] == 0">left<vb:else />right</vb:if>';
var content_container_margin = parseInt('{vb:math {vb:stylevar forum_sidebar_width}+{vb:math {vb:stylevar padding}*2}}');
var sidebar_width = parseInt('{vb:stylevar forum_sidebar_width}');
</script>
<script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-sidebar.js?v={vb:raw vboptions.simpleversion}"></script>
</vb:if>

{vb:raw headinclude_bottom}



</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="pagetitle">
<h1>{vb:raw vboptions.bbtitle}</h1>
<p id="welcomemessage" class="description">{vb:rawphrase welcome_to_the_x, {vb:raw vboptions.bbtitle}}</p>
</div>
<vb:if condition="$show['sidebar']">
<div id="content_container"<vb:if condition="$vboptions['sidebarposition'] == 0"> class="contentright"</vb:if>>
<div id="content">
</vb:if>








<!-- main -->
{vb:raw main}
<!-- /main -->










<vb:if condition="$show['sidebar']">
</div>
</div>
<div id="sidebar_container"<vb:if condition="$vboptions['sidebarposition'] == 0"> class="sidebarleft"</vb:if>>
<a id="sidebar_button_link" href="#">
<vb:if condition="$vboptions['sidebarposition'] == 0">
<img id="sidebar_button" src="{vb:stylevar imgdir_misc}/tab-collapsed-left.png" alt="" />
<vb:else />
<img id="sidebar_button" src="{vb:stylevar imgdir_misc}/tab-collapsed.png" alt="" />
</vb:if>
</a>
<ul id="sidebar">
{vb:raw sidebar}
</ul>
</div>
</vb:if>


{vb:raw footer}
</body>
</html>