Hello Yisrael,
I am trying to make a dynamic page which can show the casestudy collection one page at a time with links going to each individual page. I have made a search function which brings back a table of results depending on what you are looking for, then the aim is that when you click on one of the results it takes you to a page that displays that particular case study in full. Each indidivudal case study row in the database consists of 4 or more images which all need to be displayed.
There is no code on the page currently, it is set up with text that automatically fills out at the top from the database and then I have placed images in a grid pattern 2 wide by 6 long. I want these images to automatically fill in from the database (this has been done and completed successfully), the problem lies in that when a case study from the Datasbase doesn’t have as many images as the template (which has 12) there are boxes that leave the page with a lot of blank space. I’d like to get rid of these unused boxes and make the page collapse.
I took a look at the repeaters and because I have more than one image per row in my database it only seems to let me connect one image to it. I’m not after displaying one image per case study, but one case study with all images per page.
Hello Sharon,
I have tried this option now too. The problem I’m finding is that although he database has an image present in the field it is still hiding the content in the image placement on the dynamic page. Here’s your code that I have edited to meet my needs that doesn’t seem to respond:
$w.onReady(() => {
$w(“#mdynamicDataset”).onReady(() => {
const item = $w(“#dynamicDataset”).getCurrentItem();
if (!item.image) {
$w(“#img5”).collapse();
}
});
});
To further the information I have: each row consists of a set of images in the database as well as text and information about the case study. Some rows have 12 images, others have 4 and so on. The max one row has is 12 images, so I have built a template to allow for this and use across all of the database, but it means that when there are only 4 images on the page because the case study only has 4 images in the row, the page seems to be super long as the other placement holders are no filled in but they haven’t collapsed.
Once again, thank you in advance.