How to Get Clean Image Name

Everything to do with Templates and Templating for Admiror Gallery.
Message
Author
buddyq
Maegashira
Maegashira
Posts: 21
Joined: Wed May 18, 2011 9:48 pm

How to Get Clean Image Name

#1 Post by buddyq »

How do I print out a clean image name? For example, in the image manager, I put "Green Car" as the title of the image. But it displays as "Green-Car.jpg". How can I just get it to display "Green Car"?

Admiror Gallery 5 - Fundraising Campaign

User avatar
Bifford
Contributor
Contributor
Posts: 220
Joined: Thu Oct 21, 2010 12:31 am
Location: Essex, UK
Contact:

Re: How to Get Clean Image Name

#2 Post by Bifford »

I believe that you are in the wrong window and as such you are therefore changing the file name (which must contain no spaces therefore AG inputs _ into the name.

If you click on the image it will bring up a new page where you can type in (to the relevant language box) your file caption.

Sam / Bifford

buddyq
Maegashira
Maegashira
Posts: 21
Joined: Wed May 18, 2011 9:48 pm

Re: How to Get Clean Image Name

#3 Post by buddyq »

Hmmm.... didn't know that was the actual filename. I would like a title with the caption, but a regular title and not a filename.

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

Re: How to Get Clean Image Name

#4 Post by kekeljevic »

At current AG, it's only possible to have image captions.

buddyq
Maegashira
Maegashira
Posts: 21
Joined: Wed May 18, 2011 9:48 pm

Re: How to Get Clean Image Name

#5 Post by buddyq »

I did a little trickery parsing the image title to get the title I want. You can see the implementation here:
http://aveone.tangerinefiles.com

I have converted zAccordion script into a template. However, it has many options I can add and I would like to do so. What would be best is to have those options show when they click the editor button and choose my template. Then show the options below to customize it. Is that possible? How do I add options for templates?

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: How to Get Clean Image Name

#6 Post by Vasiljevski »

Cool template! :) Is there any chance of sharing it with community? :)

Well when you say editor button, you mean button for adding AdmirorGallery when editing an article?
You should look in "administrator\components\com_admirorgallery\views\button\tmpl\default.php"
here you can add manualu parametars you need.
For now we do not have automatic way of reading extra params for diferent templates, but I guess you could add some JS code to check what the user selected from dropdown list and add extra settings. But you will need to hardcode the settings available.

This is a good thing to have we would have to think about adding some way of automatic loading specific settings for diferent templates :)
If it is no trouble you could add this idea to Brainstorming sub-forum :)
Help Admiror Gallery become even better,
give us a review on JED

buddyq
Maegashira
Maegashira
Posts: 21
Joined: Wed May 18, 2011 9:48 pm

Re: How to Get Clean Image Name

#7 Post by buddyq »

Yes, I can share it when I get some stuff cleaned up like I want it.

I have inserted the params into the popup from the button and the backend. However, they do not become part of the $AG->params array. What do I have to do, in order to get them to be useable in my template?

$AG->params['customParam'] does nothing.

buddyq
Maegashira
Maegashira
Posts: 21
Joined: Wed May 18, 2011 9:48 pm

Re: How to Get Clean Image Name

#8 Post by buddyq »

Bump! Let's keep this ball rolling!

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

Re: How to Get Clean Image Name

#9 Post by Vasiljevski »

:)
Ok, as I can see you do not read values you added. Custom parameters should be loaded in the template file using:

Code: Select all

$AG->ag_getParams("[name of the custom param]",$AG->match,[default value]);
$AG->match is the code inserted in the article from which param value will be extracted.

So to set an example, if you added two new parameters: sliderSpeed=30; startSlideShowAutomatic= true
You will add:

Code: Select all

$sliderSpeed = $AG->ag_getParams("sliderSpeed",$AG->match,50);
$startSlideShowAutomatic= $AG->ag_getParams("startSlideShowAutomatic",$AG->match,false);
There is no need to add it to the params array, but if you want you can do something like:

Code: Select all

$AG->params['sliderSpeed'] = $AG->ag_getParams("sliderSpeed",$AG->match,50);
$AG->params['startSlideShowAutomatic']= $AG->ag_getParams("startSlideShowAutomatic",$AG->match,false);
Even if you don't add it to the param array they will still be available in popup script, because firs template file is included and then popup file, so any variable defined in here will be available.

Hope this helps :)
Help Admiror Gallery become even better,
give us a review on JED

Admiror Gallery 5 - Fundraising Campaign

buddyq
Maegashira
Maegashira
Posts: 21
Joined: Wed May 18, 2011 9:48 pm

Re: How to Get Clean Image Name

#10 Post by buddyq »

Thanks! I'm going to get working on this right now and see if I can get this thing working. What I think would be a great priority is having a way (using AJAX), is to select the template you want, then see those options. This way, the plugin code won't have extraneous settings that dont make sense for that template to use and get too bulky. Of course we can ignore those but it might confuse people down the road and as templates grow, could get too crazy.

Thoughts?

Post Reply