Jump to content

how to find pages with a certain page-field-option selected


ngrmm
 Share

Recommended Posts

pages with the same template have a page-field. i can select multiple pages and they are like tags

i output them like this

		<?php
	      	foreach($page->tag as $tags) {
  		echo "<a href='$tags->url'>{$tags->title}</a>";
		}	
	      	?>

the tag-pages ($tags->url) should just show the pages with the certain tag selected.

is there a way to filter?

where in the documentation do i find something about this.

Link to comment
Share on other sites

You can search for the pages with that tag.

$taggedPages = $pages->find("template=myTaggedPagesTemplate, tag=$page");

You can find docs about selectors here: http://processwire.com/api/selectors/

And some in depth into in categorizing content can be found here: https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/

  • Like 1
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...