(SOLVED BUT THERE IS A SIZE PROBLEM) Trouble adding Code!

Hello! Im trying to add some codes into my page to connect it to an external search engine for a travel agency but Im getting this:


I have no much idea about coding so any help would be super great!
Thank you :slight_smile:

is that what you are seeing when you preview the page or is it what you see when you add the code into blocs.

Yes! I need to connect a search engine to my page as we are launching a travel agency but the company who owns the motor and the bookings system have some very ugly web templates and they don’t know how to add the code to my site. They just gave me the code: Also most of the steps are in polish and I don’t understand the language, only my wife and cause is all to technical is on Chinese for her swell hehe

Here are the steps to add it https://www.merlinx.pl/vibe_podlaczenie_en.php

The iframe looks very bad on the site and as they said on the text not very professional.

They also send me this code as n example of the connection but they dont know what to do with it!

<?php

require_once 'rwdGate.php';

$rwdgate = new rwdGate('fe81ac43ba1059');

$widgets = array(2471037, 2471022);

$rwdgate->fetch($widgets);

if ($rwdgate->isRawResult())
{
  $rwdgate->printRawResult();
  die();
}

?>
<!DOCTYPE html>
  <head>
    <?php echo $rwdgate->getSection('HEAD'); ?>
  </head>
  <body class="homePage">

  <div id="wrap">

    <?php
    $menuFile = basename(__FILE__);

    $list = $rwdgate->getSectionsList();

    if(in_array('2471037', $list))
    {
      echo '<div style="width:800px; border:1px solid lime;padding:5px;overflow:hidden">'.$rwdgate->getSection('2471037').'</div>';
    }

    if(in_array('2471022', $list))
    {
      echo '<div style="width:800px; border:1px solid lime;padding:5px;overflow:hidden">'.$rwdgate->getSection('2471022').'</div>';
    }

    if(in_array('BODY', $list))
    {
      echo $rwdgate->getSection('BODY');
    }

    ?>

  </div>

<?php
  if(in_array('FOOTER', $list)) {
    echo $rwdgate->getSection('FOOTER');
  }
  ?>
  </body>
</html>

Im assuming you followed this?

If not, can you describe what you have done so far?

Hi! Yes I did that first! Then i try to improvise and ad the code on the page. Normally it would work I think. But is all php code so don’t really know what to do. Tried to follow all the steps but nothing happens :frowning:
I also try with the bricks and but no luck. So frustrating not to be available to do something.

HI Have you set the page as .php instead of the default htnl (under page settings ) ?

MDS

Yes! The funny thing is a friend come by today and knew the programer of this code. So I got him on the phone for a little while and explain me that basically I won’t available to do it if im not a programer. The code i post here needs to be uploaded as a file to my hosting but I need to change some stuffs inside. Couldn’t talk much but its looks complicated :cry::cry:
Also when i export the project i still get an index.html and not index.php is that correct?

Hi

To be honest have not had the time to look at the code, really too busy. But for sure you need to have the page with the .php extension.

See below screenshot:

MDS

1 Like

Yes, I have it like this but when exporting the project is an index.html right? Would be great if you could check the code when you will have time

So its seems than only two person in this forum actually knows about code no?

If you set the page file type to php, the page will be exported as index.php - not index.html. If you attempt to preview the page, you will not see the web page as a normal html page - you will see a page of code as seen in my example below.

This is because php is a server side scripting language that can only be seen when viewed on a web server running php. For example, the page in my example above will display correctly when viewed from a server and will look like this:

We use PHP to extend the functionality of web pages. In the above examples, PHP is being used to do do two things. Firstly, the very first line protects the page from unauthorised access. It then reverts to HTML to display the page contents. Further down in the code, PHP comes into play again to display a list of protected downloads. This would not be possible in HTML alone, so we use PHP snippets to perform these additional functions.

