Jump to content

comment go to each pages


doolin
 Share

Recommended Posts


Hi guys

I've created a simple overview template named "basic-page" to display the text,

image and comment field of each page who has template "standard"

/ Home site -> Overview template "basic-page" -> Gets all Fields from the existing pages through a loop via $pages->find("template=standart");

i also add the comment module for each item in the loop, to view and write a comment. Its like a dashboard, you see all of the content of each page, on the home site.

Now i noticed, when i add a comment to a page on the home page, the comment is added in each of the page, not just on this site i have commented. On a page itself, for instance /mypost/ it works, the comment just adds to this page.

Can anyone tell me, what im doing wrong.

thanks..!!

Here ist my basic-page template:



<?php include("head.php"); ?>
<?php
$dir = $config->urls->admin;
if($user->isLoggedin())
{ ?>
<form action="<?php echo $dir ?>add/" method="post">
<button type="submit">Beitrag Hinzufügen</button>
</form>

<?php
}
$seiten = $pages->find("template=standart");
foreach($seiten as $s) {
echo '<div id="block">';
echo "<h1><a href='{$s->url}'>{$s->title}</a></h1>";
$n = $s->name;
if($user->isLoggedin())
{ ?>
<div id="funk">
<form action="<?php echo $dir ?>realy/" method="post">
<input type="hidden" name="seite" value="<?php echo $n ?>">
<button type="submit">Löschen</button></form>
<form action="<?php echo $dir ?>edit/" method="post">
<input type="hidden" name="seite" value="<?php echo $n ?>">
<button type="submit">Ändern</button></form>
</div>
<?php
}
echo '<div id="bilder">';
foreach($s->bilder as $image) {
$thumb = $image->width(200);
echo "<a href='$image->url' class='fancybox' rel='gallery1'><img src='$thumb->url'></a>";
}
echo '</div>';
?>
<?php
echo '<div id="text">';
echo "<p>{$s->body}</p>";
echo '<div class="flip"><h1>Kommentare ↓</h1></div>';
echo '<div class="kommentare">';
echo $s->kommentar->render();
echo $s->kommentar->renderForm();
echo '</div>';
echo '</div>';
echo '</div>';
}
?>
<?php include("foot.php"); ?>


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...