teaser template: new {ARTICLEID} tag
Posted: Sun 7. Oct 2007, 19:38
hi All, possibly the smallest hack so far, only a copied line with the slighted alteration allows you to get and use the target article ID for a teaser article.
WHY?
I have a teaser template that uses {RANDOM/picture/{ARTICLEID}} to display a random image in a teaser that is randomly selected from a sub folder of ./picture of the same name as the article ID.
e.g. a teaser of the article 47 would use a randomly selected imag from the folder picture/47/ by using this tag... {RANDOM/picture/47} in the teaser's template file.
maybe one of the least required hack too but I hope it helps someone add a neat trick to their site.
EDIT: oops forgot to add the hack
opend file...
include/inc_front/content/cnt8.article.inc.php
find line:
after, add...
usage: place {ARTICLEID} within any teaser template.
note: this tag is only add to the functionality of the 'teaser' content part
this tag can be viewed in action as the big (random) teaser image on the homepage here... http://www.teensunitefightingcancer.org/index.php (site under construction)
WHY?
I have a teaser template that uses {RANDOM/picture/{ARTICLEID}} to display a random image in a teaser that is randomly selected from a sub folder of ./picture of the same name as the article ID.
e.g. a teaser of the article 47 would use a randomly selected imag from the folder picture/47/ by using this tag... {RANDOM/picture/47} in the teaser's template file.
maybe one of the least required hack too but I hope it helps someone add a neat trick to their site.
EDIT: oops forgot to add the hack

opend file...
include/inc_front/content/cnt8.article.inc.php
find line:
Code: Select all
$content['alink']['tr'][$key] = str_replace('{ARTICLELINK}', 'index.php?aid='.$row['article_id'], $content['alink']['tr'][$key]);
Code: Select all
$content['alink']['tr'][$key] = str_replace('{ARTICLEID}', $row['article_id'], $content['alink']['tr'][$key]);//HACK:pSouper add {ARTICLEID replacement tag to display the articleID}
note: this tag is only add to the functionality of the 'teaser' content part
this tag can be viewed in action as the big (random) teaser image on the homepage here... http://www.teensunitefightingcancer.org/index.php (site under construction)