Use caption in breadcrumb

Admiror Gallery is free extension for Joomla! 1.6. Joomla! 1.7 and Joomla! 2.5 based websites. Admiror Gallery is all in one, a simple and instant solution for rendering image gallery from folder with images, but very flexible and adaptable.
Post Reply
Message
Author
fngnet
Posts: 2
Joined: Sat Aug 31, 2013 6:51 pm

Use caption in breadcrumb

#1 Post by fngnet »

Hi

I would like to know how can I retrieve the Captions of the folders and use them as breadcrumb elements.

Can you advice?

By the way Great Component!!!

Admiror Gallery 5 - Fundraising Campaign

User avatar
Vasiljevski
Developer
Developer
Posts: 1258
Joined: Sat Aug 14, 2010 9:31 pm
Location: Novi Sad, Serbia
Contact:

Re: Use caption in breadcrumb

#2 Post by Vasiljevski »

Hmm, well there is no easy solution for this.

You could check agGallery.php function initGallery

Code: Select all

            // Album Support
            $this->albumParentLink = '';
            $this->albumInitFolders[] = "";
            $this->albumInitFolders[$this->index] = $this->imagesFolderName; // Set init folders
            if (!empty($_GET['AG_form_albumInitFolders_' . $this->articleID])) {
                $AG_form_albumInitFolders_array = explode(",", $_GET['AG_form_albumInitFolders_' . $this->articleID]);
                $this->albumInitFolders[$this->index] = $AG_form_albumInitFolders_array[$this->index];
                $this->imagesFolderName = $AG_form_albumInitFolders_array[$this->index];
                // Support for Album Parent Link
                if ($this->imagesFolderName != $this->imagesFolderNameOriginal) {
                    $this->albumParentLink = '
                        <a href="#" onClick="AG_form_submit_' . $this->articleID . '(' . $this->index . ',1,\'' . dirname($this->imagesFolderName) . '\'); return false;" class="AG_album_parent">
                            <span>
                                ' . basename(dirname($this->imagesFolderName)) . '
                            </span>
                        </a>
                        <br style="clear:both;" />
                        ';
                }
            }

            // Breadcrump Support           
            if (JFactory::getApplication()->getMenu()->getActive()->query['view'] == "layout") {
                $this->writeBreadcrum();
            }
At the end you see that we call $this->writeBreadcrum();

Code: Select all

    /**
     * Breadcrump Support
     * Author: Lee Anderson
     * Authors e-mail: landerson@atlas-tech.com
     */
    function writeBreadcrum() {
        $folderNames = str_replace('//', '/', $this->imagesFolderName);
        $albumName = explode("/", $folderNames);
        $folderNumber = count($albumName) - 1;
        $linkFolderName = '';
        for ($i = 0; $i <= $folderNumber; $i++) {
            $linkFolderName .= $albumName[$i] . '/';
            $linkFolderName = str_replace('//', '/', $linkFolderName);
            if ($albumName[$i] != '' && $i != 0) {
                $this->events['name'] = $albumName[$i];
                $link = 'Javascript: AG_form_submit_' . $this->articleID . '(' . $this->index . ',1,\'' . $linkFolderName . '\');';
                $mainframe = JFactory::getApplication();
                $document = JFactory::getDocument();
                $pathway = $mainframe->getPathway();
                $document->setTitle($this->events['name']);
                $pathway->addItem($this->events['name'], $link);
            }
        }
    }
So in your case you should edit writeBreadcrum to your needs.

But for this to work, you should have some array that would hold album names, for example if you open Albums->Vacation->Summer2013, you should have $breadcrums = {"My albums","Vacation pictures", " Carribiens"}

Bottom end is, it is possible, but requires some work :)
Help Admiror Gallery become even better,
give us a review on JED

Post Reply