Whenever a piece of PHP code is added to a page, it must be exported with a PHP extension so that the server knows how to interpret the page. It’s a bit like saving an Apple Pages document with a docX extension. When it’s opened, it will open in Microsoft Word (assuming Word is installed)

For non-coders, we are often given a PHP snippet to add to our normal HTML pages, as you have. It’s easy to embed using the code widget in Blocs. However, the only way to see what the code is doing is to export the page and upload it to a server and then view the uploaded page in a browser. This is what I suggest you do with your piece of code. Just add it to your page following the instructions you were given, upload it to your server and then take a look in your web browser of choice. Of course, you must have PHP available on your server. You don’t have to understand the code in order to add it to your page. You just need to know where to add it (head, body or footer) and you have to know if any other files will need to be uploaded to your server (scripts etc) for it to work correctly.

Hi! I managed to add the code! A friend of a friend was looking into it but he doesnt know blocs! He is a programer! He told me he thinks there is a problem with the .htacces and my server 1and1

So I took the code and try to add it in different blocs changing the widgets id but it looks very bad
http://volfly.net

And it should look like this for example:

The carousel

The Search Engine

Some of the offer blocks

Any ideas?

Did you use the .htacess file that was referenced in the documentation? Or at least added the correct entries in your existing .htacess file?

apparently it wont be possible to implement this code into blocs! cause the connection to merlinX wont work! I think I will have to rent one of they pages but their are sooooo ugly!!! :sob::sob:

Thats weird, because it looks like they do support doing that. Using Blocs shouldn’t make any difference.

Sorry we couldn’t be more help to you. Good luck with the launch of your new business.

But how would be possible to add this code into blocs? Did you check it? I dont think than anyone have actually check the code

When i paste the code into blocs nothing happens. The htacces code was giving by merlinx but this friend of a friend find a problem on the code and fix it.

This is what Im getting!

Did you get a “installation package” as mentioned in the documentation. It implies there are example files in it, there should be a CSS file, that will give you the classes you need. That screen shot you are showing looks like its missing styles.

You won’t see it in Blocs.

Hi! Im following the steps but they are a bit not clear!

This is the info you have on their page:

GATE: Search engine implemented on your website – good-looking and professional!

On your website, you implement scripts which tke the search engine from our servers and implement it as a document content (integrated element of your website). Apart from search engine, the additional widgets are available, e.g. promotional box which can be place anywhere on the website. A single activation fee is only 100 PLN/net. The price includes necessary files and a simple demo site with available widgets.

Upload file on the server

Before the installation, please upload files .htaccess and rwdgate.php located in the installation package. Other files from the package are additional and are only the demonstration of the installation. Server configuration file (.htacess) has to be installed on the main folder of the project (the index.php file will be located there as well)), rwdgate.php file may be uploaded in any location but make sure to set the correct path during implementation of the library (see point 2).

2. Library implementation (in the constructor, provide affilliate identificator which can be found on the administration bar in the VacationsCMS panel):

<?php  
    require_once 'rwdGate.php'; 
    $rwdgate = new rwdGate('3987123456'); 
?>

. Widget implementation (using id):

<?php $widgets = array(lista_id); ?>

sample:

``<?php $widgets = array(2120310, 2120315, 2120320, 2120330, 2138306); $rwdgate->fetch($widgets); ?>

Widget Id can be found in the VacationsCMS administration panel after selecting preview ID option (top menu of the panel, black bar - Configuration).

4 . Addition of the code required to access Javascript/CSS resources using client’s server. Any test/HTML content cannot be sent to a browser prior to requesting the code.

<?php if ($rwdgate->isRawResult()) { $rwdgate->printRawResult(); die(); } ?>

5. Header implementation in the head section:

<?php echo $rwdgate->getSection('HEAD'); ?>

6. Implementation of parts:

Any iteration method can be used, either by elements or element id (sample):

