Hi Jonathan,
glad it worked. now what you need to do is to add your custom javascript
in menupanel.tt. e.g, this is for perl button:
onclick="
if (datasetExists() > 0) {
document.mainform.showquery.value = 2;
document.mainform.do_export.value = 0;
document.mainform.savequery.value = 0;
document.mainform.target = 'newwindow';
document.mainform.submit();
}
"
all you want goes in double quote of onclick()=""
if you want extensive code, declare a function in
htdocs/martview/js/martview.js and call it from onclick()
hope this is helpful.
Cheers
Syed
Moore, Jonathan wrote:
Dear Syed,
Thanks very much for your help - so far so good, I have the new button
on the bar, it reacts to hover and when I click it opens a new window.
Now for the action - how could I make the button call a new URL, passing
the XML in a POST?
Best wishes
Jay
Dr. Jonathan Moore
Senior Research Fellow in Bioinformatics
--
Warwick Systems Biology Centre
Coventry House
University of Warwick
Coventry CV4 7AL
U.K.
+44 (0)24 761 50332
http://www.warwick.ac.uk/go/jaymoore
-----Original Message-----
From: Syed Haider [mailto:[email protected]]
Sent: Mon 8/3/2009 2:21 PM
To: Moore, Jonathan
Cc: [email protected]
Subject: Re: [mart-dev] How to add a custom export?
Hi Jonathanm
you hvae already editing the menupanel.
open conf/settings.conf:
under 'help_button_image'
add your 2 new entries for the button.
now go to biomart-perl/htdocs/martview/images and add the images there.
Remember that in settings.conf, its mview/images but you ONLY add your
images under htdocs/images/
open htdocs/martview/martview_template.css
look for .mart_btn_perl and add a similar entry for your button
look for .mart_btn_perl_disabled and add a similar entry for your button
when its disabled. the names here should match what you entered in
conf/settings.conf.
now reconfigure (perl bin/configure.pl) and restart apache, you button
should appear.
let me know how you get on with this,
Best,
Syed
Moore, Jonathan wrote:
> We would like to add a new button next to the 'URL' and 'XML' buttons.
>
> The function of this would be to pass the XML version of the query (e.g.
> using HTML POST) to an external script, in a new window.
>
> Can you advise what changes we would need to make?
>
> I have made conf/templates/custom/menupanel.tt to begin with, but where
> do I put the images for the button, and how to call the new page and
> pass the XML to it?
>
> Hope you can help with some pointers.
>
> Jay Moore
>
> Dr. Jonathan Moore
> Senior Research Fellow in Bioinformatics
> --
> Warwick Systems Biology Centre
> Coventry House
> University of Warwick
> Coventry CV4 7AL
> U.K.
> +44 (0)24 761 50332
> http://www.warwick.ac.uk/go/jaymoore
>