# How to add a tag to note when including existing file with Templater

**URL:** <https://forum.obsidian.md/t/how-to-add-a-tag-to-note-when-including-existing-file-with-templater/44660>\
**Category:** Help\
**Tags:** tags, templater, templates\
**Created:** [October 9, 2022, 1:21pm UTC](https://forum.obsidian.md/t/how-to-add-a-tag-to-note-when-including-existing-file-with-templater/44660 "2022-10-09T13:21:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev01](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/d/d07c76/32.png) [@dev01](https://forum.obsidian.md/u/dev01)\
**Post date:** [October 9, 2022, 1:21pm UTC](https://forum.obsidian.md/t/how-to-add-a-tag-to-note-when-including-existing-file-with-templater/44660/1 "2022-10-09T13:21:31Z")

</div>

### Things I have tried

I have tried searching and looked at docs but could not find anything.

### What I’m trying to do

I need some templates that are identical except for a few extra tags. In order to do this I use the fp.file.include function of Templater for the base template but I do not know how to add tags.

### Example:

TemplateBase

```auto
---
tags: tag1
---

```

Extended template:

```auto
<% tp.file.include("[[TemplateBase]]") %>
<somehow add tag2>

```

Result:

```auto
---
tags: tag1 tag2
---

```

---

<div class="post-metadata">

**Author:** ![egauthier](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/e/ce73a5/32.png) [@egauthier](https://forum.obsidian.md/u/egauthier)\
**Post date:** [October 9, 2022, 3:41pm UTC](https://forum.obsidian.md/t/how-to-add-a-tag-to-note-when-including-existing-file-with-templater/44660/2 "2022-10-09T15:41:15Z")

</div>

Why not

```auto
<% tp.file.include("[[TemplateBase]]") %> additional_tag2 additional_tag3
---

```

Where TemplateBase has everything up to the end of the tag line. I haven’t tested this, but seems logical.

Edit: I just tested and this seems to work fine.

---

<div class="post-metadata">

**Author:** ![dev01](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/d/d07c76/32.png) [@dev01](https://forum.obsidian.md/u/dev01)\
**Post date:** [October 9, 2022, 4:11pm UTC](https://forum.obsidian.md/t/how-to-add-a-tag-to-note-when-including-existing-file-with-templater/44660/3 "2022-10-09T16:11:41Z")

</div>

I guess I should have included more in the example.

It is not just the tags. There are plenty of other things in the template hence the include would come with complete yaml at top along with other headers and things below

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [January 7, 2023, 4:11pm UTC](https://forum.obsidian.md/t/how-to-add-a-tag-to-note-when-including-existing-file-with-templater/44660/4 "2023-01-07T16:11:52Z")

</div>

Closed on January 7, 2023, 4:11pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
