writeDescription for current folder in templates ?

Admiror Gallery is free extension for Joomla! 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
jardinphoto
Posts: 2
Joined: Wed Jul 27, 2011 10:21 pm

writeDescription for current folder in templates ?

#1 Post by jardinphoto »

I'm designing a template for Admiror Gallery and would like to use current folder description in a specific DIV.

What I need is something like writeDescription function for current gallery folder.
The idea is having a function that allows to call current gallery description in the php file of the template.

Any idea ?

Sebastien

P.S. : thanks for this great joomla extension (and I tried many gallery plugins for joomla).

Admiror Gallery 5 - Fundraising Campaign

User avatar
kekeljevic
Developer
Developer
Posts: 445
Joined: Tue Aug 17, 2010 2:38 pm
Location: Novi Sad, Serbia
Contact:

Re: writeDescription for current folder in templates ?

#2 Post by kekeljevic »

This is so simple... :lol: Here You go:

Code: Select all

$lang =& JFactory::getLanguage();
$langTag=strtolower($lang->getTag());
$folderDesc = "";
$ag_pathWithStripExt=dirname($AG->imagesFolderPhysicalPath).DS.$AG->imagesFolderName;
$ag_XML_path=$ag_pathWithStripExt.".XML";
if(file_exists($ag_pathWithStripExt.".xml")){
    $ag_XML_path=$ag_pathWithStripExt.".xml";
}

$ag_XML_xml = & JFactory::getXMLParser( 'simple' );
$ag_XML_xml->loadFile($ag_XML_path);
$ag_XML_captions =& $ag_XML_xml->document->captions[0];

// GET DEFAULT LABEL
if(!empty($ag_XML_captions->caption)){
  foreach($ag_XML_captions->caption as $ag_XML_caption){
   if(strtolower($ag_XML_caption->attributes('lang')) == "default"){
    $folderDesc = $ag_XML_caption->data();
   }
  }
}

// GET CURRENT LANG LABEL
if(!empty($ag_XML_captions->caption)){
  foreach($ag_XML_captions->caption as $ag_XML_caption){
  if(strtolower($ag_XML_caption->attributes('lang')) == strtolower($langTag)){
    $folderDesc = $ag_XML_caption->data();
  }
  }
}


// RICH TEXT SUPPORT
if($AG->params['plainTextCaptions']){
$folderDesc = strip_tags($folderDesc);
}
                                
$html.=$folderDesc;

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

Re: writeDescription for current folder in templates ?

#3 Post by Vasiljevski »

This could go to API part of agGallery.php :)
Help Admiror Gallery become even better,
give us a review on JED

jardinphoto
Posts: 2
Joined: Wed Jul 27, 2011 10:21 pm

Re: writeDescription for current folder in templates ?

#4 Post by jardinphoto »

That would be a great idea !

@kekeljevic : thank you so much for your answer. I wasn't able to have it work for the moment but I'm searching ....

Something like AG->writeGalleryDescription would be a great addon :roll:

User avatar
kekeljevic
Developer
Developer
Posts: 445
Joined: Tue Aug 17, 2010 2:38 pm
Location: Novi Sad, Serbia
Contact:

Re: writeDescription for current folder in templates ?

#5 Post by kekeljevic »

We all agree with this ;-)

Admiror Gallery 5 - Fundraising Campaign

Post Reply