# Custom tag has access to where it is being called?

**URL:** <https://forum.getkirby.com/t/custom-tag-has-access-to-where-it-is-being-called/7673>\
**Category:** Questions\
**Tags:** v2\
**Created:** [June 6, 2017, 2:24pm UTC](https://forum.getkirby.com/t/custom-tag-has-access-to-where-it-is-being-called/7673 "2017-06-06T14:24:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carstengrimm](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/carstengrimm/32/188_2.png) [@carstengrimm](https://forum.getkirby.com/u/carstengrimm)\
**Post date:** [June 6, 2017, 2:24pm UTC](https://forum.getkirby.com/t/custom-tag-has-access-to-where-it-is-being-called/7673/1 "2017-06-06T14:24:35Z")

</div>

i created a custom tag which does quite a few things and i have been trying to access the current page/uid/structure whatever to use inside tag.

when i am trying to add a $page object to my tag - it’s not giving me the place **e.g. subpage where the custom tag has been used** but the parent where the script is calling everything…

e.g.

- I am running my script which runs though several subpages, where at any point there are a few custom tags page object will contain /parent-page/running/script/
- i want to get informations directly inside the tag where it’s currentlyplaced /parent-page/running/script/custom-tag-is-in-subpage/

while i only have been trying

`$page = page();`

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 6, 2017, 2:38pm UTC](https://forum.getkirby.com/t/custom-tag-has-access-to-where-it-is-being-called/7673/2 "2017-06-06T14:38:24Z")

</div>

While I don’t quite understand what you are trying to say, you can get the current page with `$tag->page()`. If that’s not what you want, maybe post some code?

---

<div class="post-metadata">

**Author:** ![carstengrimm](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/carstengrimm/32/188_2.png) [@carstengrimm](https://forum.getkirby.com/u/carstengrimm)\
**Post date:** [June 6, 2017, 3:07pm UTC](https://forum.getkirby.com/t/custom-tag-has-access-to-where-it-is-being-called/7673/3 "2017-06-06T15:07:33Z")

</div>

`$tag->page()` was what i wanted, thanks 🙂

---

<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, 4:49pm UTC](https://forum.getkirby.com/t/custom-tag-has-access-to-where-it-is-being-called/7673/4 "2025-02-06T16:49:52Z")

</div>


