Setting canonical tag for front page in Drupal? - drupal

In most of my drupal 6 sites, I use pathauto, xmlsitemap and nodewords. I like having canonical tags for all pages, as an added layer of protection against having duplicate content.
My site's front page is set to "node/31". The problem I ran into this morning was that Google had indexed "node/31" as the front page. (It was in my XML sitemap, as well as the canonical tag.) So I installed globalredirect, and so now "node/31" redirects to the "/". I also removed the home page from the xmlsitemap. I assume that google will soon remove "node/31" from its index. All is good... except that the canonical tag still shows "node/31".
I'm sure there is an easy solution here, but for some reason I just can't think what it is. The easiest solution would seemingly be to create a path alias for "node/31" to "/", but that's not possible. I also tried to set the canonical tag for the front page via admin/content/nodewords/meta-tags/frontpage but it seems to have no effect.

Try the donwords configuration, it allows for a specific front page tags, and entering tages in the node edit forms.
one of this options should resolve your problem
Avner

#kiamlaluno yeah, you're right, it's a very localized question. It's 3 questions in one, but they are all related to how different modules interact with the front page. I could have broken it up into 3 more general questions, but they all related to the aliases.
#AgA: It's all about control. I want to control the URLs that Google indexes, and I don't want duplicate content. (Also, clients just don't want to see "node/xxx" anywhere.)
I did find a solution:
Remove the front page from the XML Sitemap. It will be indexed regardless.
Delete any alias for the front page.
In Nodewords settings, select "Use front page meta tags".
The only thing I don't like about this solution is that my site editors can no longer edit any meta tags on the node edit page. Once you select "Use front page meta tags", the only way to change them appears to be on the Nodwords admin pages.
The "Use front page meta tags" is a bit confusing, in that Nodewords was already inserting a canonical tag before I enabled this setting. Also, it's easy to enter tags at admin/content/nodewords/meta-tags/frontpage thinking they will show up on the home page, only to realize that you also have to enable "Use front page meta tags".
Problems solved.

Related

Wordpress / WooCommerce SEMRush Crawl Warning: Resources are formatted as page link

When adding an image to a WooCommerce Product, by default it creates a link that SEMRush flags up as a crawl issue, despite this being a default of WordPress.
"We detected that some links to resources are formatted with HTML element. An tag with a href attribute is used to link to other webpages and must only contain a page URL. Search engines will crawl your site from page to page by following these HTML page links. When following a page link that contains a resource, for example, an image, the returned page will not contain anything except an image. This may confuse search engines and will indicate that your site has poor architecture."
Their suggestions is this, but of course WP does this by default:
Review your links. Replace links with tags necessary for specific resources. For example, if you’d like to add an image, use an tag with an alt attribute describing the contents of your image.
Have you experienced this and if so, how did you get around it?
I have researched the problem and found only a few mentions of this, one suggests an edit of the functions.php file which I did try but it's not worked. Additionally the use of a code snippet, which again has not worked.

Wordpress how to link a page to blog content

This may seem novice, but I assure its not.
So, I have a site, which displays blog posts by date from new backwards.
Standard stuff. However, what I'm trying to do is create a temporary homepage, lets call it 'yogo'. It displays some ad, or image, with a button link.
What I'd like is a direct link to the actual blog feed which displays in a given theme site's frontpage. Is it just a block?
When Im in Appearance->Reading, I can change homepage to 'yogo' fine. But, say a visitor is on 'yogo', and I want a button they click on to link to what would be the original theme frontpage with blog content, it should technically be 'Home' but is that coded somewhere through the wordpress software like the Reading mentioned above.
Maybe Im missing something, should I shut off permalinks, and dig for it in actual page extension?
Im trying to avoid using Guten. or Elem. to build out a blog page.
Any advice, thanks in advance.
Once add your code in front-page.php or home.php you can use get_the_permalink() function to get the blog page URL and will pass in "a" HTML tag like this -
Your Blog Name
Might be it can help you.
Just a quick update. actually solved this.. In simple terms, it is possible to do this really quickly through the Wpress UI. From your backend, these are the steps in the following order:
(firstly. shout out 2 user 'mirchev' because if u didn't point out templates I would of been way off. actually after about an hour of research after that) So it all takes place in Setting->Reading. From what I've read, Wpress started off as a blog based system anyways, so it was solved a long time back. Basically to start, 1. Create 2 pages, no need to add any content as long as they are 'new' and you make note of the names.
2. Also important -in the template area to the right panel when the new page editor loads up (you don't need to add any texts, images or whatever, including the area on the right just make sure "default template" is selected. 3. Afterwards, these 2 pages are 2 be used in the Setting->reading section.
What you want to do is when you enter this setting of your Wpress site, instead of having your "homepage" radio button be "latest posts" set it to 'static page,' and 4. important - select 1 of the 2 new pages you created as the static page. 5. Now, also important, for the posts page, select the 2nd of the 2 new pages you created. 6. Once this is done, what happens is your website loads the static page, which you may customize however, and then you can go into your Appearance->menus and add the appropriate link to the 2nd of the 2 new pages you created to load the blog, or link to it whichever way you choose. More often than not a menu item should appear if that is the setting you customized.
..And that is all. if fact I was very surprised just how smooth it was.
good luck ! ..--'''~~**
Separation!

Drupal add link to another page in header of a block

In Drupal 7 I created a views page, and I want users to have the option to view the results either as a list, or with thumbnails (like on a lot of websites). The only way I can think of doing that is creating one page with the results as a list, and having a link to another page with the results that have thumbnails.
But my question is, how do I add just a random link to the top of my block page that will direct users to the 'thumbnail' page?
I tried to use 'unfiltered text' in the header and put the html for a link in there, and when I went to the page it looked like a link, but I couldn't click it. Any suggestions?
For every view you can create set of templates to style it. When you edit you view open "Advanced options" and then at bottom click on "Theming options" (or suggestions...can't remember real text).
That way you'll get a very useful popup which displays all templates used by view...in specific theme. So if you want to change some template just click on it's original name, pick up it's original code (copy) and create a file. Save it at your theme templates directory, pick some of suggested names, add your link or what ever html you need and clear the cache.
Templating is a bit broad subject to discuss in details for you questions's answer - find some tutorial on net, but general idea is to use custom view template and store your html there.
BTW, I hope you have only one view and different displays for you different pages.

Drupal 7 Views - Node Content Not Appearing

I have an issue in Drupal with getting node content to display itself. I suspect it could have to with the CSS styling, although I'm not 100% sure what's causing the issue.
Background:
So basically I'm trying to setup a blog but I'm running into serious issues trying to simply get the blog posts to display themselves.
I created a custom Drupal 7 theme using the export function of Artisteer (http://www.artisteer.com/?p=overview). A stylesheet called style.css was generated. I put some of my own CSS into this stylesheet along with the parts that were auto-generated. I should mention I did some amount of custom CSS to force the homepage to look the way I wanted.
I followed the instructions from the PDF at (http://learnbythedrop.com/buildingyourblog) to create a blog (great easy-to-follow guide). The most relevant pages for Views are pages 34 - 36, where he takes you through how to create a "Blog Post" view, in order to display your blog content correctly. However, when I got to the point where he created sample blog content and it displayed it's title and main content, this simply didn't work for me. See this link for example (Sample content that I created for testing purposes):
(http://www.productworld.com/blog-posts/2012/06/08/hello)
I can see a list of titles for sample content that I created (under the Recent Posts block), but I can't view any content from the individual blog posts themselves. The page is just blank.
Also, I can't see a list of the titles and teaser links - it should show up under (http://www.productworld.com/blog-posts) but that URL gives me a "page not found" error. This was something that worked in a previous iteration but now does not work.
Here are 2 screenshots of my View settings, in case it's relevant:
http://i.imgur.com/uadew.png
http://i.imgur.com/9yOUk.png
Questions:
What is the likely cause of the blog content not displaying? (If I do a preview of the blog post within the Views section I can see the blog content just fine, it just won't display on the actual page.) Is it styling? Some setting in Views? Some Block setting? I've searched my style.css file and tried commenting out everything to do with "content:hidden" and "display:none" to no avail. I've tried every combination of settings in the blog posts View to no avail. I've tried placing "Main Page Content" and "View: Blog Posts" blocks in various regions, and changing around the settings that restrict where the block can be displayed. The blog post title/body content doesn't show up in the page source at all, which could be a clue. How would I go about debugging such a problem?
Why is www.productworld.com/blog-posts saying "page not found", even though I've specifically set up a view to create a page at this URL? And why does www.productworld.com/blog-posts/2012/06/14/hello-world-3 show up as a valid page, when it contains "blog-posts" in it's URL?
Any help would be greatly appreciated. If I should display stuff to do with my stylesheet please let me know.
To me it looks as if you have panels overriding the Node template. Which is why your node is not being displayed properly.
Go to Structure > Panels and see if the Node Template option under Manage pages is enabled. If it is, that's probably your issue. You can tell if it's enabled by looking to the right of the text to see whether it says enable or edit.
You can then edit that setting and then edit the content and choose Node > Body to get the body of the blog post to show correctly.
Take a look at this intro video to panels if you aren't familiar with it. http://yadadrop.com/drupal-video/panels-3-overview
Take the leading '/' character out of your page path for the view - internal Drupal paths should generally never have that, but the system will prepend the configured base path to paths on your behalf (and it is probably already a '/').

Drupal: How to Remove/Redirect node listing page

I recently launched a Drupal site and noticed, after looking through my admin logs, that there existed a page in which a summary of every node on my page could be viewed. I found that this page was accessible at [mysitename]/node?page=1 and showed a list of all nodes in my site with a paginator at the bottom.
I've never run into this before and I'm unsure how to remove or re-direct from this page. It doesn't seem to be coming from a view or a panel, and I've never encountered this issue before, so I'm at a loss as to what's creating this page.
Here's an example of what I'd like to disable:: http://drupal.org/node?page=1
/node only shows pages with the "promoted to front page" option ticked. If you don't use that, it should be empty.
One way you could do it would be using Views; you could override /node to display something else ("Sorry, I don't feel like letting you do that today.").
Also searching the web for "drupal disable node" finds some useful stuff - e.g. http://groups.drupal.org/node/32704. That page has a variety of good answers.
Do what Chris Morgan suggested and also, to prevent double content issues with Google and other search engines, use .htaccess or robots.txt to prevent anyone to enter /node.

Resources