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

New template blocks - page preview block template #308

Closed
zafon18 opened this issue Apr 4, 2020 · 2 comments
Closed

New template blocks - page preview block template #308

zafon18 opened this issue Apr 4, 2020 · 2 comments
Labels
Type: Question Further information is requested

Comments

@zafon18
Copy link

zafon18 commented Apr 4, 2020

Hi,

I'm trying to add a new template to page preview block template. I suggested this entry
page preview block template
file base.py

CODERED_FRONTEND_TEMPLATES_BLOCKS = {
 'FRONTEND_TEMPLATES_BLOCKS': {
  'pagepreviewblock': (
             ('coderedcms/blocks/pagepreview_media_list.html', 'Media list'),
        ),
    },
}

Unfortunately, all templates in the admin disappear.
Thank you for your help
#Be healthy!

@zafon18 zafon18 added the Type: Question Further information is requested label Apr 4, 2020
@vsalvino
Copy link
Contributor

vsalvino commented Apr 11, 2020

You will need to copy the entire contents of FRONTEND_TEMPLATES_BLOCKS into CODERED_FRONTEND_TEMPLATES_BLOCKS in your settings. Then update with your custom additions. I realize this is not ideal, but it is how it works at the moment.

For this reason, I would also recommend making your custom templates under website/ (or a custom app) rather than under the coderedcms/ folder. If you are overriding one of our built-in templates, then that would have to go within the coderedcms/ templates folder.

'cardblock': (
('coderedcms/blocks/card_block.html', 'Card'),
('coderedcms/blocks/card_head.html', 'Card with header'),
('coderedcms/blocks/card_foot.html', 'Card with footer'),
('coderedcms/blocks/card_head_foot.html', 'Card with header and footer'),
('coderedcms/blocks/card_blurb.html', 'Blurb - rounded image and no border'),
('coderedcms/blocks/card_img.html', 'Cover image - use image as background'),
),
'cardgridblock': (
('coderedcms/blocks/cardgrid_group.html', 'Card group - attached cards of equal size'),
('coderedcms/blocks/cardgrid_deck.html', 'Card deck - separate cards of equal size'),
('coderedcms/blocks/cardgrid_columns.html', 'Card masonry - fluid brick pattern'),
),
'pagelistblock': (
('coderedcms/blocks/pagelist_block.html', 'General, simple list'),
('coderedcms/blocks/pagelist_list_group.html', 'General, list group navigation panel'),
('coderedcms/blocks/pagelist_article_media.html', 'Article, media format'),
('coderedcms/blocks/pagelist_article_card_group.html',
'Article, card group - attached cards of equal size'),
('coderedcms/blocks/pagelist_article_card_deck.html',
'Article, card deck - separate cards of equal size'),
('coderedcms/blocks/pagelist_article_card_columns.html',
'Article, card masonry - fluid brick pattern'),
),
'pagepreviewblock': (
('coderedcms/blocks/pagepreview_card.html', 'Card'),
('coderedcms/blocks/pagepreview_form.html', 'Form inputs'),
),
# templates that are available for all block types
'*': (
('', 'Default'),
),

@zafon18
Copy link
Author

zafon18 commented Apr 21, 2020

Thank you for your help, I didn't do it correctly. Now everything works

correct

CODERED_FRONTEND_TEMPLATES_BLOCKS = {

        'cardblock': (
            ('coderedcms/blocks/card_block.html', 'Card'),
            ('coderedcms/blocks/card_head.html', 'Card with header'),
            ('coderedcms/blocks/card_foot.html', 'Card with footer'),
            ('coderedcms/blocks/card_head_foot.html', 'Card with header and footer'),
            ('coderedcms/blocks/card_blurb.html', 'Blurb - rounded image and no border'),
            ('coderedcms/blocks/card_img.html', 'Cover image - use image as background'),
        ),
        'cardgridblock': (
            ('coderedcms/blocks/cardgrid_group.html', 'Card group - attached cards of equal size'),
            ('coderedcms/blocks/cardgrid_deck.html', 'Card deck - separate cards of equal size'),
            ('coderedcms/blocks/cardgrid_columns.html', 'Card masonry - fluid brick pattern'),
        ),
        'pagelistblock': (
            ('coderedcms/blocks/pagelist_block.html', 'General, simple list'),
            ('coderedcms/blocks/pagelist_list_group.html', 'General, list group navigation panel'),
            ('coderedcms/blocks/pagelist_article_media.html', 'Article, media format'),
            ('coderedcms/blocks/pagelist_article_card_group.html',
                'Article, card group - attached cards of equal size'),
            ('coderedcms/blocks/pagelist_article_card_deck.html',
             'Article, card deck - separate cards of equal size'),
            ('coderedcms/blocks/pagelist_article_card_columns.html',
             'Article, card masonry - fluid brick pattern'),
        ),
        'pagepreviewblock': (
            ('coderedcms/blocks/pagepreview_card.html', 'Card'),
            ('coderedcms/blocks/pagepreview_form.html', 'Form inputs'),
            ('coderedcms/blocks/pagepreview_media_list.html', 'Media list'),  #--> New template
        ),
        '*': (
            ('', 'Default'),
        ),
}

@zafon18 zafon18 closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants