EPrints Technical Mailing List Archive
Message: #05824
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] How to find out, which ist the current URL of a page?
- To: eprints-tech@ecs.soton.ac.uk
- Subject: Re: [EP-tech] How to find out, which ist the current URL of a page?
- From: Enio Carboni <enio.carboni@gmail.com>
- Date: Wed, 13 Jul 2016 15:18:41 +0200
Hi Jens,
I think you can try in 2 ways: The first, (very simple) you can add this js script in cfg/static/_javascript_/auto/z_hidden_something.js:
document.observe("dom:loaded", function() { if (window.location.href.indexOf('cgi/search') != -1 ) { $$('.ep_tm_header .ep_tm_searchbar td form').each(function(name,index) {name.hide();}) } });
The second ways: A) In the template replace the <form method="get" accept-charset="utf-8" ... style="display:inline"> ... <form> Con il nuovo pin <epc:pin ref="dyn_search_form"/> B) Then in cfg/cfg.d/ add the script z_dinamic_serch_form.pl with this content:
$c->add_trigger( EP_TRIGGER_DYNAMIC_TEMPLATE, sub { my %params = @_; my $repo = $params{repository}; my $pins = $params{pins}; my $searchform = $repo->make_doc_fragment; my $form=$repo->make_element("form",method=>"get","accept-charset"=>"utf-8", action="" style=>"display:inline"); $searchformappendChild($form); my $input=$repo->make_element("input", class=>"ep_tm_searchbarbox", size=>"20", type=>"text", name=>"q"); $form->appendChild($input); $input=$repo->make_element("input",class=>"ep_tm_searchbarbutton", value=>$repo->phrase('lib/searchexpression:action_search'), type=>"submit", name=>"_action_search"); $form->appendChild($input); $input=$repo->make_element("input",type=>"hidden", name=>"_action_search", value=>"Search"); $form->appendChild($input); $input=$repo->make_element("input",type=>"hidden", name=>"_order", value=>"bytitle"); $form->appendChild($input); $input=$repo->make_element("input",type=>"hidden", name=>"basic_srchtype", value=>"ALL"); $form->appendChild($input); $input=$repo->make_element("input",type=>"hidden", name=>"_satisfyall", value=>"ALL"); $form->appendChild($input); if ( $repo->current_url() !~/\/cgi\/search/ ) { if( defined $pins->{dyn_search_form} ) { $searchform->appendChild( $pins->{dyn_search_form} ); $pins->{dyn_search_form} = $searchform; } else { $pins->{dyn_search_form} = $searchform; } } return EP_TRIGGER_OK; }); C) then restart Apache web server.
hope I have not made mistake, I did not do any testing
In data mercoledì 13 luglio 2016 12:58:18 CEST, jens.vieler@id.uzh.ch ha scritto: Again,
|
- References:
- [EP-tech] Template action depending on a documents URL
- From: jens.vieler@id.uzh.ch
- [EP-tech] How to find out, which ist the current URL of a page?
- From: jens.vieler@id.uzh.ch
- [EP-tech] Template action depending on a documents URL
- Prev by Date: Re: [EP-tech] How to find out, which ist the current URL of a page?
- Next by Date: [EP-tech] stop words in simple search dont stop
- Previous by thread: Re: [EP-tech] How to find out, which ist the current URL of a page?
- Next by thread: [EP-tech] stop words in simple search dont stop
- Index(es):