Bit of a novice php question I was hoping someone could help me with:
I've added some custom social media fields to a template by adding this to templateDetails.xml
<field type="t3depend" function="@legend" label="T3_BACKGROUND_CONFIG" description="T3_BACKGROUND_CONFIG_DESC"/>
<field name="Twitter" type="text" default="" label="Twitter" description="Twitter"/>
<field name="Facebook" type="text" default="" label="Facebook" description="Facebook"/>
and this to the footer block:
<?php
$tplParams = JFactory::getApplication()->getTemplate(true)->params;
$TwitterURL = $tplParams->get('Twitter','');
?>
<a href="/<?php echo $TwitterURL ?>"><i class="fa fa-twitter-square"></i></a>
What I'd really like help with is showing only the above anchor element if the twitter field is filled in. I know that it's pretty straight forward to do this with a php if statement, but I'm having trouble finding what conditional to use etc.
Thanks!