Forum
Problems setting up Twitter App.
Perch: 3.0.14, PHP: 5.6.22, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.14), assets (3.0.14), categories (3.0.14), perch_forms (1.10), perch_twitter (4.0)
App runtimes: <?php $apps_list = ['perch_forms', 'perch_twitter' ];
PERCH_LOGINPATH: /admin
PERCH_PATH: /var/sites/b/bravepr.co.uk/public_html/admin
PERCH_CORE: /var/sites/b/bravepr.co.uk/public_html/admin/core
PERCH_RESFILEPATH: /var/sites/b/bravepr.co.uk/public_html/admin/resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
DOCUMENT_ROOT: /var/sites/b/bravepr.co.uk/public_html
HTTP_HOST: bravepr.co.uk
REQUEST_URI: /admin/core/settings/diagnostics/
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
I have created a html template for a shared footer - in the footer I need to display 1 tweet. I have setup the Twitter App and can see the list of tweets in the control panel.
<section>
<h3>
<perch:content id="socialheading" type="text" label="Social heading" required="true" />
</h3>
<?php
perch_twitter_get_latest([
'twitter_id' => '@hellobravepr',
'type' => 'mine',
'count' => 1,
'exclude_replies' => true,
'template' => 'tweet.html',
]);
?>
</section>
When I refresh the web page, the space where the tweets should appear remains blank.
Any advice would be grateful.
Alex
For
twitter_id
give it a try without the@
symbol - so just'hellobravepr'
Thanks - still no joy removing the @ symbol.
On the webpage, the tweet space just displays:
You can’t have php in a template.
Are you seeing the tweets listed in the control panel?
Hi Drew, yes the tweets are listed in the control panel.
I have setup a global-footer.php which calls a footer.html template. This is a 'shared region' to allow editors to edit 3 of the 4 columns.
The columns are: 1. footer menu (editable) 2. about summary (editable) 3. social media section (not editable) uses perch_twitter_get_latest() 4. contact details (editable)
I guess I need to set this up differently?
Hi Alex
Move the
perch_twitter_get_latest
php function to your global-footer.php page and then call the tweets inside the template using<perch:twitter id="tweetHTML" encode="false" />
.Jon
Thanks Jon,
So my code in the global-footer.php looks like this:
and my footer-slide.html template code looks like this:
When I use the developer tools the this is the code being displayed
The social media area is still blank?
Have you turned on debug to see if there are any messages?
You might want to put the @ symbol back into the username. I use it and it works across many sites.
Still no joy...Do I need to still use...
I have setup the twitter app in the control panel, I can see a list of tweets but nothing is being displayed.
Have you turned on debug yet to look for error/warning messages?
Hi Jon, debug is turned on...nothing that stands out.
That's the output from the diagnostics page. What's the debug output from the page where you're having problems?
Hi Drew,
See debug from page:
What still looks like debug from the Perch control panel, not your page.
Hi Dew,
Sorry I've updated the config file with:
And added the following to the index.php page:
No debug appear on screen, just get the debug in the control panel?
Make sure you've added
<?php PerchUtil::output_debug(); ?>
to the bottom of the page. Otherwise it won't output anything.Following up - the 'template' was not being picked up.
Should have been:
Thanks for your support.
Ha - thought that might be the case. Glad you got it sorted. Debug is always the best indicator of template issues. Remember not to have it turned on in production mode!
Jon