# Basic question about blog configuration

**URL:** <https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425>\
**Category:** Questions\
**Tags:** v2\
**Created:** [November 7, 2015, 7:15pm UTC](https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425 "2015-11-07T19:15:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon3573533](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon3573533](https://forum.getkirby.com/u/anon3573533)\
**Post date:** [November 7, 2015, 7:15pm UTC](https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425/1 "2015-11-07T19:15:10Z")

</div>

Hello,

Sorry in advance if it is more a php beginner question than a kirby question.  
I’m would add a different content in the span, depend if subpage comes from projets or blog, and I tried several way but was not able to do it…  
Here is the last way I tried to do it ☹

Thank you for your help,

Constant

```
<ul class="liste">
<?php foreach($pages->find('projets' , 'blog')->children()->limit(9)->shuffle() as $article): ?>
<li>
    <div class="content">
        <h2><?php echo html($article->title()) ?></h2>                            
        <p><?php echo $article->text()->excerpt(110) ?></p>
        <span class="test"><?php if($article->isProjetsPage()): ?> test1 <?php else: ?> test2 <?php endif ?></span>
        <a href="<?php echo $article->url() ?>">Visitez <?php echo $article->name() ?></a>
    </div>
</li>
<?php endforeach ?>
</ul>

```

---

<div class="post-metadata">

**Author:** ![PaulMorel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/paulmorel/32/371_2.png) [@PaulMorel](https://forum.getkirby.com/u/PaulMorel)\
**Post date:** [November 7, 2015, 7:38pm UTC](https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425/2 "2015-11-07T19:38:43Z")

</div>

If I’m not mistaken, I think you could use:

`$page->isChildOf($parent)`

Like this:

```auto
<ul class="liste">
<?php foreach($pages->find('projets' , 'blog')->children()->limit(9)->shuffle() as $article): ?>
<li>
    <div class="content">
        <h2><?php echo html($article->title()) ?></h2>                            
        <p><?php echo $article->text()->excerpt(110) ?></p>
        <span class="test"><?php if($article->isChildOf('projets')): ?> test1 <?php else: ?> test2 <?php endif ?></span>
        <a href="<?php echo $article->url() ?>">Visitez <?php echo $article->name() ?></a>
    </div>
</li>
<?php endforeach ?>
</ul>

```

You can also use the `e()` function to simplify your `if` inside the `<span>`.

```auto
<span><?php e( $article->isChildOf('projets'), 'test1', 'test2' ) ?></span>

```

By the way `isProjetsPage()` is not a method that exists in Kirby.

---

<div class="post-metadata">

**Author:** ![anon3573533](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon3573533](https://forum.getkirby.com/u/anon3573533)\
**Post date:** [November 7, 2015, 7:51pm UTC](https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425/3 "2015-11-07T19:51:21Z")

</div>

Hi, thank you for your reponse, unfortunatly I can’t make it work with :

```
$page->isChildOf($parent)

```

For the `isProjetsPage()` I thought I could try to do the same as [homePage](http://getkirby.com/docs/cheatsheet/page/is-home-page) and [ErrorPage](http://getkirby.com/docs/cheatsheet/page/is-error-page).

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [November 7, 2015, 9:46pm UTC](https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425/4 "2015-11-07T21:46:17Z")

</div>

It should be `$article->isChildOf(page('projets'))`, because the parameter is a page, not a string.

> [@anon3573533](#):
>
> For the isProjetsPage() I thought I could try to do the same as homePage and ErrorPage.

These two are the only special cases. But if you want to check by template, you can do this as well:

```html
<span><?php e($article->template() == 'blogpost', 'test2', 'test1'); ?></span>

```

---

<div class="post-metadata">

**Author:** ![anon3573533](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon3573533](https://forum.getkirby.com/u/anon3573533)\
**Post date:** [November 7, 2015, 9:53pm UTC](https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425/5 "2015-11-07T21:53:29Z")

</div>

That’s it! Thank you for your help and explication. And very good to know how to do with templates also.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:04pm UTC](https://forum.getkirby.com/t/basic-question-about-blog-configuration/2425/6 "2025-02-06T17:04:17Z")

</div>


