NopCommerce - using metatag noindex on specific page and language - nopcommerce

I have a site that uses 3 languages. The thing is only one of those languages has a specific page. (the client wants each language to be used for each country that he sells to)
I could create a metatag in the header that would ignore the full page, but that would disable indexing that page in all languages.
Is there a way to disable indexing in a page only in specific languages? (using the WorkContext.WorkingLanguage.Id, i.e.)
Thank you.
TZ

Create a HTML helper method that resolves the IWorkContext and checks the language locale for your languages to ignore, then returns a string with the noindex meta tag. Then, call that in your /Shared/_Root.Head.cshtml view

Related

Wordpress - Polylang: get list of page translations

I'm using Polylang to manage languages on my Wordpress implementation. My default language is French and when I'm on translated pages, I'd like to find the page ID from the original page in French.
I have looking in the documentation but it doesn't look like there is a possibility to retrieve the post ID of the default language (or any other language than the current page).
Do you know any possibility to do this?
Thanks
Laurent
I have found the solution and here is the code:
$original_page_id= pll_get_post($current_page_id, $default_language);
this code will return the page ID from the chosen language ($default_language)

Prepopulate Content Type Args when going to /admin/content in Drupal 7

I created a Drupal site. The admins who will be using the site for content management have no Drupal knowledge and I have been tasked with making this as easy as possible for them. I'm creating an admin control panel and I want a quick link that takes them to the admin content page, but with the "content type" prefilled. For example, for content I have pages, events, resources, and testimonials. I want to provide them with a quick link for editing content type EVENTS only. So it would go directly to admin/content with the type filter set to "events". The URL does not currently add args or anything like that.
Anyone know of a way to do this?
yes you can do this- just use this module: Drupal admin views which supports a REGULAR VIEW for admin/content. The View is set to use ajax though- just remove this option and save it and call /admin/content then. There you will see the resulting filters in the URL (you can even set their keys to a value you like inside the view). Set back to use ajax (if you like) and use the keys in the URL for type it's simple just call /admin/content?type=YOURTYPE

Redirect to wordpress page without page ID

I'm looking for a way to redirect to a specific wordpress page without knowing the ID.
I have a shortcode that is meant to redirect to a registration page once a button is clicked.
Before, I was able to just use a page ID. Now I am using WPML and the page ID's are all different for each language.
How can I redirect to a specific wordpress page without knowing the specific page ID for the current language?
Maybe you could use get_page_by_path() or get_page_by_title().
Both functions accept Post Type as argument, it's not only restricted to "pages". And they will return a full $post object, ie, $post->ID.
Maybe a WPML function is needed, an equivalent of those. Or maybe a combination.
See the docs for Language dependent IDs.
You could add a custom field which will be shared by all versions of the same article, and then query by that instead. Something like an article GUID.

Manually assigning page META tags to asp.net dynamic pages

I just first want to say, thanks for taking the time to read this!
I have an e-commerce website running the content management system DotNetNuke, which I believe is built on the asp.net platform in a windows server environment. The specific module that powers my e-commerce store dynamically generates pages for each of the store categories, as a user browses through the products available. As you may be aware, modules such as these must be placed on a specific page, and all the dynamic content generated by the module must reside on that "parent page".
The problem is that while the module does allow me to add HTML text for H1's and H2's on these dynamic pages, it does not support adding page meta tags such as "title" and "description". As a result, all of the dynamic pages generated by the module pull their meta tags from the parent page, making it difficult for Google to understand what I'm trying to show the user. This also causes google to show all these generated pages as having "duplicate title tags" in my analytics.
The temporary fix:
I have removed the title tags from all of these "parent pages", in hopes that google will decide to generate it's snippits from the H1 and H2 tags residing on the dynamic pages. Was this wise?
Now for the question:
Is there any kind of solution available which would allow me to manually assign meta tags to a page I specify in my hosting environment? As I stated earlier, I am able to add body HTML code to pages. Is there any way to force a page title tag from code placed in the body? Is there a better way to do this? You can view my problem in action at www.yandasmusic.com
Thanks for your time and patience!
Alex
The temporary fix: I have removed the title tags from all of these "parent pages", in hopes that google will decide to generate it's snippits from the H1 and H2 tags residing on the dynamic pages. Was this wise?
Blockquote
No, not particularly wise. The page title is important.
The first route you should take is speaking to the module developer. They should know about replacing page meta information on a per-product basis.
You can get (limited) results by varying the page title/description using javascript when the page loads. Just keep the js simple and use the DOM information already on the page (ie, read the product name).
I posted a blog about this recently : http://www.ifinity.com.au/2012/10/04/Changing_a_Page_Title_with_Javascript_to_update_a_Google_SERP_Entry
The javascript fix will probably work if you set it up correct. But you really need to convince the module developer to change the way the module works, as bdukes has posted.
Don't bother with the Meta Tags - none of the search engines really read/use them because they are so easily spoofed. Just concentrate on the title and description of the page.
Ideally, your store module should be setting the page title and other meta information. In DotNetNuke, you can access the Title, MetaDescription, and MetaKeywords of the page by casting Page the DotNetNuke.Framework.CDefault type. If the store module doesn't provide this, you should ask the developer to add the functionality.

private wordpress post

Is it possible to create a category/post that will not show in the post listing but the post will be available via direct link.
Basically, I want the post/page/category to be viewable only by those I sent the link. I don't want to make it available in the post listing. I don't want it password protected also.
If possible that that the specific post is not visible to search engine, that's much preferable.
Thanks
Yes there is. You could always:
1) Register a Custom Post Type. In this example, we would name it something like "Private".
2) Set up your archive template (archive-private.php) to either redirect to a different page (maybe homepage, or 404), or style it in some way to look like a different page (maybe homepage, or 404) so the posts can't be listed
3) Set up your single post template (single-private.php) to format and display your private post however you like.
You wouldn't have to worry about your existing queries targeting any private posts, no passwords would be required, and the single-posts will be viewable and the archive not viewable. The nice thing too is that if you set 'public' to false in your arguments, the posts won't show up in any searches within the site.
As far as hiding it from search engines themselves, you need to set that within your Robots.txt File.
Bear in mind, this won't PREVENT Search Engines from displaying what's in your Disallow list. It is up to the Search Engine itself as to whether or not it will honor your disallow list.
No, there is not. If there is a way, you'd have to extensively modify your theme's PHP settings.

Resources