T3 Community Discussion & Support

Let's build the best free Joomla template framework, together!
  1. dilby
  2. General Discussion
  3. Monday, 21 July 2014
  4.  Subscribe via email
Hi all -

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!
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Dilby,

You want to add extra fields? Have you checked out the documentation: http://t3-framework.org/documentation/extend-com-content#add-extra-fields
I think it could help you.

Gardner.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.