Linking to a specific section of a page from Google custom search engine result - search-engine

I would like to know if there is a way when using Google custom search engine to have Google CSE link to a page with a URL like this
http://www.mysite.com/mysection/mysectionarticles.html#myarticle234
or something close to that.
Let’s say Google would find the searched words in a certain part of the page it could be in a or after an anchor or something like that and would supply in the search result a way to link to this specific section of the page.
So if you have big pages the user wouldn't have to scroll through the page to find the relevant part he saw in the CSE snippet.
It could also be used if you have a dynamic page that change state using JavaScript. Part of the page is hidden to the user until he does an action in the pages, but this hidden content was indexed by Google because it’s part of the page. So when the user clicks on the link in the search result he ends up on a page and can’t find the relevant part because it’s hidden.

Take a look at Google's support for structured/rich data and ajax urls for crawling (aka hash-bangs). One or both of them ought give you access to the pages with the right things displayed.

Related

How to customize Google Sheets embed

Back in the day, I know it was possible to really customize your Google Docs/Forms. Is that still the case? There were all these tricks about how to make it look the way you want when you embed them onto a page (and remove Google's branding). The closest post I'm finding is from 2014 and it doesn't appear to work anymore.
What I'm trying to do is embed a small table into a webpage -- and only that table. I don't want anything else from Google. This table will be updated by me on the backend, so it can't be just an image.
You have to publish to the web and then get the iframe code to embed. At the top of your Spreadsheet, click File and then Publish to the web. Click on the Embed tab and then on the "Publish" button, this will generate the iframe element you can use in your web.
Within the iframe, there's the src attribute with a URL you can edit with some query parameters to customize Sheet's behaviors, for example, to specify the range to be displayed in the iframe, you can add the range query parameter:
<iframe src="https://docs.google.com/spreadsheets/d/e/[SPREADSHEET-ID]/pubhtml?gid=0&range=[RANGE]&single=true&widget=true&headers=false"></iframe>
In your case it would appear your Spreadsheet ID and you need to replace the [RANGE] with the A1 notation of the range you want to display.

Create custom google search with options to search the web and my site

I want to create a custom google search for my site. My requirements are as follows:
I need a text box for search and two radio buttons(one for searching my site and other for searching web).
Depending on the radio button selected the results should be displayed.
I have a separate search results page ('/search').
I know how to create a simple google custom search. But this requirement of providing an option to search the site or web is a little tricky for me.
Please help
I was able to solve this issue.
I first created a search engine in https://cse.google.com/cse/ for my site and configured it to search the web in Basics tab-> Sites to Search option.
With this the search engine would search the entire web.
The code that I placed on the search results page had something this:
"gcse:searchresults-only as_sitesearch='site to search'"
This is a part of the code that google gives you.
Here the parameter 'as_sitesearch' will control which site is to be searched. When the radio button of Searching the web was selected I did not pass any value to 'as_sitesearch' and when the radio button of Searching my site was selected I passed the site url to 'as_sitesearch'.
This worked for me

Joomla - Wrong url path from google results

I have a strange problem in one Joomla website.
If i access from homepage and then navigate into the site it works correct, but if i go in some internal page from google results it shows uncorrect page layout, because the url is not correct.
This is the correct url
Correct page from homepage
and this the uncorrect url that Google finds Uncorrect page from Google
in this second page is showed rating module (that i never used) instead of an article, as you can see in links.
Someone can help me?
EDIT: I'm using Joomla 2.5 version. Every menu item is category blog type, and must show all articles of one category. Each category have 2 articles. In the uncorrect link seems that it access to single article, adding the rating that i have hidden in each article
Which version are you using?
if you can turn on SEF option in the global settings in joomla admin. Then you need to make sure all your articles are in menus. then if you link them on different pages it should keep the url the same.
The way you have it at the moment with all the x=123&... get params pages will show for what ever ids you change the menu to.
The reason you are seeing an uncorrect layout is the two different Itemid parameters (the right url has 127 while the wrong one has 104). The rest of the difference in the urls will be ignored by Joomla.
Solution: Find your menu item with id 104 (look at the menu ids on the right of the menu items view), then check which modules appear on the page from there. There may be modules in non-visible positions.
One of these modules is publishing the links with the wrong ids. If it's a Joomla core (like a search module) you can usually force the Itemid either in the module or in the component's configuration. Else you need to fixsome third party code.
Only once you have solved the multiple-itemid should you turn on SEF, otherwise you'd get the same problem only more difficult to trace.
sh404 could help you with this, I'd give it a try on a test site to see if it gets you out of trouble faster.

Using Page Anchors In Primary Site Navigation

So I have a basic (Wordpress powered) portfolio site where most of the content lives on the homepage, and then I'm using a custom posts category for the featured projects, so users can click through and get more info on the project at its category-single.php page. So the idea is it's a pretty flat site in terms of structure.
So flat, in fact, that the site navigation in the header simply links to content that is all on the home page (About, Work, What, Contact are all sections on the home page that get scrolled down to when you click).
What I want to happen is when the user is on the home page, and clicks one of the top nav links, the page scrolls down to that section (no problem here - I've got this part working just fine), and then when the user is on another page of the site (think one level deep, a custom post page) if they click the header nav links it returns them to the homepage and scrolls them down to that section. I'm thinking in terms of basic url anchor structure, like http://somesite.com/page#specific_section where that link takes the user to a specific section on somesite.com/page.
However the trouble I seem to be having is with creating these url's correctly. I've written them as mysite.com#about, mysite.com#work, mysite.com#contact, mysite.com#page-top, but instead of trigging the user to go to the homepage, the browser is interpreting those links as instructions to look for those sections on the current page.
What am I doing wrong, and what is the correct way to accomplish this?
The thing I'm trying to consider additionally, is whether I need to create PHP logic that displays the links one way on the homepage, and another way on the rest of the site.
What you need to do is use the actual filenames of the pages in question, like:
mysite.com/aboutme.html#qualifications
`mysite.com/portfolio.html#ZirTech
For links to the homepage, try either using the root relative path or fully qualifying the link like so:
http://www.mysite.com/#section fully qualified
/#section relative path
You shouldn't need to implement them a different way on the homepage - just implement them properly throughout the site.
When you write the URLs as mysite.com#work, mysite.com#contact, mysite.com#page-top the browser looks for the page in question, because it is not instructed to go to another page (you need to add "/" to redirect it).
If you want them to point to the main page, set them as
mysite.com/index.php#work, mysite.com/index.php#contact, mysite.com/index.php#page-top
Maybe it is possible without index.php, but I'm a bit lazy to test now:
mysite.com/#work, mysite.com/#contact, mysite.com/#page-top

Making a website without hyperlinks

I am making a simple CMS to use in my own blog and I have been using the following code to display articles.
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("maincontent").innerHTML=xmlhttp.responseText;
}
}
What it does is it sends a request to the database and gets the content associated with the article that was clicked on and writes it to the main viewing area with ".innerHTML".
Thus I don't have actual links to other articles. I know that I can use PHP to output HTML so that it forms a link like :
<a href=getcontent.php?q=article+title>Article Title</a>
But being slightly OCD I wanted my output to be as neat as possible. Although search engine visibility is not a concern for my personal blog I intend to adapt this to a few other sites which have search engine optimization as a priority.
From what I understand, basically search engine robots follow links to index the web sites.
My question is:
Does this practice have any negative implications for search engine visibility? Also; are there other reasons for preferring one approach over the other as I see that almost every site uses the 'link' method.
The link you've written will cause a page reload. In order to leverage the standard AJAX stuff you've got at the top, you need to write the links as something along the lines of
Article Title
This assumes you have a javascript function called ajaxGet that takes an argument of the identifier for the article you're searching for.
If you were to write your entire site that way, search engines wouldn't be able to crawl you at all since they don't execute javascript. Therefore they can't get to anything off the front page. Also, even if they could follow the links, they'd have no way of referencing the page they got to since it doesn't have a unique URL. This is also annoying for users, since they can't get a link to an exact story to bookmark, send to a friend etc.

Resources