Skip to content
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

Adding postcard layouts using Display Suite templates. #303

Open
wants to merge 1 commit into
base: 7.x-2.x
Choose a base branch
from
Open
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
44 changes: 44 additions & 0 deletions ds_layouts/postcard_left/postcard-left.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* @file
* Display Suite Postcard Left template.
*
* Available variables:
*
* Layout:
* - $classes: String of classes that can be used to style this layout.
* - $contextual_links: Renderable array of contextual links.
* - $layout_wrapper: wrapper surrounding the layout.
*
* Regions:
*
* - $image: Rendered content for the "Image" region.
* - $image_classes: String of classes that can be used to style the "Image" region.
*
* - $text: Rendered content for the "Text" region.
* - $text_classes: String of classes that can be used to style the "Text" region.
*/
?>
<<?php print $layout_wrapper; print $layout_attributes; ?> class="<?php print $classes;?> clearfix">

<!-- Needed to activate contextual links -->
<?php if (isset($title_suffix['contextual_links'])): ?>
<?php print render($title_suffix['contextual_links']); ?>
<?php endif; ?>

<div class="postcard-left">
<<?php print $image_wrapper; ?> class="ds-image<?php print $image_classes; ?>">
<?php print $image; ?>
</<?php print $image_wrapper; ?>>

<<?php print $text_wrapper; ?> class="ds-text<?php print $text_classes; ?>">
<?php print $text; ?>
</<?php print $text_wrapper; ?>>
</div>

</<?php print $layout_wrapper ?>>

<!-- Needed to activate display suite support on forms -->
<?php if (!empty($drupal_render_children)): ?>
<?php print $drupal_render_children ?>
<?php endif; ?>
20 changes: 20 additions & 0 deletions ds_layouts/postcard_left/postcard_left.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/**
* @file
* Display Suite Postcard Left configuration.
*/

function ds_postcard_left() {
return array(
'label' => t('Postcard Left'),
'regions' => array(
'image' => t('Image'),
'text' => t('Text'),
),
// Uncomment if you want to include a CSS file for this layout (postcard_left.css)
// 'css' => TRUE,
// Uncomment if you want to include a preview for this layout (postcard_left.png)
// 'image' => TRUE,
);
}
44 changes: 44 additions & 0 deletions ds_layouts/postcard_left_wrap/postcard-left-wrap.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* @file
* Display Suite Postcard Left Wrap template.
*
* Available variables:
*
* Layout:
* - $classes: String of classes that can be used to style this layout.
* - $contextual_links: Renderable array of contextual links.
* - $layout_wrapper: wrapper surrounding the layout.
*
* Regions:
*
* - $image: Rendered content for the "Image" region.
* - $image_classes: String of classes that can be used to style the "Image" region.
*
* - $text: Rendered content for the "Text" region.
* - $text_classes: String of classes that can be used to style the "Text" region.
*/
?>
<<?php print $layout_wrapper; print $layout_attributes; ?> class="<?php print $classes;?> clearfix">

<!-- Needed to activate contextual links -->
<?php if (isset($title_suffix['contextual_links'])): ?>
<?php print render($title_suffix['contextual_links']); ?>
<?php endif; ?>

<div class="postcard-left-wrap">
<<?php print $image_wrapper; ?> class="ds-image<?php print $image_classes; ?>">
<?php print $image; ?>
</<?php print $image_wrapper; ?>>

<<?php print $text_wrapper; ?> class="ds-text<?php print $text_classes; ?>">
<?php print $text; ?>
</<?php print $text_wrapper; ?>>
</div>

</<?php print $layout_wrapper ?>>

<!-- Needed to activate display suite support on forms -->
<?php if (!empty($drupal_render_children)): ?>
<?php print $drupal_render_children ?>
<?php endif; ?>
20 changes: 20 additions & 0 deletions ds_layouts/postcard_left_wrap/postcard_left_wrap.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/**
* @file
* Display Suite Postcard Left Wrap configuration.
*/

