Page 1 of 1
Problem with cards after publishing
Posted: Mon Mar 22, 2021 8:26 pm
by KIRK
Hello everybody!
I have a problem with cards in the card container.
Everything looks good in the preview. However, if I publish the page, the cards overlap. Then if I refresh the page a couple of times, it shows up correctly.
Does anyone have any idea where the error is here?
Demoproject At the bottom of the project is the screenshot of the preview.
Thanks in advance
KIRK
Re: Problem with cards after publishing
Posted: Mon Mar 22, 2021 8:54 pm
by Pablo
I do not see any problems in the project or generated code
Re: Problem with cards after publishing
Posted: Mon Mar 22, 2021 9:09 pm
by BaconFries
I did notice one thing that may or may not be the issue. In the source your index page is showing as index.js and not index.html Try doing the following
Go to Tools-> Options-> HTML and make sure in the Javascript section that "Move Javascripts to end of the page" is unchecked.
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 7:01 am
by KIRK
Thank you both for the quick replies.
Sorry, it's still overlapping for me.
Via the Demoproject link you can find what it looks like after publishing (two images at the end). Tested on several Windows 10 computers and several browsers (Edge, Chrome, FF). It seems to look fine on an iPad with Safari.
I checked the "Move Javascripts to end of the page" function. It is unschecked!
I must have a mistake in here somewhere.
Any idea!
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 9:58 am
by Pablo
Did you also try with "Move Javascripts to end of the page" enabled?
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 2:51 pm
by KIRK
Hello Pablo,
I have now "Move Javascripts to end of the page" enabled.
It seems to work now in the demo project. But unfortunately not in my final project.
Can this have anything to do with the gallery?
I have to try "Load built-in JavaScript files asyncronously" enabled.
Then the cards work, but the gallery no longer works.
Can you take a look at the final project there?
Project
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 2:57 pm
by Pablo
The link to your project does not work for me.
But I think it is related to the way masonry (which is a third party script) works. It has to do with timing. There are too many images so it will take to long for the script calculate the final sizes.
So, in this combination 'masonry' cannot be used.
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 3:09 pm
by KIRK
Does the link work now?
Do you mean masonry of the cards? There are six cards with one picture each. Or in combination with the gallery?
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 4:17 pm
by pajadt
Hi Kirk
All work at your website, your links at cards don't work, you have to correct that, everything else works normally, both the gallery and the cards
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 4:39 pm
by Pablo
Do you mean masonry of the cards?
Yes
I was referring to all the images on the pages.
It takes some time to download and load these images. If this takes to long then the masonry script may not be able to determined the size of the cards, because the script does not know how long it needs to wait until everything is loaded.
That is why it works locally or with less images.
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 7:02 pm
by KIRK
OK thanks. Then the "Masonry" option is not the right one here.
Do you have a tip on how I can get three cards in a row? So two rows with three cards and one row with the last (one) card.
In smaller views then two in a row and in the smartphone view one card.
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 7:04 pm
by KIRK
pajadt wrote: ↑Tue Mar 23, 2021 4:17 pm
Hi Kirk
All work at your website, your links at cards don't work, you have to correct that, everything else works normally, both the gallery and the cards
Hi Pajadt,
thanks for the hint with the links. I still have to finalize this.
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 9:09 pm
by Pablo
The option 'card columns' can be used to create columns.
The column property is responsive, so it can be different in breakpoints
Re: Problem with cards after publishing
Posted: Tue Mar 23, 2021 9:23 pm
by KIRK
I'm already trying it out. But there are always three images in the first row and then two rows with two images each.
I updated the link above using card columns:
Column count: 3
Column gap: 16
Position: floating
Re: Problem with cards after publishing
Posted: Wed Mar 24, 2021 6:58 am
by Pablo
Do you have a demo project, so I can see your settings?
Re: Problem with cards after publishing
Posted: Wed Mar 24, 2021 7:30 am
by KIRK
Pablo wrote: ↑Wed Mar 24, 2021 6:58 am
Do you have a demo project, so I can see your settings?
Do you mean a wbs file?
The Site you can see here:
Project
Re: Problem with cards after publishing
Posted: Wed Mar 24, 2021 7:48 am
by Pablo
Do you mean a wbs file?
Yes, but I do not need to complete project. Only a simple demo with one page and the cards.
See also:
viewtopic.php?f=10&t=82134
Re: Problem with cards after publishing
Posted: Wed Mar 24, 2021 8:47 am
by KIRK
Here you can find the site
project
Here you can find the wbs file:
wbs file
Re: Problem with cards after publishing
Posted: Wed Mar 24, 2021 10:45 am
by Pablo
Thanks for the project.
The behavior is correct. Columns go from top-to-bottom, left-to-right.
So, card1, card2, card3 are in the first column, card4, card5, card6 in the second column etc.
If you want different behavior then you can use a flex container. In that case, you have more control over the flex box properties.
For example, if you want 3 items per row then set the flex-basis to 33%
Re: Problem with cards after publishing
Posted: Wed Mar 24, 2021 1:29 pm
by KIRK
That's it!
This 33% flex-basis!
Big thanks Pablo!