Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - PureMart (SKU# FLEX-00010)

TOPIC: Help with always showing Tab Content

Help with always showing Tab Content 10 years 10 months ago #4778

With your great help/support, a while back I managed to add in some custom tabs in both the small tabbed area and the bottom tabbed area.Thanks again!

My question now is how can I get one of those tabs to always show regardless of wether it is populated or not (I have my own reasons for wanting this which I wont bore you with).

With this code below in my productdetails template, the tab only shows when there is content to populate it, but I am unsure of what PHP to change to always show the tab regardless? I'm guessing its something to do with <?php if (!empty, but no matter what i change I cant seem to get it working. :o(

I'm hoping this question is relevant to my custom tab and other tabs that only show hen populated (Like Categories, custom Tab, etc), so that it is relevant to other puremart users.

This is the 1st bit that creates the tab title;
<?php if (!empty($this->product->customfieldsSorted['faq'])) { ?>
	<li><a href="javascript:void(0)" rel="#faq"><span>FAQ</span></a></li>
<?php } ?>

& this the 2nd bit;
<?php if (!empty($this->product->customfieldsSorted['faq'])) { ?>
    <div id="faq" class="tabcontent"  style="display:none;">
	<?php $this->position='faq';
		echo $this->loadTemplate('customfields'); ?>
        <div class="clear"></div>
    </div>
	<?php } ?>

Thanks in advance
The administrator has disabled public write access.

Help with always showing Tab Content 10 years 10 months ago #4797

just remove the !empty and display none

This is the 1st bit that creates the tab title;

<?php // if (!empty($this->product->customfieldsSorted)) { ?>
<li><a href="javascript:void(0)" rel="#faq"><span>FAQ</span></a></li>
<?php //} ?>


& this the 2nd bit;

<?php // if (!empty($this->product->customfieldsSorted)) { ?>
<div id="faq" class="tabcontent" style="">
<?php $this->position='faq';
echo $this->loadTemplate('customfields'); ?>
<div class="clear"></div>
</div>
<?php// } ?>


Cheers
The administrator has disabled public write access.

Help with always showing Tab Content 10 years 10 months ago #4800

I thought I had already tried that solution myself - But mine was just guessing?

Anyway I just tried it so that I now have this code below and this Tab still doesn't show. Have I missed something?

1st bit
<?php if (($this->product->customfieldsSorted['faq'])) { ?>
<li><a href="javascript:void(0)" rel="#faq"><span>Q & A's</span></a></li>
<?php } ?>

2nd bit
<?php if (($this->product->customfieldsSorted['faq'])) { ?>
    <div id="faq" class="tabcontent" >    
	<?php $this->position='faq'; echo $this->loadTemplate('customfields'); ?>
        <div class="clear"></div>
    </div>
I also tried with removing the extra brackets from the !empty ??
Last Edit: 10 years 10 months ago by Andy Connell.
The administrator has disabled public write access.

Help with always showing Tab Content 10 years 10 months ago #4812

I thought you wanted it showing all the time?

Why have any if statement or php in it? And is the content in a faq array? $this->product->customfieldsSorted?

Check also any JS that may operate on it

cheers
The administrator has disabled public write access.
Time to create page: 0.362 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo