简体   繁体   中英

Printing content without tabs in joomla community builder

I try to print from the backend in Community Builder (with Profiler Pro extension) all the tabbed content which is loaded from the database. As all the content is in tabs, with javascript window.print(), it's only possible to print the content of one tab at a time. I have reduced the script to it's essential, but now I am stuck. Has anybody tried this before with Community Builder or has any idea how to solve this? Here is my code:

<?php
class CBView_user {function edituser( $user, $option, $newCBuser, &$postdata ) {global $_CB_framework, $_PLUGINS;
$tabs           =   new cbTabs( ( ( ( $_CB_framework->getUi())) ));
$tabcontent     =   $tabs->getEditTabs( $user, $postdata );
echo $tabcontent;
 }
}   // class CBView_user
?>

I'd probably look in your template rather than having to override classes. If you have to override files in Profile Pro, make sure you do so in your template or via a plug-in. Never override core files.

1) Have you tried just setting styles on your print style sheet ( likely to be somewhere like /templates/yourtemplate/css/print.css if one has been set up in your template.) to tell it to

display:block !important

on any hidden tabs?

On a demo of Profile Pro I saw, this would work to make the hidden areas visible:

.smoothness .ui-tabs .ui-tabs-hide,.tab-page {
 display:block !important; 
}

I think that is the best solution (if it works) as it doesn't require any file overriding, and is exactly what the print style sheet is there for.

2) Failing that, on page load, you could use a simple JQuery or Mootools script to copy the content from the tabs into a print-only area. Use the print style sheet to show this copy and hide the other copy. Again, no core files overridden, so a pretty safe method.

3) If you have access to override the javascript:window.print() button, then call this as part of a larger function which uses jquery to lay out the content properly first (would not work for anyone using the native browser print button).

Also may help to know they appear to be using this to create the tabs : http://api.jqueryui.com/tabs/ - info there about how they are working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM