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.

replacing text with image

See original GitHub issue

I may be doing this in the wrong place, I’m putting in my template this:

{% static 'img/fb.png' %}

which throws the error

Could not parse the remainder: '"{%' from '"{%'
{% post_to_facebook object_or_url "{% static 'img/fb.png' %}
      " %}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoorodriguezpcommented, Sep 24, 2021

If you would like to use Font Awesome icons as images you just replace the text link with the icon definition tag like so:

{% post_to_twitter “A Good Article: {{object.title}}. Check it out!” object_or_url ‘<i class="fa fa-twitter-square aria-hidden=“true”>’ %}

Don’t forget to close the “i” tag in order to avoid multiple icons everywhere.

Here is another example:

  {% post_to_facebook object_or_url '<i class="fa fa-facebook" aria-hidden="true"></i>' %}

  {% post_to_twitter "A good article: {{object.title}} - Check it out!" object_or_url '<i class="fa fa-twitter" aria-hidden="true"></i>'%}

  {% post_to_whatsapp object_or_url '<i class="fa fa-whatsapp"></i>'%}

  {% post_to_telegram "A good article: {{object.title}} - Check it out!" object_or_url '<i class="fa fa-telegram" aria-hidden="true"></i>'%}

Best Regards!!

0reactions
nlubegacommented, Feb 6, 2019

If you would like to use Font Awesome icons as images you just replace the text link with the icon definition tag like so:

{% post_to_twitter “A Good Article: {{object.title}}. Check it out!” object_or_url ‘<i class="fa fa-twitter-square aria-hidden=“true”>’ %}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replace Text in Jpeg - pdfFiller
Learn how to Replace Text in Jpeg online. Create professional documents with pdfFiller.
Read more >
Change Text in an Image Online - Photopea
Switch to a Type tool in the toolbar (or press T). Click into the image, where the text should begin. Now, you can...
Read more >
How to replace text with image and vice versa in Word?
1. Open the Word document that you will replace text with image, and click the anchor at the bottom-right corner of Clipboard group...
Read more >
how to replace text with image in html/css - Stack Overflow
I would like to replace text with image, but I want also to have the text on the web page, which is related...
Read more >
Replace Text Content With Image - Documentation - Telerik
A common scenario is to replace a temporary page content (a placeholder text) with an image. This allows already created PDF documents to...
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