It is currently Thu Aug 21, 2014 4:21 am

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: 1123
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: 1123
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

Joomla Event Traveller Programme (JET) Now Open for JWC14

The Joomla Event Traveller Programme (JET) is pleased to announce that we will be taking applications from the worldwide Joomla community, for the upcoming Joomla! World Conference to be held on November 7th - 9th, 2014 in Cancun, Mexico.
T...

http://community.joomla.org/blogs/leadership/1826-joomla-event-traveller-programme-jet-now-open-for-jwc14.html

J and Beyond 2014 & Joomla! Marketing

Since its inception, JAB has been an awesome & feature packed event which gets together 300+ Joomla! users across the world. The best innovations and advancements in the Joomla world are shared here and it would be fair to say that it is the...

http://community.joomla.org/blogs/community/1824-j-and-beyond-2014-a-joomla-marketing.html

2014 Joomla Google Summer of Code Students Accepted


Once again Joomla will be participating in the Google Summer of Code, and this year we have 8 excellent student projects that were ac...

http://community.joomla.org/blogs/community/1822-2014-joomla-google-summer-of-code-students-accepted.html

It's amazing ... how easy it is to Do More with Joomla 3.3

 
 
As a website owner, if you could invest 30 seconds, click one button and improve the perform...

http://community.joomla.org/blogs/community/1821-its-amazing-how-easy-it-is-to-do-more-with-joomla-33.html

Joomla Event Traveller Programme (JET) Recipients Chosen

The Joomla Event Traveller Programme (JET) is pleased to announce that we have selected 25 members from the worldwide Joomla community, representing 16 countries as the recipients of the first JET Programme recognition. They will have th...

http://community.joomla.org/blogs/leadership/1819-joomla-event-traveller-programme-jet-recipients-chosen.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