Describe the bug
Placeholder {{title}} is not being used when making new content from a template.
To Reproduce
Steps to reproduce the behavior:
Go to a content template.
Add the placeholder "{{title}}" to the 'title' field in the frontmatter of the template.
Make new content from the template.
See that the text {{title}} is in the field instead of the title entered when creating the content.
Expected behavior
I think that this is because fields like title and date do not need a placeholder and will be filled in automatically. But I would expect that if I add the title placeholder into the template that the text would render there.
**Describe the bug**
Placeholder `{{title}}` is not being used when making new content from a template.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to a content template.
2. Add the placeholder `"{{title}}"` to the 'title' field in the frontmatter of the template.
3. Make new content from the template.
4. See that the text `{{title}}` is in the field instead of the title entered when creating the content.
**Expected behavior**
I think that this is because fields like title and date do not need a placeholder and will be filled in automatically. But I would expect that if I add the title placeholder into the template that the text would render there.
<!-- github-sync-id:1141960829 -->
Just tried it with the `{{title}}` and `{{now}}`, but cannot seem to reproduce it. The placeholder engine runs through all fields.
https://user-images.githubusercontent.com/2900833/154590569-30ddef4f-20b9-4a2d-aed8-c25ef02dec35.mov
Do you do something different here?
<!-- github-comment-id:1043636652 -->
Is there a way I can use the Placeholders in the body of my MD file?
I imagine If I add something like:
{{thisPage.title}}
then in the MD preview it will be replaced with its value - The title of the page
So do we have such "hack"? :)
Hi, **estruyf**!
A quick question please!
If I create a MD file from the above template:
---
title: "{{title}}"
date: "{{now}}"
lastmod: "{{now}}"
draft: true
tags: []
categories: []
type: blog
---
Is there a way I can use the Placeholders in the body of my MD file?
I imagine If I add something like:
**{{thisPage.title}}**
then in the MD preview it will be replaced with its value - **The title of the page**
So do we have such "hack"? :)
<!-- github-comment-id:1161901515 -->
Hi @TsvetyD, there is currently no placeholder processing happening in the contents of the template or page, but can be suggested as a future enhancement to the extension.
Hi @TsvetyD, there is currently no placeholder processing happening in the contents of the template or page, but can be suggested as a future enhancement to the extension.
<!-- github-comment-id:1162877929 -->
It would be great if I can define my own Placeholders and use them when creating content from Templates.
My use case is:
I'm writing similar documentation files that explain how to create Users, Roles, Business Units etc.
So I could have a "CreateItem" template where I can define a Placeholder and replace it in the body of the MD
with "User", "Role" or "Business Unit" depending on the content I'm creating.
And for all the items, I can also have "DeleteItem" and "EditItem" templates with the same Placeholders.
My Template could look like this:
ContentIem: "{{ContentIem}}"
To create a "{{ContentIem}}":
Go to .... and click...
And then when I create the content MD file from that template it will replace the "{{ContentIem}}"
with "User", "Role" or "Business Unit" depending on the content I'm creating.
But if you think that only a few people can benefit from it,
then you can ignore my idea.
Thanks!
Hi Estryuf,
It would be great if I can define my own Placeholders and use them when creating content from Templates.
**My use case is:**
I'm writing similar documentation files that explain how to create Users, Roles, Business Units etc.
So I could have a "CreateItem" template where I can define a Placeholder and replace it in the body of the MD
with "User", "Role" or "Business Unit" depending on the content I'm creating.
And for all the items, I can also have "DeleteItem" and "EditItem" templates with the same Placeholders.
**My Template could look like this:**
---
ContentIem: "{{ContentIem}}"
---
To create a "{{ContentIem}}":
1. Go to .... and click...
And then when I create the content MD file from that template it will replace the "{{ContentIem}}"
with "User", "Role" or "Business Unit" depending on the content I'm creating.
But if you think that only a few people can benefit from it,
then you can ignore my idea.
Thanks!
<!-- github-comment-id:1163197645 -->
Closing this as a stale issue, as there hasn't been any activity on it for a long time. If this is still a problem with the latest version of Front Matter CMS, feel free to reopen it (or create a new issue) and we'll take another look. Thanks!
Closing this as a stale issue, as there hasn't been any activity on it for a long time. If this is still a problem with the latest version of Front Matter CMS, feel free to reopen it (or create a new issue) and we'll take another look. Thanks!
<!-- github-comment-id:6438496492 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
Placeholder
{{title}}is not being used when making new content from a template.To Reproduce
Steps to reproduce the behavior:
"{{title}}"to the 'title' field in the frontmatter of the template.{{title}}is in the field instead of the title entered when creating the content.Expected behavior
I think that this is because fields like title and date do not need a placeholder and will be filled in automatically. But I would expect that if I add the title placeholder into the template that the text would render there.
Just tried it with the
{{title}}and{{now}}, but cannot seem to reproduce it. The placeholder engine runs through all fields.https://user-images.githubusercontent.com/2900833/154590569-30ddef4f-20b9-4a2d-aed8-c25ef02dec35.mov
Do you do something different here?
I'll double check, but when I tested, it looked identical to your setup.
@zivbk1 does this still occur?
Hi, estruyf!
A quick question please!
If I create a MD file from the above template:
title: "{{title}}"
date: "{{now}}"
lastmod: "{{now}}"
draft: true
tags: []
categories: []
type: blog
Is there a way I can use the Placeholders in the body of my MD file?
I imagine If I add something like:
{{thisPage.title}}
then in the MD preview it will be replaced with its value - The title of the page
So do we have such "hack"? :)
Hi @TsvetyD, there is currently no placeholder processing happening in the contents of the template or page, but can be suggested as a future enhancement to the extension.
Thanks for the answer, estruyf! :)
For me, that would be a very useful new functionality!
Do you only want to have it for the title? Or do you have other use cases?
I could see this being useful if we could define a field group for the input to the template too.
Hi Estryuf,
It would be great if I can define my own Placeholders and use them when creating content from Templates.
My use case is:
I'm writing similar documentation files that explain how to create Users, Roles, Business Units etc.
So I could have a "CreateItem" template where I can define a Placeholder and replace it in the body of the MD
with "User", "Role" or "Business Unit" depending on the content I'm creating.
And for all the items, I can also have "DeleteItem" and "EditItem" templates with the same Placeholders.
My Template could look like this:
ContentIem: "{{ContentIem}}"
To create a "{{ContentIem}}":
And then when I create the content MD file from that template it will replace the "{{ContentIem}}"
with "User", "Role" or "Business Unit" depending on the content I'm creating.
But if you think that only a few people can benefit from it,
then you can ignore my idea.
Thanks!
Closing this as a stale issue, as there hasn't been any activity on it for a long time. If this is still a problem with the latest version of Front Matter CMS, feel free to reopen it (or create a new issue) and we'll take another look. Thanks!