Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 254 additions & 0 deletions media/css/proclaim-print.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
/**
* @package Proclaim.Media
* @copyright (C) 2026 CWM Team All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link https://www.christianwebministries.org
*
* Print stylesheet for Proclaim sermon detail view.
*
* Works with the tmpl=component popup window approach:
* the Joomla template chrome (header, footer, sidebar, modules)
* is already stripped by tmpl=component, so this stylesheet only
* needs to handle Proclaim-specific elements and print optimization.
*
* Add the CSS class "proclaim-no-print" to any custom element
* to hide it in print output.
*/

/* ==========================================================
POPUP WINDOW STYLES (screen)
When the sermon is opened in the print popup (tmpl=component
with print=1), these rules hide interactive elements that
don't belong in a print-oriented view, even before the user
clicks Print.
========================================================== */

.proclaim-print-mode iframe,
.proclaim-print-mode video,
.proclaim-print-mode audio,
.proclaim-print-mode .proclaim-media-player,
.proclaim-print-mode .cwm-fancybox,
.proclaim-print-mode .media-download-btn,
.proclaim-print-mode .btn-group .dropdown-toggle,
.proclaim-print-mode .fa-youtube,
.proclaim-print-mode a[href*="youtube"] img,
.proclaim-print-mode a[href*="youtu.be"] img {
display: none !important;
}

/* ==========================================================
PRINT STYLES (@media print)
========================================================== */

@media print {

/* ==========================================================
1. HIDE PROCLAIM NON-PRINT ELEMENTS
========================================================== */

/* Print button (in popup window) */
.proclaim-print-btn,
.proclaim-no-print {
display: none !important;
}

/* Social sharing (AddToAny) - CSS fallback for custom templates */
.proclaim-share,
.a2a_kit,
.a2a_default_style,
[class*="a2a_button_"],
.a2a_dd {
display: none !important;
}

/* Comments section */
.proclaim-comments-toggle,
#JBScomments,
#commentstable,
#commentForm {
display: none !important;
}

/* Podcast subscribe */
.podcast_subscribe,
.proclaim-podcast-subscribe {
display: none !important;
}

/* Navigation elements */
.proclaim-skip-link,
.listingfooter,
.proclaim-footer-link {
display: none !important;
}

/* Media players and interactive elements */
iframe,
video,
audio,
.proclaim-media-player,
.cwm-fancybox,
.fancybox-container,
.media-download-btn,
.btn-group .dropdown-toggle {
display: none !important;
}

/* YouTube thumbnails and icons */
a[href*="youtube"] img,
a[href*="youtu.be"] img,
.fa-youtube {
display: none !important;
}

/* ==========================================================
2. SCRIPTURE PASSAGE
The PHP template renders a text-only version of the
passage in print mode (.passage-print), so the interactive
toggle + iframe version is not output. These rules style
the print-friendly passage block.
========================================================== */

/* Hide the original interactive passage elements (fallback) */
.fluid-row > .col-12 > a.heading,
a.heading > .fas.fa-bible,
a.heading > i.fas.fa-bible {
display: none !important;
}

.passage,
.passage iframe {
display: none !important;
}

/* Style the print-friendly passage reference */
.passage-print {
margin: 12pt 0;
padding: 8pt 0;
border-top: 1pt solid #ccc;
border-bottom: 1pt solid #ccc;
}

.passage-print h3 {
font-size: 14pt;
margin-bottom: 4pt;
}

/* ==========================================================
3. PRINT-OPTIMIZED TYPOGRAPHY
========================================================== */

body {
font-size: 12pt !important;
line-height: 1.5 !important;
color: #000 !important;
background: #fff !important;
}

.proclaim-main-content {
max-width: 100% !important;
padding: 0 !important;
margin: 0 !important;
}

h1, .page-header h1 {
font-size: 18pt !important;
color: #000 !important;
border-bottom: 1pt solid #ccc;
padding-bottom: 6pt;
margin-bottom: 12pt;
}

h2, h3, h4 {
color: #000 !important;
page-break-after: avoid;
}

/* Scripture references */
.article-info,
.article-info dd {
color: #333 !important;
}

/* Archive badge - plain text in print */
.proclaim-archive-badge {
border: 1pt solid #999;
color: #666 !important;
background: none !important;
padding: 1pt 4pt;
font-size: 9pt;
}

/* Study text / main content */
.com-content-article__body,
[itemprop="articleBody"] {
font-size: 12pt;
line-height: 1.6;
}

/* ==========================================================
4. PAGE BREAK CONTROL
========================================================== */

.page-header {
page-break-after: avoid;
}

p, li, dd {
orphans: 3;
widows: 3;
}

/* ==========================================================
5. LINKS - show URL in print for external links
========================================================== */

.proclaim-main-content a[href^="http"]::after {
content: " (" attr(href) ")";
font-size: 9pt;
color: #666;
word-break: break-all;
}

