-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOE-3584: Adding print--html.tpl.php for the print 2.2 upgrade #7
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Default theme implementation to display a printer-friendly version page. | ||
* | ||
* This file is akin to Drupal's page.tpl.php template. The contents being | ||
* displayed are all included in the $content variable, while the rest of the | ||
* template focuses on positioning and theming the other page elements. | ||
* | ||
* All the variables available in the page.tpl.php template should also be | ||
* available in this template. In addition to those, the following variables | ||
* defined by the print module(s) are available: | ||
* | ||
* Arguments to the theme call: | ||
* - $node: The node object. For node content, this is a normal node object. | ||
* For system-generated pages, this contains usually only the title, path | ||
* and content elements. | ||
* - $format: The output format being used ('html' for the Web version, 'mail' | ||
* for the send by email, 'pdf' for the PDF version, etc.). | ||
* - $expand_css: TRUE if the CSS used in the file should be provided as text | ||
* instead of a list of @include directives. | ||
* - $message: The message included in the send by email version with the | ||
* text provided by the sender of the email. | ||
* | ||
* Variables created in the preprocess stage: | ||
* - $print_logo: the image tag with the configured logo image. | ||
* - $content: the rendered HTML of the node content. | ||
* - $scripts: the HTML used to include the JavaScript files in the page head. | ||
* - $footer_scripts: the HTML to include the JavaScript files in the page | ||
* footer. | ||
* - $sourceurl_enabled: TRUE if the source URL infromation should be | ||
* displayed. | ||
* - $url: absolute URL of the original source page. | ||
* - $source_url: absolute URL of the original source page, either as an alias | ||
* or as a system path, as configured by the user. | ||
* - $cid: comment ID of the node being displayed. | ||
* - $print_title: the title of the page. | ||
* - $head: HTML contents of the head tag, provided by drupal_get_html_head(). | ||
* - $robots_meta: meta tag with the configured robots directives. | ||
* - $css: the syle tags contaning the list of include directives or the full | ||
* text of the files for inline CSS use. | ||
* - $sendtoprinter: depending on configuration, this is the script tag | ||
* including the JavaScript to send the page to the printer and to close the | ||
* window afterwards. | ||
* | ||
* print[--format][--node--content-type[--nodeid]].tpl.php | ||
* | ||
* The following suggestions can be used: | ||
* 1. print--format--node--content-type--nodeid.tpl.php | ||
* 2. print--format--node--content-type.tpl.php | ||
* 3. print--format.tpl.php | ||
* 4. print--node--content-type--nodeid.tpl.php | ||
* 5. print--node--content-type.tpl.php | ||
* 6. print.tpl.php | ||
* | ||
* Where format is the ouput format being used, content-type is the node's | ||
* content type and nodeid is the node's identifier (nid). | ||
* | ||
* @see print_preprocess_print() | ||
* @see theme_print_published | ||
* @see theme_print_breadcrumb | ||
* @see theme_print_footer | ||
* @see theme_print_sourceurl | ||
* @see theme_print_url_list | ||
* @see page.tpl.php | ||
* @ingroup print | ||
*/ | ||
?> | ||
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" | ||
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"> | ||
<head> | ||
<?php print $head; ?> | ||
<base href='<?php print $url ?>' /> | ||
<title><?php print $print_title; ?></title> | ||
<?php print $scripts; ?> | ||
<?php if (isset($sendtoprinter)) print $sendtoprinter; ?> | ||
<?php print $robots_meta; ?> | ||
<?php if (theme_get_setting('toggle_favicon')): ?> | ||
<link rel='shortcut icon' href='<?php print theme_get_setting('favicon') ?>' type='image/x-icon' /> | ||
<?php endif; ?> | ||
<?php print $css; ?> | ||
</head> | ||
<body> | ||
<?php if (!empty($message)): ?> | ||
<div class="print-message"><?php print $message; ?></div><p /> | ||
<?php endif; ?> | ||
<?php if ($print_logo): ?> | ||
<div class="print-logo"><?php print $print_logo; ?></div> | ||
<?php endif; ?> | ||
<div class="print-site_name"><?php print theme('print_published'); ?></div> | ||
<p /> | ||
<div class="print-breadcrumb"><?php print theme('print_breadcrumb', array('node' => $node)); ?></div> | ||
<hr class="print-hr" /> | ||
<?php if (!isset($node->type)): ?> | ||
<h2 class="print-title"><?php print $print_title; ?></h2> | ||
<?php endif; ?> | ||
<div class="print-content"><?php print $content; ?></div> | ||
<div class="print-footer"><?php print theme('print_footer'); ?></div> | ||
<hr class="print-hr" /> | ||
<?php if ($sourceurl_enabled): ?> | ||
<div class="print-source_url"> | ||
<?php print theme('print_sourceurl', array('url' => $source_url, 'node' => $node, 'cid' => $cid)); ?> | ||
</div> | ||
<?php endif; ?> | ||
<div class="print-links"><?php print theme('print_url_list'); ?></div> | ||
<?php print $footer_scripts; ?> | ||
</body> | ||
</html> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution looks good but I have a couple of questions to understand the issue and resolution path.
Why have you added this theme hook here? Where did it go in print 2.2? Was this ever an option?
What I want to know is why it worked before and why you chose to fix this issue by adding it to this module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sherakama I added it there because I didn't want to put it in the theme and the regions module is where the digital magazine template is located, so it seemed proper.
As far as why it worked before, I'm not 100% sure on that, but it had something to do with this: https://www.drupal.org/node/2276407
I figured I could get it working in 2.2 and then get a template to load correctly.