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

Carousel doesn't show child pages of a page with latest pages #530

Closed
KingWaffleIII opened this issue Sep 26, 2022 · 5 comments
Closed

Carousel doesn't show child pages of a page with latest pages #530

KingWaffleIII opened this issue Sep 26, 2022 · 5 comments
Labels
Type: Question Further information is requested

Comments

@KingWaffleIII
Copy link

The Wagtail CRX wiki on carousels says:

You define your carousels in the Snippets > Carousel section of the admin. Once defined, any page with a body streamfield can show that carousel by selecting it with a carousel block.

So I did just that in my Wagtail admin, I made a Carousel snippet which should preview some pages. However, when I edit my home page (which should have a body streamfield), I only get the options for a hero unit, card grid, etc. Am I missing something really simple here or do I have to enable something?

Adding a navbar and footer worked fine since I could add these in CRX settings in the admin.

@KingWaffleIII KingWaffleIII added the Type: Question Further information is requested label Sep 26, 2022
@vsalvino
Copy link
Contributor

vsalvino commented Sep 27, 2022

To add a carousel from our default body setup, you will need to select Responsive Grid Row > Column > Carousel.

You can also access the Responsive Grid Row within a Hero Unit block.

@KingWaffleIII
Copy link
Author

Hello,
Many thanks for the help - I was able to add the carousel now.
However, my carousel is designed to show the latest content from my news page so I configured it to show the latest pages from the news page's child pages. However, once I added the carousel, I only see the following:
image
If I choose the carousel to show an image instead, this works fine?

@KingWaffleIII KingWaffleIII changed the title Can't add a carousel snippet to a web page? Carousel doesn't show child pages of a page with latest pages Sep 27, 2022
@vsalvino
Copy link
Contributor

When creating the carousel, you have to add slides. I'm guessing you added the content of the first slide to be "latest pages". This should work (assuming your news page and its child pages are all published).

However, it might not work as you expect. It will not generate a new slide for each article. It will show all of the articles on the first slide.

To help debug, can you make sure your news page and its child pages are published. Then inspect the source of the carousel screenshotted above. See if there is any indication of those pages in that slide. It is possible they may not be visible due to CSS.

@KingWaffleIII
Copy link
Author

Yep, you're right - it is a CSS issue. Upon adding a background image, the text is now viewable.
You're also right in that the carousel doesn't work how I wanted it to so I guess I'm not going to use that.

At any rate, thank you for your help!

@vsalvino
Copy link
Contributor

vsalvino commented Sep 28, 2022

I would recommend creating a custom html template for the LatestPages block (there are currently a couple built-in ones under Advanced Settings). Then you can make your custom template render as a bootstrap carousel for each page. This would require some development.

The process for adding a custom template is not perfect yet, but all you need to do is add CRX_FRONTEND_TEMPLATES_BLOCKS to your Django settings. I'd recommend copying our default one, and adding your custom template under "pagelistblock".

CRX_FRONTEND_TEMPLATES_BLOCKS = {

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