It is currently Sat Oct 25, 2014 4:34 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Aug 02, 2012 6:00 pm 
Offline

Joined: Thu Aug 02, 2012 5:57 pm
Posts: 4
Title says it all I guess, i can't find it anywhere, checked the api manual, did some browsing at agGallery.php, searched trought packed templates... and I just can find how to output the gallery's caption :(


Top
 Profile  
 
 Post subject: Output Gallery Description?
PostPosted: Thu Aug 02, 2012 6:00 pm 
Top  
PostPosted: Mon Aug 06, 2012 11:38 am 
Offline
Developer
Developer
User avatar

Joined: Sat Aug 14, 2010 9:31 pm
Posts: 1131
Location: Novi Sad, Serbia
When you say you can't find how to Output captions you mean how to display caption on the page or how to add it in your custom template?

In either way, first you should check this post to get to know XML format of caption files:
http://www.vasiljevski.com/forum/viewtopic.php?f=30&t=548#p2100

Now that you have correctly formatted XML caption file to display it in your template you have to call :
Code:
$AG->writePopupThumb($imageName);

This will display a thumbnail image and appropriate caption depending on the language.

If you only want to display image caption this is the function to call:
Code:
    /**
     * Returns image description. The current localization is taken into account.
     * @param <string> $imageName
     * @return <string>
     */
    function writeDescription($imageName) {
        return $this->descArray[$imageName];
    }

Example:
Code:
echo $AG->writeDescription('my_image.jpg')


You can also display only a thumb by calling:
Code:
 /**
     * Returns thumb html
     * @param <string> $imageName
     * @param <string> $cssClass, default is ''
     * @return <html>
     */
    function writeThumb($imageName, $cssClass='') {
        return '<img src="' . $this->sitePath . PLUGIN_BASE_PATH . 'thumbs/' . $this->imagesFolderName . '/' . $imageName . '"
                alt="' . strip_tags($this->descArray[$imageName]) . '"
                class="' . $cssClass . '">';
    }


Example:
Code:
echo $AG->writeThumb('my_image.jpg', 'thumbImage')

_________________
If you like Admiror Gallery support us by leaving a review on Joomla extensions site : Admiror Gallery
Admiror Joomla! Extensions


Top
 Profile  
 
PostPosted: Tue Aug 14, 2012 12:15 am 
Offline

Joined: Thu Aug 02, 2012 5:57 pm
Posts: 4
Hi

Thank you for repling and sorry for my delay in the follow up:

I meant how to add the folder captions to my custom template.

I'm already using the $AG->writeDescription($imageName) to output individual thumbnail descriptions.

What I wanted to display in my template is the folder caption (wich can be assigned trought component).

I'm sorry but i just noticed now that I did the mistake of posting under 2.x while my companent and pluging are 3.x.

ps: should this tread be closed so that i open a new one under correct section of forum or no?


Top
 Profile  
 
PostPosted: Thu Aug 16, 2012 8:22 pm 
Offline
Developer
Developer
User avatar

Joined: Sat Aug 14, 2010 9:31 pm
Posts: 1131
Location: Novi Sad, Serbia
I didn't noticed that the topic is in wrong sub-forum before :) Moved it to correct sub-forum.

As far as I see for folder description, we don't have separate functions, and we use this function:
Code:
$AG->writeFolderThumb("albums/album.png", $AG->params['thumbHeight']);

to display folder thumb and caption.

But you may try to use : writeDescription($folderName)

Albums(folders) are added in fast, so there is some nonstandard coding involved ;)

_________________
If you like Admiror Gallery support us by leaving a review on Joomla extensions site : Admiror Gallery
Admiror Joomla! Extensions


Top
 Profile  
 
PostPosted: Sat Aug 18, 2012 3:31 am 
Offline

Joined: Thu Aug 02, 2012 5:57 pm
Posts: 4
OK I found the problem...
I forgot to mention, I am not using folders. Its just one-folder galery...
its a basic scroll list layout + lightbox... but i needed the folder caption right bellow it =(.

Any known way to output the caption without more then one folder?


Top
 Profile  
 
 Post subject: Re: Output Gallery Description?
PostPosted: Sat Aug 18, 2012 3:31 am 
Top  
PostPosted: Sat Aug 18, 2012 3:44 am 
Offline

Joined: Thu Aug 02, 2012 5:57 pm
Posts: 4
Update: (remember i'm pretty much newbie at php)

I located the function writeFolderThumb om agGallery.php, and 'duplicated it', after the if "$this->params['albumUse'] && !empty($this->folders)" i added an 'else if($this->params['albumUse'])'. To not hurt original functon.

Then I removed the "foreach ($this->folders as $folderKey => $folderName)".

I managed to get the thumb out, but not the description. I suspect it is because what originally outputed the description was "descArray[$folderName]", but then its no longer an array. -.-


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

 

Contributor Blogs

Joomla! - the dynamic portal engine and content management system

Business Pizza, Bugs, and Fun October 17, 2014


 
You're Invited Please consider this your personal invitation to jo...

http://community.joomla.org/blogs/community/1832-business-pizza-bugs-and-fun-october-17th-2014.html

JED 3 Nearing Completion: Call for Beta Testers

We’re really excited to share that the development process for the new Joomla Extension Directory (JED) getting close to the finish line. As of right now, the front-end and back-end development is approximately 90% complete, and the JED Team is ...

http://community.joomla.org/blogs/leadership/1830-jed-3-nearing-completion-call-for-beta-testers.html

A new organizational structure and methodology to empower the growth of Joomla!

Why do we want to see a change? The leadership summit which occurred prior to J and Beyond 2014 brought about a number of incredible improvements. The theme for this year’s event “Investing in our Future” and the focus of the event ...

http://community.joomla.org/blogs/leadership/1829-a-new-organizational-structure-and-methodology-to-empower-the-growth-of-joomla.html

JWC14 JET Recipients Announced

The Joomla Event Travel Programme (JET) is pleased to announce that we have selected 15 members from the worldwide Joomla community. With 49 applications to choose from, it was a difficult decision that was made easier because of the

http://community.joomla.org/blogs/leadership/1828-jwc14-jet-recipients-announced.html

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

This is the official Admiror Joomla! Community Forum. You are welcome to join the Admiror Joomla! Community. All Admiror Joomla! Extensions Users, Joomla! Developers, PHP or mySQL Developers are welcome to support & contribute to Admiror Joomla! Projects.

Joomla! is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets. With a vibrant volunteer community, user-friendly features and plenty of power, Joomla is perfect for your website!

Joomla! is written in PHP, uses object-oriented programming (OOP) techniques and software patterns, stores data in a MySQL database, and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, polls, search, and support for language internationalization.

Joomla! is the property of Open Source Matters, Inc. All rights reserved. Read more about Joomla! at http://www.joomla.org/.


Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group