Forum

Thread tagged as: Twitter

tweetHTML not encoding HTML

Hey,

I'm trying to use the <perch:twitter id="tweetHTML"/> tag in a template that's stored in /templates/twitter/.

It's being called from this code:

       <?php
    perch_twitter_get_latest(array(
        'twitter_id'=>'pixelanddot',
        'type'=>'mine',
        'count'=>3,
        'exclude_replies'=>false,
        'template'=>'twitter/tweets.html'
    )); 
?>

It's working but the page is displaying the HTML rather than encoding it.

Example

Any idea what's going on?

Thanks, Barney

Barney Stephens

Barney Stephens 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

What does your template look like?

Hi Rachel,

Like this currently:

<div class="col-lg-4 col-md-4 col-sm-4">
    <h4><perch:twitter id="tweetHTML" /></h4>
    <p><em><perch:twitter id="tweetDate" /></em></p>
</div>

Thanks, Barney

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Add encode="false" to the tweetHTML tag.

Thanks Rachel, that worked! :)