Get Album URL in album.php and image.php without Page Numbers

Hi, I am using <?php echo html_encode(getAlbumLinkURL()); ?> to display Album URL on Album and Image Page. (Note: I set 5 Images per Page to show). Everything was going right when I had less than 5 Images per Album and Image Page was showing Album Link as http://www.mydomain.com/happy-birthday/ (as I wanted). But when I added more Images then more Pages were created and when I went to other Pages e.g. Page 2, Page 3 or Page 4 and clicked on Image to see what they are showing then I saw the Album Link is showing as http://www.mydomain.com/happy-birthday/page/2, http://www.mydomain.com/happy-birthday/page/3 or http://www.mydomain.com/happy-birthday/page/4 respectively.

It means the main problem is that it is generating links according to the Album Page /happy-birthday/page/2 or /happy-birthday/page/3 or /happy-birthday/page/4 and I don't want to display those Page Numbers. I want to display only Album URL i.e. /happy-birthday/. Is there any other function to display only Album URL in album.php and image.php without Page Numbers?

Comments

  • acrylian Administrator
    Either you use pagination or you don't. What sense does it make to have pages if you cannot access them?

    Setting the albums per page to a number so all fit on one page is the only way.
  • atif Member
    You didn't get my point. I have no problem with pagination, I am looking for a function which generates and display Album's Root URL i.e. http://www.mydomain.com/happy-birthday/.

    So, I used <?php echo html_encode(getAlbumLinkURL()); ?> which is generating and displaying Album's Root URL on Page 1 but on other Pages i.e. Page 2, Page 3, etc. it doesn't show Album's Root URL instead it is showing Album's Pagination URL i.e. http://www.mydomain.com/happy-birthday/page/2.

    I want to know is there any way to Display/Show Album's Root URL i.e. http://www.mydomain.com/happy-birthday/ on other Pages i.e. Page 2, Page 3, etc.
  • atif Member
    Actually I want to Display/Show Album's Root URL on my Album and Image pages with some text e.g.
    The above Image is placed in the Happy Birthday Album and You can access it via this link http://www.mydomain.com/happy-birthday/
    OR
    Share Happy Birthday Album with your Friends - Link to the Album http://www.mydomain.com/happy-birthday/
    These are the examples to clear my point that I want to show Album's Root URL on Album and Image Pages with some text.
  • acrylian Administrator
    Ah ok.... Then you have to use the object mode to generate the album link using the album name.

    In 1.4.3 (and the beta naturally has already) the album class method `getAlbumLink()`also will have a parameter for the page to get.
  • atif Member
    OK. I don't know how to use the object mode to generate the album link using the album name.

    Did you mean that in 1.4.3 I will be able to generate Album's Root URL using `getAlbumLink()`? If `getAlbumLink()` generate Album's Root URL in 1.4.3 then I will wait for the release of 1.4.3 which is scheduled for June 15 I think.
  • acrylian Administrator
    No, with the album class method you then can set a parameter for the page in 1.4.3. The template function is bascially a wrapper for that anyway and mostly kept for backward compatibility.

    The object model is the base of everything. We have a tutorial about the object model on the user guide. To generate the album link manually you can look at the album class methods directly (the files in zp.core).

    You need to have a basic understanding of how object orientation in PHP works. You should really do as you might need it for any orther sort of special customization anyway.
Sign In or Register to comment.