//define place holders $buyOnline=''; //-- fetch the document's current id. $currentID = $modx->documentObject['id']; // fetch the TV $apPubBuy output and store it in $valueLink. $valueLink = $modx->getTemplateVarOutput($apPubBuy, $currentID, 1); //check if apPubBuy != 'Not Available' if($valueLink['apPubBuy'] && $valueLink['apPubBuy'] != 'Not Available') { //make HTML output $buyOnline = '<a href="'.$valueLink['apPubBuy'].'" title="[*pagetitle*]" rel="external">'.$valueLink['apPubBuy'].'</a>'; } else {$buyOnline=$valueLink['apPubBuy'];} //-- output to placeholders $modx->setPlaceholder('buyOnline', $buyOnline);
[!apGetPubDetails!] <dt>Buy Online</dt> <dd>[+buyOnline+]</dd>
if($valueLink['apPubBuy'] ...
if (isset ($valueLink['apPubBuy']) && ....
//define place holders $buyOnline=''; //-- fetch the document's current id. $currentID = $modx->documentObject['id']; // fetch the TV $apPubBuy output and store it in $valueLink. $valueLink = $modx->getTemplateVarOutput($apPubBuy, $currentID, 1); echo "valueLink=".$valueLink['apPubBuy'];
//-- fetch the document's current id. $currentID = $modx->documentObject['id']; // fetch the TV $ap-eventTime output and store it in $value. $valueLink = $modx->getTemplateVarOutput($ap-eventTime, $currentID, 1); echo "valueLink=".$valueLink['ap-eventTime'];
echo print_r($valueLink, true);
Array ( [ap-bodyID] => story [ap-thumbnail] => thumbnail **shows image** [ap-contributorsList] => 61 [apPubAuthor] => Phaidon Press [apPubISBN] => 7666754563214 [apPubHouse] => Phaidon Press [apPubDate] => April 2006 [apPubBuy] => Not Available [alias] => pahidon-design-classic [cacheable] => 1 [content] => Phaidon Design Classics is a magnificent source book on design with precise information about each product, its designer, its manufacuture and their history. The 999 objects here have been selected by a panel of experts that includes designers, architects, auctioneers, critics, curators, journalists and academics. [contentType] => text/html [content_dispo] => 0 [createdby] => 1 [createdon] => 1147576409 [deleted] => 0 [deletedby] => 0 [deletedon] => 0 [description] => Phaidon Design Classics' three volume set contains the most comprehensive collection of design classics and features the most innovative and beautiful products created in the last 200 years [donthit] => 0 [editedby] => 1 [editedon] => 1147715780 [haskeywords] => 0 [hasmetatags] => 0 [hidemenu] => 1 [id] => 72 [introtext] => Phaidon Design Classics' three volume set contains the most comprehensive collection of design classics and features the most innovative and beautiful products created in the last 200 years. [isfolder] => 0 [longtitle] => Phaidon Design Classics 3 volume set [menuindex] => 0 [menutitle] => [pagetitle] => Phaidon Design Classic [parent] => 13 [privatemgr] => 0 [privateweb] => 0 [pub_date] => 0 [published] => 1 [publishedby] => 1 [publishedon] => 1147577963 [richtext] => 1 [searchable] => 1 [template] => 13 [type] => document [unpub_date] => 0
$valueLink = $modx->getTemplateVarOutput($ap-eventTime, $currentID, 1);