I have created a search page for a drupal 8 theme, but the page is cached. Whatever I have inputed for search, it always give me the result of the first query I input.
How can I exclude the search page from the cached?
You can use Drupal 8 CacheExclude module to exclude the search page url from getting cached.
Related
How can I exclude field from caching not excluding page from being cached? Field value is modified using _preprocess_field hook depending on cookie variable. Cache system caches the entire page and mymodule_preprocess_field never called to change the field value.
Any ideas how to exclude this field from caching?
Drupal page cache caches entire page. If you want a small part of data to update, such as user login or up to the date stock prices, you should use ajax, and on the page that's returning ajax set it to not cache.
I'm using Magento multi store and a lot of my pages are equal so I'm using these pages for both my stores. There's just one problem: the phonenumber prefix is different and therefor I want to show in store1 prefix 057 and in store1 prefix 0057.
You see it's a minor detail and I don't want to use double pages based on this so is there a way to show store dependent text?
You can use CMS blocks with the different prefixes for each store, or if you can afford to create your own module, you could use a system config field and add this in your CMS pages : {{config path='path/to_your/field'}}
I've got an online shop with more than 70.000 products. In a few months we will have more than 200.000 products.
Every product has its own url depending on the language, for example:
domain.com/es/aaabbbcccc/product_code
domain.com/en/aaabbbcccc/product_code
domain.com/fr/aaabbbcccc/product_code
domain.com/pt/aaabbbcccc/product_code
domain.com/de/aaabbbcccc/product_code
All those url redirect to the same page but the language depends on the "es", "en", etc.
We want Google to index the sitemap so it knows all of our products so they can be found using Google Search.
I've been reading about sitemaps and if I'm not wrong, they should contain all available url in a webpage, but I know we cannot put 5 url for every product because that would get one millions urls.
Should I define just one url for every product, which would generate thousands of urls? Or is there any way to tell Google the format of a url so it is not necessary to explicitly define all of them?
My magento website has 5 store views. When we are in a product in English and select French, it redirects correctly and show the product in French. But when it comes to categories, it doesn't work at all.
I'm on a category with the url http://myweb.com/en/body-care, if I change to the Spanish view, it doesn't redirect to the url "../cuidado-del-cuerpo" it just goes to to http://myweb.com/es/body-care and shows a 404 error (it changes the 'en' for 'es', but doesn't change the last part of the url).
The rewrite is not defined on the URL Rewrite Management section. I have 5 categories and 5 store views, so it's not a good idea to create the rewrites rules manually.
How can I solve this? Why the rewrite rules were not written when we created/modified the url of each category?
1) Can you check if the urlkey is definable on store view level, or if it is set to website level? That way, you can only create 1 url key for EN and ES. You need it to be at store view level, do define 2 separate values.
2) Is there something in your error log? (and is your error log turned on?) Normally url rewrites are created automatically for each store view. If not, you may need to manually reindex.
It's hard to give further advice, since the problem could be anywhere (conflicting module? bad code?)
I am working on a Magento site, and i would like to edit the default search result.
Editing search result is not editing the appearance of search result but the actual search results generated.
The idea is, if the Magento search does not return any value then i need to do a search in my custom table to fetch some relative products.
Could anyone help me to edit the default Magento search??
Thanks a lot in advance.
You will need to modify some of the models in catalogsearch module, this link has a good explanation of how to override Core classes. In your case you will need to add your logic somewhere in the Query model or its resource or collection models.
This CMS Search extension will provide an excellent example of how to extend the default search. It adds extra content into the search index and allows you to control how those results are presented to the searcher.