question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue: Placeholders in some template fields are unnecessary and don't work.

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TsvetyDcommented, Jun 21, 2022

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”? 😃

0reactions
TsvetyDcommented, Jun 22, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Placeholders in Form Fields Are Harmful
1. Disappearing placeholder text strains users' short-term memory. · 2. Without labels, users cannot check their work before submitting a form.
Read more >
Don't Use The Placeholder Attribute - Smashing Magazine
When a person enters information into an input, its placeholder content will disappear. The only way to restore it is to remove the...
Read more >
11 reasons why placeholders are problematic | by Adam Silver
1. Disappearing placeholder text is easy to forget · 2. Not all browsers support placeholders · 3. Pre-populated values are hard to understand...
Read more >
Advanced: Placeholders | Jira Service Management Data ...
Placeholders can replace different data for different contexts (custom fields, automation, post functions). Automation rules. For more info on ...
Read more >
Using placeholders - Zendesk help
I think your custom field placeholders above should also work, so long as you're substituting the field ID into the placeholder as instructed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found