Parent Album name

Hello,

Is there any way to show parent album name other then the breadcrumb thing ?

I have it like for each user

User > Subalbums > Subalbums
User2 > Subalbums > Subalbums

And i need to show the User album name on the subalbum pages but seperately then the bedcrumbs on top...

Any way?

Comments

  • I think this is what you were going for.

    If all you need is the name, calling:
    `<?php $aGalleyIndex = getParentAlbums();<br />
    echo $aGalleyIndex[0]; ?>`

    should work. If you need it to be a link to the gallery index, try using:
    `" title="Gallery Index"><?=getGalleryTitle();?>`
  • Hmm, that just shows "Object"
  • Sorry, you want `$aGalleyIndex[0]->getTitle()` or it looks like you could just call `echo printGalleryTitle()`
  • Sorry to bother you again but let me explain what i need again.

    I have 10 main albums called User1, User2, blah blah . and i have 2 level sub albums in all of the main albums.

    What i want to do is Show main album name on Top of the subalbums.

    Like if i am on

    User1> Trips > Someplace

    I want to show User1 on top of the page.

    printGalleryTitle() prints the gallery title, i don't need that.

    Thanks in advance if anyone can help
  • Ahh ok. I think I understand. On mine, I have it set to show the breadcrumbs with the gallery root in the breadcrumbs. So mine might look like Gallery > User1 > Trips > Someplace. What you can do for that is use that code snippet from before. Instead of `[0]` we want `[1]`. The albums are stored in an array [Gallery, User1, Trips]. I haven't tested any of this, but try this:
    `<?php $aGalleyIndex = getParentAlbums();<br />
    echo $aGalleyIndex[1]->getTitle(); ?>`

    Let me know if that works.
  • Nope i get a error

    Fatal error: Call to a member function on a non-object in

    themes\binary\album.php on line 32

    Line 31 and 32 are

    <?php $aGalleyIndex = getParentAlbums();
    echo $aGalleyIndex[1]->getTitle(); ?>
  • anyone can help me on this ? please :D
  • <?php
    $aGalleyIndex = getParentAlbums();
    echo $aGalleyIndex[0]->getTitle(); ?>

    ok that is working when i am in User > album or USer > Album > Album

    But when i am just on user it gives the Fatal error: Call to a member function on a non-object in error

    ANy fix for that ?

    Or any way of just showing this code in the sub albums and not the main ?

    Thanks a lot for your help so far elderz :)
  • ok i don't have too much clue to what's going on here but i finally managed to do it.

    <?php
    if ( $aGalleyIndex = getParentAlbums()) {
    echo $aGalleyIndex[0]->getTitle();
    } else {
    printAlbumTitle();
    }
    ?>

    It displays The main album title in any of it's subalbums or there subalbums.

    If anyone can tell me what's happening there, that would be great too :P
  • Gallery level albums--those displayed on the index.php page--do not have parent albums (`getparentAlbums()` will be empty). That is why you need the `if ($aGalleryIndex =getParentAlbums()) {` test.
  • sorry about that farhan. I was out of town for a few days. I didn't realize that the gallery is not considered a parent album so it makes sense that `getParentAlbums()` wouldn't work.
  • no problems elderz, many thanks for your help :)
Sign In or Register to comment.