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

[4.0] Add a parameter for "back-to-top" button in Cassiopeia #30441

Merged
merged 11 commits into from
Aug 26, 2020
1 change: 1 addition & 0 deletions language/en-GB/tpl_cassiopeia.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ TPL_CASSIOPEIA_FLUID_LABEL="Fluid Layout"
TPL_CASSIOPEIA_LOGO_LABEL="Logo"
TPL_CASSIOPEIA_STATIC="Static"
TPL_CASSIOPEIA_STICKY_LABEL="Sticky Header"
TPL_CASSIOPEIA_BACKTOP_LABEL="Back-to-top button"
drmenzelit marked this conversation as resolved.
Show resolved Hide resolved
TPL_CASSIOPEIA_TOGGLE="Toggle Navigation"
TPL_CASSIOPEIA_XML_DESCRIPTION="Continuing the space theme (Solarflare from 1.0, Milkyway from 1.5 and Protostar from 3.0), Cassiopeia is the Joomla 4 site template based on Bootstrap 4."
9 changes: 4 additions & 5 deletions templates/cassiopeia/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,15 @@
</div>
<?php endif; ?>

<?php if ($this->countModules('footer')) : ?>
<?php if ($this->countModules('footer') || ($this->params->get('backTop') == 1)) : ?>
<footer class="grid-child container-footer footer">
<hr>
<p class="float-right">
<jdoc:include type="modules" name="footer" style="none" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test after installing blog sample data.
The menu module is next to the button, so much that they look related. This is really confusing.

<?php if ($this->params->get('backTop') == 1) : ?>
<a href="#top" id="back-top" class="back-top">
<span class="fas fa-arrow-up" aria-hidden="true"></span>
<span class="sr-only"><?php echo Text::_('TPL_CASSIOPEIA_BACKTOTOP'); ?></span>
</a>
</p>
<jdoc:include type="modules" name="footer" style="none" />
<?php endif; ?>
</footer>
<?php endif; ?>

Expand Down
1 change: 1 addition & 0 deletions templates/cassiopeia/scss/blocks/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
border-radius: 3px;

@include margin("right", 5px);
@include margin("left", auto);
}
}
12 changes: 12 additions & 0 deletions templates/cassiopeia/templateDetails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="backTop"
type="radio"
label="TPL_CASSIOPEIA_BACKTOP_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
filter="integer"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
</fields>
</config>
Expand Down