Forum

Thread tagged as: Error, Configuration, Twitter

Twitter app template issue

Hi,

I'm unable to access templates in the /templates/twitter folder. If i let it revert to default then debug shows /templates/twitter/tweet.html. If I try and access a custom template it reverts to /addons/apps/perch_twitter/templates and then says the template is unavailable (even if I copy it to that location). How do I stop this?

Many thanks,

Nick

Nicolas Haigh

Nicolas Haigh 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

How are you accessing a custom template? Can we see your code?

<?php perch_twitter_get_latest(array(
    'twitter_id' => 'NicolasHaigh',
    'type' => 'mine',
    'count' => 10,
    'exclude_replies' => true,
   /* 'template' => 'nicolastweet.html', */
    )); ?>
    <?php PerchUtil::output_debug(); ?>

This is within a div on my page (it's being developed locally).

N

Drew McLellan

Drew McLellan 2638 points
Perch Support

What debug output do you get?

Obviously that line above is normally uncommented to try and access the template.

Debug output is:

Template file not found: /Users/nicolashaigh/Sites/NicolasHaigh/wwwroot/perch/addons/apps/perch_twitter/templates/nicolastweet.html

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does that path look correct?

no it should be:

/Users/nicolashaigh/Sites/NicolasHaigh/wwwroot/perch/templates/twitter/nicolastweet.html

This is the path it reverts to if I comment out the template line above. That shows up in debug as /templates/twitter/tweet.html

In other words - when I try and name a template it reverts to the apps path instead of the perch/templates path.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Try:

'template' => 'twitter/nicolastweet.html',

I think that worked! Thanks!