Gallery html or php?

I have a html-page with a Gallery. It works fine, but Claude (free version) tells me I should perhaps change to .php - @dan

Claude writes: Elements flags that component as needing a PHP page, and the page currently publishes as index.html. I couldn’t find a docs page that explains why Gallery needs PHP, so I’m relying on the app’s own warning.

I think you need to change the file name to end in PHP here

Yes, I know. But why should I change? @dan

Hey @PLM

When adding a Gallery component onto the page, Elements will prompt you to change the page’s file extension to .php per the above video.

While the page may be working fine for you with an .html extension, it’s best to go with the recommended .php extension for compatibility and to make sure all the Gallery features work as expected.

Ok, thanks, but elements didn’t suggest anything when I added the Gallery. Newly made feature? I made the page many months ago.

I tested now on an other page and the pop-up warning comes up. Issue solved thanks to Claude and @differentdan

I think it was added not too long ago. I’d imagine you made the page before the feature was added.

So are you saying that pages with a Gallery Pro component should also be changed to php?

Hi @TomM

They should be, yes. You can change the page’s file extension to .php and republish. Let me know if you have any troubles with it.

Don’t forget to delete the index.html file on your server.

Plus make new internal links to the index.php file? I did this, but it’s probably not necessary since it’s the same page in Elements. Only new file on the server. @differentdan

When you say file, do you mean delete all the pages changed from html to php?

And does internal links refer to links between pages in the site?

I ask because my site has 50 Gallery Pro pages all linked to thumbnail images

so making these changes is kind of a big deal.

Only delete the index.html file for the gallery on the server, nothing else. Try one first. My gallery works as normal with index.php.

@TomM

Yeah I’d try one page first. Just change that one page to .php and then republish. Afterwards test everything to make sure it’s working. If it’s looking good then maybe try a second page, and so on until you feel comfortable changing all pages.

You are hosted with us, so you have backups in case you need to revert anything. :slightly_smiling_face:

So to clarify, when you look at a page on the server, you see a corresponding folder.

In that folder there is one index.html file.

That is the file that you delete?

Hi @TomM

Correct, each page folder should contain one index.html file. When you upload the new index.php file, then the old .html file is the one you would delete.

I do want to mention though, that I specifically set up Elements Hosting to account for these types of situations. On our hosting environment, the server will always “serve” index.php files first, even if there is an index.html file in the same folder.

That means that technically you don’t really need to delete the index.html, because the server is going to see the index.php file first and serve that one to your web visitors.

Deleting the index.html file is more of a house-keeping/tidying up step, so you don’t have multiple index files sitting in the same folder. It’s still a good idea to delete those unnecessary index.html files, but it’s not something that will break your site if you don’t do it immediately.

Hope that helps. Let me know if you have additional questions.

Upload the new index.php first, then go to the correct folder on the server. You should see both the index.html and index.php. Delete the index.html (already done in my burano sample).

OK, good since Claude wrote some servers take the .html first

So the php and html file will be there together.

Just a comment:

I just recently saw the popup in Elements to change a gallery page to php. I thought i was some kind of glitch.

All my other gallery pages were created before this change.

I don’t know if this subject was posted somewhere, but I think there should be some kind of announcement about this with all the relevant details.

Thanks

It was posted but the pop-up is fairly new and Elements is apparently unable to check older gallery pages. But Claude does.

One last question.

I updated a couple of pages, I don’t see where creating new internal links to the index.php file is needed.

Don’t need to update links since it’s the same page in Elements. Only new on the server.