ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > RocketCake
forum topic indicator Google Search bar.
person icon
alanbeasy
Registered User
Quote
2019-05-29 11:59:08

Below is the code for a google search bar to insert into your webpage.

You can use a basic container for this (you don't need the HTML container)
Put your container wherever you want and size it accordingly.

Right click the container / select HTML code
Paste the code into the "Additional attributes"

(Copy and paste the code below exactly)

Click OK.

You will not see any google search bar until you click "Preview"

You will need to tweak the properties of your container to make it look right.... especially the padding.

I made the following settings in Properties:

BackgroundColor: 0080C0
Transparency: 20
BorderMode: Solid
BorderColor: 404040
BorderWidth: 1
Corners:Round
BorderRadius: 15

PositionType: Normal
Size: 52%, auto
MinWidth: none
MinHeight: none
MaxHeight: 30
VerticalAlignment: Top
Float: none
Margin: 0, 0, 0,0
Padding: 10, 0, 0, 0

(Note.... in order for the padding to work at the top of the container, I had to include a dot . in the code below as per the "<div1>.</div1>"

So copy the code exactly (except of course using your own website URL in place of "www.yoursite.com"
Don't add or subtract any dot or dash.
After you have saved your page you can experiment with other tweaks and customize your search bar.

=============================

<html>
<head>
<title>www.yoursite.com.</title>

<head>
<body>
<div1>.</div1>
<script>
(function() {
var cx = '011872246394152904367:3eee9xhqahs';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
<div2>
</div2>
</body>
</html

person icon
cf64
Registered User
Quote
2023-03-24 18:23:55

Hi!

I entered the same code like the one into the previous email (just change the website.com). See below

<html>
<head>
<title>www.consultingfirm.fr.</title>

<head>
<body>
<div1>.</div1>
<script>
(function() {
var cx = '011872246394152904367:3eee9xhqahs';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
<div2>
</div2>
</body>
</html>

The problem is, that, while i enter any name into the search window, it's not the same result as the one I get if I open a window on my PC... Why that?
As an exemple, for the name RocketCake, with the code above I get

"Find Rocket Cake Web Design - Find it here - Rocket Cake Web Design
Ad
https://uk.greatselections.co/results/your_search
?
Search for Rocket Cake Web Design at GreatSelections. Attractive Results. Get More Results. Online Information. Popular Searches. Related Searches. Find Answers. Quality Results. Search Now. Internet Information. Types: Home & Garden, Finance, Vehicles."

And if I open a window on my PC I get the Ambiera website directly:

"
RocketCake - free Responsive Website Builder Software

Ambiera
https://www.ambiera.com › rocketc...
·
Traduire cette page
RocketCake is a free website builder software for creating responsive websites. For beginners and professional web developers. No coding required.
"

Can someone help me on that?
Thank you in advance Gents!

person icon
niko
Moderator
Quote
2023-03-26 07:49:39

Only google knows why the search results are different. Not sure exactly what they are doing there.

person icon
cf64
Registered User
Quote
2023-03-26 11:49:47

Thanks a lot NIKO.
So, what is the interest to add this kind of research into a website then if we cannot get the rights results?
From your point of view, do you see any interest?
Based on your huge experience, is there any other web searcher that I could add to have better results?
Thank you again for your great help and huge support NIKO!
Best regards...

person icon
lil_caramac09
Registered User
Quote
2026-04-17 10:38:21

What is the code for adding a working search bar please and thank you

person icon
erik
Registered User
Quote
2026-04-17 11:36:05

This thread is old, you can use the search engine component, it works and is easier to use: https://www.ambiera.com/rocketca...


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |