Replacement Tag: Comments
-
- Posts: 58
- Joined: Fri 15. Jul 2005, 11:04
-
- Posts: 58
- Joined: Fri 15. Jul 2005, 11:04
OK, I'm using Erichs teaser EX tag to show the newspart.
the whole code for the article listing is:
I havent done any other hacks.
is this helpful ?
the whole code for the article listing is:
Code: Select all
<!--
sample template for article summary listing
===========================================
TITLE = article title
SUB = article subtitle
SUMMARY = article summary text
IMAGE = summary image (only the <img src="..."> tag)
ZOOMIMAGE = if the image is click-zoomable (<a href...><img...></a>)
CAPTION = summary image caption
ARTICLELINK = url to full article
MORE = the "more..." text/image like defined in template_defaults
BEFORE = show before listing entry
AFTER = show after listing entry
SPACE = show this between listings
DATE = show article date {DATE:FORMAT:LANG} or {DATE:FORMAT}
EDITOR = name of editor
ARTICLEID = ID of list entry
//-->
<div style="padding-bottom:10px;" width="100%">
<div style="padding:5px; margin:0px; background-color:#F5F5F5; border:1px solid #CCCCCC;">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="150px" valign="top">
<div><a href="{ARTICLELINK}">{IMAGE}</a></div>
<div class="image_caption" style="padding:3px 0px 3px 0px;">[CAPTION]<div align="center">{CAPTION}</div>[/CAPTION]</div>
</td>
<td width="10px"><img src="img/leer.gif" border="0" width="10px" height="1px" alt=""></td>
<td width="330px" valign="top">
<div class="articleHead" style="margin-bottom:3px;"><a href="{ARTICLELINK}">[TITLE]<h1 style="margin:0 0 5px 0;">{TITLE}</h1>[/TITLE]</a></div>
<div class="articleSubHead" style="margin-bottom:3px;">[SUB]<h3 style="margin:0 0 5px 0;">{SUB}</h3>[/SUB]</div>
<div class="articleText" style="padding:0; margin-top:10px;">[SUMMARY]<p style="margin:0">{SUMMARY}</p>[/SUMMARY]</div>
</td>
</tr>
</table>
<div style="clear:both;"></div>
</div>
<div class="datum" style="margin-bottom:5px; text-align: left;">erstellt von: {EDITOR} am {DATE:d.m.Y}</div>
[PHP]
$my_article_id = "{ARTICLEID}";
$my_article_cid = $GLOBALS['content']['articles'][$my_article_id]['article_cid'];
echo('{COMMENTS:' . $my_article_id . ':' . $my_article_cid . '}')
[/PHP]
<div class="news_readmore" align="right" style="margin-top:3px;">[MORE]<a href="{ARTICLELINK}">{MORE}</a>[/MORE]</div>
</div>
<center>----------------------------------------------------------------------------------------------</center>
<p>
<p>
is this helpful ?
-
- Posts: 58
- Joined: Fri 15. Jul 2005, 11:04
-
- Posts: 58
- Joined: Fri 15. Jul 2005, 11:04
I just updated the teaser EX replacement tag to the new version.
Now it looks a bit better. The result I see at my homepage is: {COMMENT:188:}
Thats it, it looks like its still not reading out the article cid.
I tried it with an running 1.2.3 and 1.2.5 version, same thing.
PS: If I change the article cid in my sample.tmpl to a number, e.g. if i paste in the code
I get the text "Write comment". Even if I have 3 comments in there.
Now it looks a bit better. The result I see at my homepage is: {COMMENT:188:}
Thats it, it looks like its still not reading out the article cid.
I tried it with an running 1.2.3 and 1.2.5 version, same thing.
PS: If I change the article cid in my sample.tmpl to a number, e.g. if i paste in the code
Code: Select all
<div class="datum" style="margin-bottom:5px; text-align: left;">erstellt von: {EDITOR} am {DATE:d.m.Y}</div>
[PHP]
// Strange hack, but it works
$my_article_id = "{ARTICLEID}";
$my_article_cid = $GLOBALS['content']['articles'][$my_article_id]['article_cid'];
echo('{COMMENTS:' . $my_article_id . ':' . 1 . '}')
[/PHP]
I get the text "Write comment". Even if I have 3 comments in there.
I think the problem is that you're using TEASER_EX and not the standard phpwcms article listing engine. Sorry dude, but I don't know how to fix that because I'm not using TEASER_EX...
Hint: Try do to a var_dump on the following section of the array: $GLOBALS['content']['articles']. If you get any dumped information, try to get one level deeper into the array: $GLOBALS['content']['articles'][$my_article_id] Now dump that stuff. If you don't get anything dumped so far: Seems like TEASER_EX is not processing the $GLOBALS array.
Another idea: Maybe is TEASER_EX processing the PHP after replacing the replacement tags (e.g. {ARTICLEID}). Then try the following:
Hint: Try do to a var_dump on the following section of the array: $GLOBALS['content']['articles']. If you get any dumped information, try to get one level deeper into the array: $GLOBALS['content']['articles'][$my_article_id] Now dump that stuff. If you don't get anything dumped so far: Seems like TEASER_EX is not processing the $GLOBALS array.
Another idea: Maybe is TEASER_EX processing the PHP after replacing the replacement tags (e.g. {ARTICLEID}). Then try the following:
Code: Select all
[PHP]
// Strange hack, but it works
$my_article_id = "{ARTICLEID}";
$my_article_cid = $GLOBALS['content']['articles'][{ARTICLEID}]['article_cid'];
echo('{COMMENTS:' . $my_article_id . ':' . $my_article_cid . '}')
[/PHP]
-
- Posts: 58
- Joined: Fri 15. Jul 2005, 11:04
-
- Posts: 58
- Joined: Fri 15. Jul 2005, 11:04