<?php $list = $rwdgate->getSectionsList(); if (in_array('2120310', $list )) { echo '
'.$rwdgate->getSection('2120310').'
'; } ?>

Notice: it is necessary to implement BODY element, which is responsible for further steps of search process (results, details, booking and confirmation).

<?php $rwdgate->getSection('BODY'); ?>

If you want to show some elements on the main site but not on the other subpages, use the following condition:

<?php if (in_array('BODY', $list )) { echo $rwdgate->getSection('BODY'); } else { echo 'elementy strony głównej'; } ?>

7. Footer implementation (after implementation of every other element/widget)

``<?php $rwdgate->getSection('FOOTER'); ?>

8. Offer cart

Display of the amount of offers added to the cart (information displayed in any place on the website):
Schowek ofert:

Display of the open cart with offers as a new layer. Needs to be implemented just before the BODY element.

``<?php echo ''; ?>

9. Autosearch

Quicksearch field.

Add autosearch to a list of received elements:

<?php $widgets = array(2120310, 2120315, 2120320, 2120330, 2138306,'quicksearch'); $rwdgate->fetch($widgets); ?>

Display search field in the chosen location:

<?php echo $rwdgate->getSection('quicksearch'); ?>

The cart works fine cause is an html code but not the others so they also send me an example of connection and is this one:

<?php

require_once 'rwdGate.php';

$rwdgate = new rwdGate('fe81ac43ba1059');

$widgets = array(2471037, 2471022);

$rwdgate->fetch($widgets);

if ($rwdgate->isRawResult())
{
  $rwdgate->printRawResult();
  die();
}

?>
<!DOCTYPE html>
  <head>
    <?php echo $rwdgate->getSection('HEAD'); ?>
  </head>
  <body class="homePage">

  <div id="wrap">

    <?php
    $menuFile = basename(__FILE__);

    $list = $rwdgate->getSectionsList();

    if(in_array('2471037', $list))
    {
      echo '<div style="width:800px; border:1px solid lime;padding:5px;overflow:hidden">'.$rwdgate->getSection('2471037').'</div>';
    }

    if(in_array('2471022', $list))
    {
      echo '<div style="width:800px; border:1px solid lime;padding:5px;overflow:hidden">'.$rwdgate->getSection('2471022').'</div>';
    }

    if(in_array('BODY', $list))
    {
      echo $rwdgate->getSection('BODY');
    }

    ?>

  </div>

<?php
  if(in_array('FOOTER', $list)) {
    echo $rwdgate->getSection('FOOTER');
  }
  ?>
  </body>
</html>

I tried to add this into a brick but it look like this:

And it needs to look like this



Also my friend did a code but it works only in a side of the page and he told me to work good i will need to really know about coding css, etc.

Here is his code, it works good as an index page but not inside blocs!
<?php

require_once 'rwdGate.php';

$rwdgate = new rwdGate('0a3a46aa60a6f8');

$widgets = array(132182304);

$rwdgate->fetch($widgets);

if ($rwdgate->isRawResult())
{
  $rwdgate->printRawResult();
  die();
}

?>
<!DOCTYPE html>
  <head>
    <?php echo $rwdgate->getSection('HEAD'); ?>
  </head>
  <body class="homePage">
  Test
  <div id="wrap">

    <?php
    $menuFile = basename(__FILE__);

    $list = $rwdgate->getSectionsList();

    if(in_array('132182304', $list))
    {
      echo '<div style="width:800px; border:1px solid lime;padding:5px;overflow:hidden">'.$rwdgate->getSection('132182304').'</div>';
    }

    if(in_array('BODY', $list))
    {
      echo $rwdgate->getSection('BODY');
    }

    ?>

  </div>

<?php
  if(in_array('FOOTER', $list)) {
    echo $rwdgate->getSection('FOOTER');
  }
  ?>
  </body>
</html>

I really will like to do it, I want my page not to pay for an ugly rented one :sob: