Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorMegan
    • CommentTimeAug 16th 2007
     
    I am trying to get a link to the album index from the picture page. This is basically to replace the link that was in the breadcrumbs (which I removed because I'm integrating at the album level and didn't want the links to collections etc.). I want the link to the album index to go with the previous/next links.

    I have been successful in getting most of the URL in there using several methods, mostly involving generate_url() and plogger_get_album_url(). They almost work - the problem is that they're not getting the album Id to add on to the URL. So it looks like this:

    <li><a href="/housing/galleries/?level=album&amp;id=" >index </a></li>


    And the link doesn't work because the album id isn't there. My current function looks like this:

    function plogger_get_album_link() {
    $album_url = plogger_get_album_url();

    $album_link = '<a accesskey="/" href="' . $album_url . '">Index</a>';
    return $album_link;

    }


    I thought it would be cleaner to do it the same as the next/previous links. You can see it in action here.

    I also tried something similar to what's in the breadcrumbs function but that had the same result.

    Thanks for any help!
    • CommentAuthorMegan
    • CommentTimeSep 17th 2007
     
    bump - any help?

    I'm back to working on this again because I need to launch an important gallery this week.
    • CommentAuthorMegan
    • CommentTimeSep 17th 2007
     
    Finally figured it out! It needs to find the parent album of the current picture. Then it can pass that value to the generate_url function and get the right link.


    function plogger_get_album_link() {

    $id = $GLOBALS["current_picture"]["parent_album"];

    $album_link = '<a accesskey="/" href="' . generate_url("album",$id) . '">Index</a>';
    return $album_link;
    }



    Or, more verbosely:


    function plogger_get_album_link() {

    $pic = $GLOBALS["current_picture"];
    $id = $pic["parent_album"];
    $album_url = generate_url("album",$id);

    $album_link = '<a accesskey="/" href="' . $album_url . '">Index</a>';
    return $album_link;
    }

    Thankful People: mike
  1.  
    Hey Megan,
    I'm stuck with the same problem.. This might be a stupid question, but where did you place the code? In picture.php?
    Hope to hear from you! :)
  2.  
    I already got it, thanks!