[Phplib-users] Template Bugs..
Brought to you by:
nhruby,
richardarcher
|
From: Mike G. <mi...@op...> - 2002-05-13 19:36:31
|
Hello,
I'm working on migrating Back-End (a CMS that presently uses just the
templates.inc file from phplib) and have it use much more of phplib's
functionality.. It's heavily based on the work of the phpSlash team at
the moment..
Unfortunately I'm having a bit of a problem with the template.inc
file.. Not sure if it is something specifically with phplib-7.4-pre1 or
not, but thought I would bring it to the list to see if I've messed up
somewhere or if this is a bug..
The problem is essentially that dynamic content of blocks seems to be
occurring in the wrong order.
For example this simple template:
<!-- START OF TEMPLATED DISPLAY STORY be_sidebarArticleLinks.tpl -->
<!-- BEGIN link_row -->
<LI>{SIDEBAR_LINKS}
<!-- END link_row -->
<!-- END OF TEMPLATED DISPLAY STORY be_sidebarArticleLinks.tpl -->
Should produce something like this:
<!-- START OF TEMPLATED DISPLAY STORY be_sidebarArticleLinks.tpl -->
<li><a
HREF='http://office.openconcept.ca/be5/public_html/main_file.php3/62/'>Lots of Features Here!</a>
<li><a
HREF='http://office.openconcept.ca/be5/public_html/main_file.php3/81/'>uu r title</a>
<!-- END OF TEMPLATED DISPLAY STORY be_sidebarArticleLinks.tpl -->
But instead I'm getting a response like this:
<!-- START OF TEMPLATED DISPLAY STORY be_sidebarArticleLinks.tpl -->
<!-- END OF TEMPLATED DISPLAY STORY be_sidebarArticleLinks.tpl -->
<li><a
HREF='http://office.openconcept.ca/be5/public_html/main_file.php3/62/'>Lots of Features Here!</a>
<li><a
HREF='http://office.openconcept.ca/be5/public_html/main_file.php3/81/'>uu r title</a>
I'm not sure why this is happening.. Isn't really critical here, but
quite messes up lists and tables..
Also, it's frustrating that I can't seem to place elements behind the
dynamic text (though I know it is possible)..
This is all within a class, but the related function is:
/* Returns the HTML for the Spotlight Articles */
function getSpotlightArticles($mode) {
global $_PSL, $_BE;
$template = "sidebarLinks";
$this->template->set_block($template,"link_row","link_rows");
if ($mode=='full') {
$argv_ary['fields'] = ' main.articleID, main.URLname,
main.hitCounter, text.title, text.blerb ';
} else {
$argv_ary['fields'] = ' main.articleID, main.URLname, text.title
';
}
$argv_ary['conditions'] = " WHERE main.hide='0' AND main.spotlight =
'1' ";
$order='date';
$spotlight_ary = $this->extractArticles($argv_ary,$order, '');
for ($ii = '0' ; $ii < count($spotlight_ary) ; $ii++) {
if(empty($spotlight_ary[$ii]['URLname']))
$spotlight_ary[$ii]['URLname'] = $spotlight_ary[$ii]['articleID'];
$spotlightArticles = "<A HREF='" . $_PSL['rooturl'] . "/" .
$_BE['main_file'] . "/" . $spotlight_ary[$ii]['URLname']. "/'>" .
$spotlight_ary[$ii]['title'] . "</A>";
$this->template->set_var(array( 'SIDEBAR_LINKS' =>
$spotlightArticles ));
$this->template->parse($template, "link_row", true);
}
$this->template->parse('SIDBAR', $template);
$articleLinks = $this->template->get('SIDBAR');
return $articleLinks;
}
Any suggestions on this would be appreciated..
Mike
--
Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca
Open Source Web Applications for Social Change
New Site Launched: http://www.patmartin.org/
War is a poor chisel to carve out tomorrows. ML King, Jr.
|