Page 1 of 3
How to Get Clean Image Name
Posted: Sat Aug 13, 2011 6:33 pm
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"?
Re: How to Get Clean Image Name
Posted: Sat Aug 13, 2011 10:17 pm
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
Re: How to Get Clean Image Name
Posted: Sat Aug 13, 2011 11:38 pm
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.
Re: How to Get Clean Image Name
Posted: Mon Aug 15, 2011 7:59 am
by kekeljevic
At current AG, it's only possible to have image captions.
Re: How to Get Clean Image Name
Posted: Mon Aug 15, 2011 9:19 am
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?
Re: How to Get Clean Image Name
Posted: Mon Aug 15, 2011 10:45 am
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

Re: How to Get Clean Image Name
Posted: Mon Aug 15, 2011 8:16 pm
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.
Re: How to Get Clean Image Name
Posted: Thu Aug 18, 2011 12:01 am
by buddyq
Bump! Let's keep this ball rolling!
Re: How to Get Clean Image Name
Posted: Thu Aug 18, 2011 8:44 am
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

Re: How to Get Clean Image Name
Posted: Thu Aug 18, 2011 4:32 pm
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?