Skip to content

Allow %replaceText% and %deleteText% to work on content that was imported using %file()% #244

Description

@RealRaven2000

We often need to import text fragments ("building blocks") that have a generic message but need to include some specific keywords, such as a product name or URL. At the moment the following pattern does not work within the text that is imported:

Template:

  %file("snippets/why-renew.html")%   
  %replaceText("{addonName}","quickFilters")%
  %replaceText("{github}","https://github.com/RealRaven2000/quickFilters")%

Contained file (why-renew.html)

<p> 
  All changes of the Add-on {addonName} can be seen as they are 
  created and tracked <a href="{github}/issues">on Github</a>;
</p>

At the moment, SmartTemplates does the replacements before the file is loaded into the template. Expected behavior: First load the file and replace its contents into the template, then do the text replacements afterwards.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions