Jump to content

Why can't I find pages of a given template?


elmago79
 Share

Recommended Posts

This I guess is very simple but it is driving me a bit insane.

I'm using this bit of code to populate the main page of a website.

$pages->find('template=singleblogpost, sort=-fecha_de_publicacion')->eq(0); 

There are many kinds of pages, each with a different template. I have singleblogpost, singlegallery, quotations, adds, so I just change the template. And it works for every king of page except for the 'video' template. 

$pages->find('template=video, sort=-fecha_de_publicacion')->eq(0); 

Do you have any idea as to what am I doing wrong?

Link to comment
Share on other sites

  • 1 month later...
I've had similar issues occasionally and haven't always really understood why the selector has suddenly started working in the desired way. :)

Removing the whitespace(s) from selector has solved similar cases sometimes. Also the pages may have been hidden or unpublished, which would require the "include=hidden" or "include=all" property to be defined.

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...