Hello,
i'm new to processwire, but not to php and all the LAMP Stuff.
To answer all Pro's questions, yes i used the Search but found nothing that fits to my Issue.
Current i try to build ym own Blog/news Page. I created ym own template file called news.php and pinned it at my Template in the Backend. For now all fine.
I want to use twig as template Engine. I also found my testentry for nws with phpmyadmin in the Database.
My Issue is that if use the $page or $pages i'll never get any Data from DB or Pages or else.
Could anyone please tip with a finger on my false Code?
<?php namespace ProcessWire;
$urlString = $page->url();
$twigPage = "";
switch($urlString){
case "news_feed";
$pages->get("/presse/")->find("template=news");
echo $twig->render('pages/news_feed.twig', $tpl_vars);
break;
case "news";
$resultSet = $pages->find("template=news, news_id=1");
echo $twig->render('pages/news.twig', $tpl_vars);
break;
case "newsstart";
$resultSet = $page->get("template=news, sort=-news_created, limit=3");
if ($resultSet) {
while ($row = $resultSet->fetch()) {
$nachricht = message($row);
array_push($rows,$nachricht);
}
}
echo $twig->render('pages/newsstart.twig', $tpl_vars);
break;
case "newsarchive";
$resultSet = $page->get("template=news, sort=-news_created");
echo $twig->render('pages/newsarchive.twig', $tpl_vars);
break;
default:
$resultSet = $pages->get("/presse/")->find("template=news");
echo $twig->render('pages/news_feed.twig', $tpl_vars);
break;
}
Kind Regards