Tabs Display Issue

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 24, 2017   (RSS)

By bryant - February 22, 2017

Hello,

If anyone could please take a look at this it would be very helpful. I've tried to find a way around this but I'm stuck.

I'm using tabs to display different content in. The issue I'm having is not all of the tabs will need to be displayed if there is no content in it or at least the title tab should be removed if that makes sense.

These tabs, in particular, may not get used depending upon the event.

In the PHP file I did not wrap the "title" PHP codes around the "#tab-" yet because I'm not sure if that would help this issue.

<?php echo htmlencode($event_listingsRecord['location_title']) ?>

<?php echo htmlencode($event_listingsRecord['participants_title']) ?>

<?php echo htmlencode($event_listingsRecord['sponsors_title']) ?>

<?php echo htmlencode($event_listingsRecord['gallery_title']) ?>

Attached are screen shots and a PHP file.

Good (event-good.png)
One event has all tabs filled in from cms content

Issue (event-issue.png)
Another event only has the first three tabs filled in because it was not needed for that event

Thanks,
Bryan

By bryant - February 24, 2017

Hi Ross,

I was able to correct the issue by adding this if statement around the <li> tags and it removed the tabs when there was no data entered into a field in the CMS Builder.

<?php if ($event_listingsRecord['participants_title']): ?>
<li class="">
<a data-toggle="tab" href="#tab-3" aria-expanded="false">
<?php echo htmlencode($event_listingsRecord['participants_title']) ?></a>
</li>
<?php endif; ?>

Bryan

Attachments:

event-tabas-fixed.png 15K

By ross - February 24, 2017

Hi Bryan

Glad you got that resolved.

Thanks for posting the solution to this as well :).

Let me know any other questions.

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/