How can I change the apache solr search URL in Drupal? - drupal

How can I change the default apache solr URL path search/apachesolr_search/term to something else?

You can create a menu item that has the callback:
$menu['search']['page callback'] = 'apachesolr_search_view';
This will make that url use the apachesolr search as it's return.
What are you trying to change it to?

Related

how to add suffix url wordpress example (/post-name/images)

I want to show post images into a separated page for example blow URL:
/post-name/images
At the moment this URL returns a 404 page.
how to show my images in this URL?
WordPress has a get_attached_media() function as Version 3.6, that returns an associative array of all of the images attached to a post.
After that, there are a couple of ways to add the /images path to the URL.
You can use the template_include filter
to check the current URL, unset the is_404 boolean, and pass in a PHP Template.
You can make use of This WPSE Answer to add /images as a "virtual page" using .htaccess and/or WP::parse_request() rules, and load in a PHP template that way
You could instead use query parameters /post-name/?images=true and check for that in your single.php (or equivalent file), and use get_attached_media()
You could instead use query parameters /post-name/?images=true and make use of the the_content filter in your functions.php file, and return the get_attached_media() instead of the content

Drupal 7 how to write a clean url link in Panels, or Content Node

I have enabled clean URLS and it is working fine.
How ever I have a Panel page with link. the link goes somethinglike this.
<a href="?q=PageName">
Now, Lets say I am on that Panel page(i would think the same thing would happen on any other custom content pages) and let's call it PanelPage and I press the link, The URL end up being, PanelPage?q=PageName (The whole URL = localhost/SiteName/PanelPage?q=PageName).
My Question is, Is there a way to write that link, so that It coume out as Clean URL? SiteName/PageName ?
Please help.
Thanks
Use l($text, $path, array $options = array()) to generate links.
In drupal 7, after logged in as admin go to following path "Configuration » Search and metadata » URL aliases".
There you can set 'Alias Path' for 'Existing Path'. Add an Alias path for your panel page.
For EX:
Existing system path : http://www.example.com/PanelPage?q=PageName
Path alias : http://www.example.com/custom_name.html

Redirect to homepage if translation is not available in Drupal

I have a multilingual site on Drupal 7 with language links displayed and I want to be able to redirect the user to the homepage if the translation of a node is not available.
Is there a way to achieve this?
The easiest solution is to use this module: https://drupal.org/project/multilink.
The problem is that Im not sure if this module can redirect to homepage.
The best solution is to create your custom module and implementes hook_node_view
function yourmodulename_node_view($node, $view_mode, $langcode){
// show 404 page if current language does not match content node language
global $language;
if (!empty($node->language) && $node->language != $language->language) {
drupal_goto('<front>');
}
}
Im not sure if this code works, but its the correct way.
Regards.

How to remove Cataloge URL from ubercart

How to remove 'catalog' from url, for example
my site
http://[my_site_address]/catalog
shows me all categories in unbercart.
I want to change 'catalog' from url and replace it to 'store'
I try to change it from view but it is not changing.
Guide me I am new to drupal.
You can make a new URL Alias under Configuration with the path module. It's part of Drupal core, and may already be enabled.
For the rest of the catalog (for e.g www.site.com/catalog/1), you should use this Path Auto http://drupal.org/project/pathauto module to take effect.

how to change the link in the wordpress email with newpassword?

how to change the link in the wordpress email with newpassword?
this information we get when we click on forgot password.
username : admin
password : admin
http://www.example.com/wp-login.php
here i want to change this url "http://www.example.com/wp-login.php" and set my own url... how can i do?
some reference code:
if ( !function_exists('is_user_logged_in') ) :function is_user_logged_in() {
$user = wp_get_current_user();
You can hook into the retrieve_password_message filter
function someFunction($message, $key){
}
add_filter('retrieve_password_message', 'someFunction');
You would then have to use the "someFunction" function to parse the $message variable and change the link.
The message variable contains the entire message. So you could simply trim the message based on the number of characters then tack on your new link...
HTH
(Untested)
Using hooks would be my first thought so that you wouldn't have to edit any core files, however I have used the SB Welcome Email Editor plugin a couple times for this exact reason. Their are a couple plugins like this out their and they are fairly light weight and allow full customization of all Wordpress generated emails.
Try using a plugin such as Theme My Login, which does everything for you.
Editing core wordpress files is never a good idea, when updating wordpress, you'll loose all your work.
You can simply follow steps if you want to edit your code file.
Go to your wordpress folder. Look for the following files:
1. /wp-login.php
2. /includes/functions.php
Change the all the codes which contains wp-login.php into your custom URL.
for example: admin.php or client-login.php
Now you can changed your login/signup URL into your custom URL.
Known issue: You can find some database error if you make any mistakes. Just refresh the page and try with the customized Url it will work...
Example site I used here : http://androideveloper.com/admin.php from http://androideveloper.com/wp-login.php
Cheers.

Resources