/* Don't show URL for anchors, javascript, or heading links */
a[href^="#"]::after,
a[href^="javascript:"]::after,
.page-header a::after {
content: "" !important;
}

/* ==========================================================
6. IMAGES AND TABLES
========================================================== */

img {
max-width: 100% !important;
page-break-inside: avoid;
}

table {
border-collapse: collapse;
}

table, th, td {
border: 1pt solid #ccc;
}

th, td {
padding: 4pt 8pt;
}

/* ==========================================================
7. FLUID LISTING (layout editor output)
========================================================== */

.proclaim-listing-row {
page-break-inside: avoid;
}

/* Fluid listing rows - hide YouTube media content */
.fluid-row img[src*="youtube"],
.fluid-row .fa-youtube {
display: none !important;
}
}
5 changes: 5 additions & 0 deletions media/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@
"type": "style",
"uri": "com_proclaim/general.min.css"
},
{
"name": "com_proclaim.print",
"type": "style",
"uri": "com_proclaim/proclaim-print.css"
},
{
"name": "com_proclaim.podcast",
"type": "style",
Expand Down
6 changes: 6 additions & 0 deletions site/src/View/Cwmsermon/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ public function display($tpl = null): void
$model->hit();
}

// Set print mode from request
$this->print = $app->getInput()->getString('print', '');

// Load print stylesheet
$this->getDocument()->getWebAssetManager()->useStyle('com_proclaim.print');

$this->prepareDocument();

parent::display($tpl);
Expand Down
43 changes: 33 additions & 10 deletions site/tmpl/cwmsermon/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,31 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;

$isPrint = !empty($this->print);
?>
<a href="#proclaim-main-content" class="proclaim-skip-link"><?php echo Text::_('JBS_CMN_SKIP_TO_CONTENT'); ?></a>
<div class="container-fluid proclaim-main-content" id="proclaim-main-content" role="main"><?php
<div class="container-fluid proclaim-main-content<?php echo $isPrint ? ' proclaim-print-mode' : ''; ?>" id="proclaim-main-content" role="main">
<?php if (!$isPrint) : ?>
<?php
$printUrl = Uri::getInstance();
$printUrl->setVar('tmpl', 'component');
$printUrl->setVar('print', '1');
?>
<div class="proclaim-print-btn text-end mb-2">
<a href="<?php echo htmlspecialchars($printUrl->toString()); ?>" onclick="window.open(this.href,'printWindow','width=800,height=600,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes');return false;" class="btn btn-sm btn-outline-secondary" title="<?php echo Text::_('JBS_CMN_PRINT'); ?>">
<span class="fas fa-print" aria-hidden="true"></span> <?php echo Text::_('JBS_CMN_PRINT'); ?>
</a>
</div>
<?php else : ?>
<div class="proclaim-print-btn text-end mb-2 proclaim-no-print">
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="window.print();return false;" title="<?php echo Text::_('JBS_CMN_PRINT'); ?>">
<span class="fas fa-print" aria-hidden="true"></span> <?php echo Text::_('JBS_CMN_PRINT'); ?>
</button>
</div>
<?php endif; ?>
<?php

if ($this->item->params->get('sermontemplate') && !$this->simple->mode) {
echo $this->loadTemplate($this->item->params->get('sermontemplate'));
Expand All @@ -33,19 +54,21 @@
echo '<div>' . $this->loadTemplate('main') . '</div>';
}

$show_comments = $this->item->params->get('show_comments');
if (!$isPrint) {
$show_comments = $this->item->params->get('show_comments');

if ($show_comments >= 1) {
$user = Factory::getApplication()->getIdentity();
$groups = $user->getAuthorisedViewLevels();
if ($show_comments >= 1) {
$user = Factory::getApplication()->getIdentity();
$groups = $user->getAuthorisedViewLevels();

if (\in_array($show_comments, $groups, false)) {
echo '<div style="padding-top: 10px; margin: auto;">' . $this->loadTemplate('commentsform') . '</div>';
if (\in_array($show_comments, $groups, false)) {
echo '<div style="padding-top: 10px; margin: auto;">' . $this->loadTemplate('commentsform') . '</div>';
}
}
}

echo $this->loadTemplate('footer');
echo $this->loadTemplate('footerlink');
echo $this->loadTemplate('footer');
echo $this->loadTemplate('footerlink');
}

?>
</div><!--end of container fluid-->
7 changes: 4 additions & 3 deletions site/tmpl/cwmsermon/default_fluidsermondetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
</div>
</div>
<?php
echo $this->print;
echo $this->page->social;
//echo $this->related;
$isPrint = !empty($this->print);
if (!$isPrint) {
echo $this->page->social;
}
?>
<br/>
<h2 style="text-align:center;">
Expand Down
Loading