function ds_postcard_left_wrap() {
return array(
'label' => t('Postcard Left Wrap'),
'regions' => array(
'image' => t('Image'),
'text' => t('Text'),
),
// Uncomment if you want to include a CSS file for this layout (postcard_left_wrap.css)
// 'css' => TRUE,
// Uncomment if you want to include a preview for this layout (postcard_left_wrap.png)
// 'image' => TRUE,
);
}
44 changes: 44 additions & 0 deletions ds_layouts/postcard_right/postcard-right.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* @file
* Display Suite Postcard Right template.
*
* Available variables:
*
* Layout:
* - $classes: String of classes that can be used to style this layout.
* - $contextual_links: Renderable array of contextual links.
* - $layout_wrapper: wrapper surrounding the layout.
*
* Regions:
*
* - $image: Rendered content for the "Image" region.
* - $image_classes: String of classes that can be used to style the "Image" region.
*
* - $text: Rendered content for the "Text" region.
* - $text_classes: String of classes that can be used to style the "Text" region.
*/
?>
<<?php print $layout_wrapper; print $layout_attributes; ?> class="<?php print $classes;?> clearfix">

<!-- Needed to activate contextual links -->
<?php if (isset($title_suffix['contextual_links'])): ?>
<?php print render($title_suffix['contextual_links']); ?>
<?php endif; ?>

<div class="postcard-right">
<<?php print $image_wrapper; ?> class="ds-image<?php print $image_classes; ?>">
<?php print $image; ?>
</<?php print $image_wrapper; ?>>

<<?php print $text_wrapper; ?> class="ds-text<?php print $text_classes; ?>">
<?php print $text; ?>
</<?php print $text_wrapper; ?>>
</div>

</<?php print $layout_wrapper ?>>

<!-- Needed to activate display suite support on forms -->
<?php if (!empty($drupal_render_children)): ?>
<?php print $drupal_render_children ?>
<?php endif; ?>
20 changes: 20 additions & 0 deletions ds_layouts/postcard_right/postcard_right.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/**
* @file
* Display Suite Postcard Right configuration.
*/

function ds_postcard_right() {
return array(
'label' => t('Postcard Right'),
'regions' => array(
'image' => t('Image'),
'text' => t('Text'),
),
// Uncomment if you want to include a CSS file for this layout (postcard_right.css)
// 'css' => TRUE,
// Uncomment if you want to include a preview for this layout (postcard_right.png)
// 'image' => TRUE,
);
}
44 changes: 44 additions & 0 deletions ds_layouts/postcard_right_wrap/postcard-right-wrap.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* @file
* Display Suite Postcard Right Wrap template.
*
* Available variables:
*
* Layout:
* - $classes: String of classes that can be used to style this layout.
* - $contextual_links: Renderable array of contextual links.
* - $layout_wrapper: wrapper surrounding the layout.
*
* Regions:
*
* - $image: Rendered content for the "Image" region.
* - $image_classes: String of classes that can be used to style the "Image" region.
*
* - $text: Rendered content for the "Text" region.
* - $text_classes: String of classes that can be used to style the "Text" region.
*/
?>
<<?php print $layout_wrapper; print $layout_attributes; ?> class="<?php print $classes;?> clearfix">

<!-- Needed to activate contextual links -->
<?php if (isset($title_suffix['contextual_links'])): ?>
<?php print render($title_suffix['contextual_links']); ?>
<?php endif; ?>

<div class="postcard-right-wrap">
<<?php print $image_wrapper; ?> class="ds-image<?php print $image_classes; ?>">
<?php print $image; ?>
</<?php print $image_wrapper; ?>>

<<?php print $text_wrapper; ?> class="ds-text<?php print $text_classes; ?>">
<?php print $text; ?>
</<?php print $text_wrapper; ?>>
</div>

</<?php print $layout_wrapper ?>>

<!-- Needed to activate display suite support on forms -->
<?php if (!empty($drupal_render_children)): ?>
<?php print $drupal_render_children ?>
<?php endif; ?>
20 changes: 20 additions & 0 deletions ds_layouts/postcard_right_wrap/postcard_right_wrap.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/**
* @file
* Display Suite Postcard Right Wrap configuration.
*/

function ds_postcard_right_wrap() {
return array(
'label' => t('Postcard Right Wrap'),
'regions' => array(
'image' => t('Image'),
'text' => t('Text'),
),
// Uncomment if you want to include a CSS file for this layout (postcard_right_wrap.css)
// 'css' => TRUE,
// Uncomment if you want to include a preview for this layout (postcard_right_wrap.png)
// 'image' => TRUE,
);
}