Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Support / AdsManager Support / [RESOLVED] Tab conditional display

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

[RESOLVED] Tab conditional display

More
11 years 1 month ago - 11 years 1 month ago #14163 by raph17
[RESOLVED] Tab conditional display was created by raph17
I have fields positions displayed under 4-5 tabs.I have a tab where is publicated only one field - youtube video field.
And not all ads will have videos attached from youtube.
This is the code
<div class="tab-pane" id="video">
			<?php
				if (isset($this->fDisplay[19]))
				{		
					foreach($this->fDisplay[19] as $field)
					{	
						$c = $this->field->showFieldValue($this->content,$field); 
						if(($c !== "")&&($c !== null)) {
							$title = $this->field->showFieldTitle(@$this->content->catid,$field);
							if ($title != "")
								echo "<b>".htmlspecialchars($title)."</b>: ";
							echo "$c<br/>";
						}
					} 
				}
			?>	  
		</div>

How can i make this tab appear only when a user put a video on ad?
I mean if is no video published the tab to be hidden.

Can you help me please?

Thank you
Last edit: 11 years 1 month ago by loic.
More
11 years 1 month ago #14199 by tompap
Replied by tompap on topic Tab conditional display
Hello,

You can add a code like this

[code]
<?php if ($this->content->ad_XXXXX != '') { ?>
yourcode
<?php } ?>
[code]

ad_XXX equals your ad youtube name maybe ad_youtube or ad_video ?
More
11 years 1 month ago #14223 by raph17
Replied by raph17 on topic Tab conditional display
Sorry but dont work.
<?php if ($this->content->ad_youtube != '') { ?> <li ><a href="#video" data-toggle="tab"><?php echo JText::_('ADSMANAGER_TAB_VIDEO'); ?></a></li><?php } ?>

I want a code that if the video field is completed to show the tab, and if is not a video link the tab let be hidden.
More
11 years 1 month ago #14271 by loic
Replied by loic on topic Tab conditional display
Hello,

Have you an error with this code ? Or the video isn't displayed at all ?

Best regards.
More
11 years 1 month ago #14274 by raph17
Replied by raph17 on topic Tab conditional display
Yes the video tab is not displayed.
More
11 years 1 month ago #14281 by loic
Replied by loic on topic Tab conditional display
Hello,

Could you add this, just before the if and copy-paste what you see here ?
<?php var_dump($this->content->ad_youtube,$this->content);  ?>

Best regards.
Time to create page: 0.075 seconds
Powered by Kunena Forum