I have a Visibility rule for an image that I want to appear only on the first page.
The logic is based on the visibility rule for the continue and submit buttons, that uses this code:
Form.$Pages.currentPage && Form.$Pages.currentPage.$isFirst
The image placeholder appears on the page, but the image itself is not present, so the logic seems to be working.
However, in the browser console (in preview mode) I also get error messages: TypeError: Cannot read property 'currentPage' of undefined.
The image appears in the form in 'design' mode, and the image is listed as a resource in the Global Library.
So, I'm not sure what may be the problem.
Any ideas would be appreciated.
I have created a 3-page test form and can successfully hidr an image on selected pages, although the same error you mention is shown in the console preview mode. My test image correctly shows on the first and last pages.
I placed the image in the banner, populated it with Group.png and used the rule:
Form.$Pages.currentPage && (Form.$Pages.currentPage.$isFirst || Form.$Pages.currentPage.$isLast)
If I publish my form, the error does not appear like it does in preview mode.
Where exactly are you placing the image that does not render inside its placeholder, and which image are you using? Can you try with Group.png like I have used?
I tried this with the image Group.png and it works in preview.
But I have the same rule for my image and it does not appear.
My image is published to the Global library.
Here is an image of what I see in Maestro design:
and here is what I see in Maestro preview:
However, if I add another image onto the page then the first image and also the 'group' image behave as expected. See below:
So, I don't think I am any further ahead.
Why would one image impact on the behaviour of the other.
Any other ideas appreciated.
I have done some more testing.
I created the image as a custom component and published it to the global library.
When I add the custom component to the form it does not behave properly.
When I add a standard image component and set its properties it does behave properly.
Not sure if that helps the evaluation, but it seems odd that there is a difference.