![]() |
|
Gallery on the front-page - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Themes (https://forum.zenphoto.org/forum-5.html) +--- Thread: Gallery on the front-page (/thread-13408.html) |
Gallery on the front-page - markdalderup - 14-05-2020 Hi I am trying to find out how to put a specific gallery on the front-page of my website. So the code should go in index.php I see that there are function like zp_load_gallery but I can not find a way to achieve what I want with those or if it is even the right way to do it with that function. To be clear I don't want an album link on the front page but the gallery itself with the thumbnails and pagination. Basically the front page should look like what you see after you click on an album link. My experience with php is limited so a piece of example code would be greatly appreciated Gallery on the front-page - acrylian - 14-05-2020 Let me first correct the terms uses: "gallery" refers to the Zenphoto site in total, you are referring to a single "album".
Sorry, then you will not really far here. There is no simple code for this as this is off the standard. To achieve this you first need to create a custom Then you have to manually set the album you want to display to "current" there. There is a function name In any case the pagination will not work as expected as the the toplevel gallery URLs are Gallery on the front-page - sbillard - 16-05-2020 While what you want to do is achievable with Zenphoto it is a seriously complicated change. There are the pagination issues that Acrylin mentions above, but there are also other issues with links. For instance, when you are viewing an image there is a link to take you back to the album that contains the image. Obviously without some change to the image.php script that link will not take you back to the index page. To make the changes needed you will need more than a working knowledge of PHP. You will also have to have a pretty complete understanding of how the Zenphoto architecture deals with albums and images. If all you want is software to display a simple set of images, maybe Zenphoto is overkill. Gallery on the front-page - Woodspiral - 18-05-2020 I'd like to achieve exactly the same thing. I'm using ZenPhoto to build my photography site and just have one main album. I may have other albums in the future, but that is not my immediate intention. What I want is a general photography site with info and links and a small album of images which load on the front page. I was thinking of using an Apache mod_rewrite rule so that access to index.php was redirected to index.php?album=Sample-Images but I'm not sure this approach will work. Does anyone have any experience here? There has to be an easy way to make this work, no? http://photography.woodspiral.co.uk/index.php?album=Sample-Images Thanks, Gallery on the front-page - acrylian - 18-05-2020
As explained no. You can of course do a redirect but pay atention to do that right regarding SEO. That would at least workaround any pagination etc issues as you end up on the real album page. Alternatively you can quite easily print the latest x images of one album on the home page by using the image_album_statistics plugin. See the in file documentation of it how to use it by modifying your theme. Of course it is a good idea to read the theming tutorial first. Gallery on the front-page - Woodspiral - 18-05-2020 Thanks, Acrylian. I get a 404 error accessing the documentation for image_album_statistics: https://docs.zenphoto.org/package-plugins.image.album.statistics.html Gallery on the front-page - acrylian - 18-05-2020 You should not get such a link on the backend anymore (and I confirmed that 1.5.6 does not provide this.) Edit: I see, our site still generates that old link. That's a bug. |