Jump to content
Sign in to follow this  
ildarvasin

how to redirect fields

Recommended Posts

pls help

I made a news template with various fields and I want my list to appear automatically on the main page with all the news names
how to do it

sorry for my bad english

Share this post


Link to post
Share on other sites

In you home template, you could do something like:

<?php
	$newsArticles = $pages->find('template=your_news_templates');
	foreach ($newsArticles as $newsArticle) {
		echo "<a href=\"" . $newsArticle->url . "\">" . $newsArticle->title . "</a>";
	}
?>

This would output each article's title (as well as a url to the article). Obviously you can change the markup to whatever you would need.

  • Like 3

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...