fluentcms-jumbotron
Displaying a Bootstrap 3 Jumbotron in a page
Installation
First install the module, preferably in a virtual environment. It can be installed from PyPI:
pip install fluentcms-jumbotron
First make sure the project is configured for django-fluent-contents.
Then add the following settings:
INSTALLED_APPS += (
'fluentcms_jumbotron',
)
FLUENT_CONTENTS_PLACEHOLDER_CONFIG = {
'slot name': {
'plugins': ('JumbotronPlugin', ...),
},
}
The database tables can be created afterwards:
./manage.py migrate
Frontend styling
The jumbotron is rendered with the HTML that Bootstrap prescribes:
<div class="jumbotron">
<h1>Hello, world!</h1>
<p>...</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
The standard Bootstrap 3 CSS will provide a reasonable styling for this, which can either be overwritten, or replaced in your own CSS files. The defaults provided by Bootstap 3 is: https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_jumbotron.scss
Customizing
Centering, adding backgrounds, etc.. all happen by adding CSS styling. For example:
.jumbotron {
background: url('/static/frontend/images/background.jpg') no-repeat fixed 0 0;
background-size: cover;
color: #fff;
text-align: center;
}
.jumbotron .btn {
margin-top: 12px; /* For Sass: $padding-base-vertical * 2; */
}
When you use Sass, you can also override the Sass variables.
Full page width
To display the Bootstrap Jumbotron full page, you likely need to break out of the container the JumbotronPlugin is rendered in. For example, when your page looks like:
<div class="container">
{% page_placeholder "homepage" title="Homepage" role="m" %}
</div>
You can change that into:
<div class="container">
{% page_placeholder "homepage" title="Homepage" role="m" template="pages/placeholders/homepage.html" cachable=1 %}
</div>
The pages/placeholders/homepage.html template looks like:
{% for contentitem, html in contentitems %}
{% if contentitem.plugin.name == 'JumbotronPlugin' %}
</div>
{{ html }}
<div class="container">
{% else %}
{{ html }}
{% endif %}
{% endfor %}
Note the exact HTML tags depend on your frontend HTML layout.
The cachable=1 flag is a promise that the template always returns the same result for every request. Otherwise, remove it.
Contributing
If you like this module, forked it, or would like to improve it, please let us know! Pull requests are welcome too. :-)
Metadata
Release files for fluentcms-jumbotron 3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fluentcms-jumbotron-3.0.tar.gz | 13.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fluentcms_jumbotron-3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.0 kB
Release files / fluentcms-jumbotron-3.0.tar.gz
| Download URL | fluentcms-jumbotron-3.0.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c63cb8fd05e92b864bdd33d13ad4fa0cb7f589a0c27c79865483bb0e91e8f9c
|
|
BLAKE2b-256 checksum How to use checksums |
84fc70419eefe60f4cf512c5b107fdb5e9a8672a2f1aa4b6741a2f1c61e52d56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
|
Release files / fluentcms_jumbotron-3.0-py3-none-any.whl
| Download URL | fluentcms_jumbotron-3.0-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38c9861a869b9084fd5a4a12b330a45d7429580a77767d9948738a60945ca524
|
|
BLAKE2b-256 checksum How to use checksums |
dd437e4ff00c3044e839a84a7fc315c58d0b1737c92183c01f9b3db29aacaa5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
|
Security for fluentcms-jumbotron 3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.