Show all page with he same type page in other page

Silverstripe Version:

Hi I have page with Product and I show All products in bottom of page here:

class ItemPage_Controller extends PageController {
    public function LatestArticles($count = 4)
        return ItemPage::get()
            ->sort('Created', 'ASC')
<% loop $LatestArticles %>	
    <div class="grid-item col-md-4">
        <div><img class="img-fluid" src="$Ilustracny.Link" /></div>						
        <div class="text">
            <a href="$Link" style="width: 180px;" class="btn btn-primary btn-orange-white">Zistiť viac</a>
<% end_loop %>

But I want show only other products… something like: if Title != This Page Title

Hi @Zuzka_Simova , welcome to the forum! Try this:

return ItemPage::get()
    ->sort('Created', 'ASC')
    ->exclude('ID', $this->ID);

p.s. I tidied up the code in your post a bit so it gets formatted nicely. For future reference you can use markdown formatting to indicate code blocks, or you can select your code and click the code button. If you click Edit on your original post you can see the markdown formatting I used as an example.

Thank you very much :slight_smile: