Just thought of something: I would like to make URLs optional. I set up an if-else statement to direct it to a different template by name like this:
return $sCss . $this->_oTemplate->parseHtmlByTemplateName('unit', $aVariables);
versus
return $sCss . $this->_oTemplate->parseHtmlByTemplateName('unitnolink', $aVariables);
And now have two template files (unit.html and unitnolink.html) -- one return is called if the URL value is empty and the other is called if it has something in it (a link). Does that look right? The whole code snippet is here:
$sUnitText = process_text_output($oQuoteUnit['Text']);
$sUnitAuthor = process_line_output($oQuoteUnit['Author']);
$sUnitAuthorURL = process_line_output($oQuoteUnit['AuthorURL']);
if ($sUnitAuthorURL != "") { // there's a link
$aVariables = array (
'unit_text' => $sUnitText,
'author' => $sUnitAuthor,
'authorurl' => $sUnitAuthorURL
);
$sCss = $this->_oTemplate->addCss('unit.css', true);
return $sCss . $this->_oTemplate->parseHtmlByTemplateName('unit', $aVariables);
} else { // no link
$aVariables = array (
'unit_text' => $sUnitText,
'author' => $sUnitAuthor
);
$sCss = $this->_oTemplate->addCss('unit.css', true);
return $sCss . $this->_oTemplate->parseHtmlByTemplateName('unitnolink', $aVariables);
}
However that seems to have succeeded in only showing NO quotes. The template files have only this in them:
unit.html
<div class="quote_div">
<div class="daily_quotes">
<i>"__unit_text__"</i><br />
<p class="author"><a href=__authorurl__>__author__</a></p>
</div>
<div class="clear_both"></div>
</div>
and
unitnolink.html
<div class="quote_div">
<div class="daily_quotes">
<i>"__unit_text__"</i><br />
<p class="author">__author__</p>
</div>
<div class="clear_both"></div>
</div>
Ideas on what I'm doing wrong?