coalition.content.models.content_block
ContentBlock model for flexible homepage content sections.
Classes
ContentBlock
|
Flexible content blocks that can be added to any page. |
Module Contents
-
class coalition.content.models.content_block.ContentBlock(*args, **kwargs)[source]
Bases: django.db.models.Model
Flexible content blocks that can be added to any page.
Allows for dynamic content sections beyond the fixed structure.
-
BLOCK_TYPES = [('text', 'Text Block'), ('image', 'Image Block'), ('text_image', 'Text + Image Block'),...[source]
-
PAGE_TYPES = [('homepage', 'Homepage'), ('about', 'About Page'), ('campaigns', 'Campaigns Page'), ('contact',...[source]
-
LAYOUT_OPTIONS = [('default', 'Text Left, Image Right'), ('reversed', 'Image Left, Text Right'), ('stacked',...[source]
-
VERTICAL_ALIGNMENT_OPTIONS = [('top', 'Top'), ('middle', 'Center'), ('bottom', 'Bottom')][source]
-
ANIMATION_OPTIONS = [('fade-in', 'Fade In'), ('slide-up', 'Slide Up'), ('slide-left', 'Slide from Left'),...[source]
-
page_type[source]
-
title[source]
-
block_type[source]
-
content[source]
-
image[source]
-
layout_option[source]
-
vertical_alignment[source]
-
css_classes[source]
-
background_color[source]
-
animation_type[source]
-
animation_delay[source]
-
order[source]
-
is_visible[source]
-
created_at[source]
-
updated_at[source]
-
class Meta[source]
-
db_table = 'content_block'[source]
-
ordering = ['order', 'created_at'][source]
-
verbose_name = 'Content Block'[source]
-
verbose_name_plural = 'Content Blocks'[source]
-
__str__() → str[source]
-
property image_url: str[source]
Return the URL of the uploaded image, or empty string if no image.
-
property image_alt_text: str[source]
Return the alt text of the image, or empty string if no image.
-
property image_title: str[source]
Return the title of the image, or empty string if no image.
-
property image_author: str[source]
Return the author of the image, or empty string if no image.
-
property image_license: str[source]
Return the license of the image, or empty string if no image.
-
property image_source_url: str[source]
Return the source URL of the image, or empty string if no image.
-
property image_caption: str[source]
Return the caption of the image, or empty string if no image.
-
property image_caption_display: str[source]
Return the caption display setting of the image, or ‘below’ if no image.
-
save(*args: Any, **kwargs: Any) → None[source]
Sanitize content based on block type before saving.