Elxis CMS Forum

Support => General => Topic started by: judelgado on July 02, 2016, 01:11:37

Title: Embed external URL
Post by: judelgado on July 02, 2016, 01:11:37

  Is there a way I can embed an external page into an article body?

   I tried <iframe>, but the URL is not loading inside the frame.  I tried with the youtube embed code and it worked.

   Thanks for the help.
Title: Re: Embed external URL
Post by: judelgado on July 04, 2016, 19:14:33
Hello? Anyone?
Title: Re: Embed external URL
Post by: farmville450 on July 05, 2016, 00:57:29
First this is not a problem of Elxis. The iframe works but should allow you to display the owner of the page you want to view. The website that you want to view belongs to you ? If not, then you may need to get permission to do that . If it belongs to you then it is easier , and legitimate. However you can search for cURL in PHP. There are several ways , but I do not know whether it is legitimate . Also you must know that this weighs the server and do much slower your site.
Title: Re: Embed external URL
Post by: datahell on July 06, 2016, 20:44:53
Why don't you use the wrapper?

Administration > Menu > Mainmenu (or other) > New > Wrapper > Set the options for the framed page.

Security note
Since Elxis 4.4 the display of iframes is controlled by the X-Frame security policy setting. You must have Accept X-Frame = Yes in order for the browser to load the external page. Or "Accept X-Frame = Same origin" and the iframe source to be a URL in the same domain. Or specify an allowed domain. It is not recommended to use iframes to load external content (embed plugins and iframes sucks). Do it only if you can't do it elsewhere (there is always a better way than this). iframes can lead to serious security problems (imagine the third party to replace the framed page with malicious code, it will run in your site).
Title: Re: Embed external URL
Post by: bully on November 12, 2018, 11:37:21
I am running still on the same problems. .Whilst the wrapper does it's job, for me it only brings FULL pages. So I also wish for myself something better/different for data interchange
Title: Re: Embed external URL
Post by: datahell on November 12, 2018, 18:59:14
If you try to include a URL then everything in the page will be included, isn't it obvious?
If you want to include just a part of the page then you need a kind of remote connection (like an API) to fetch you just the data you want and then display them in the format you want. There are open protocols for this like Syndication (RSS, ATOM, etc) but you are limited to the content the third party sites provide you (for example elxis.org RSS feeds (https://www.elxis.org/rss.xml)). If you want something custom and you have access to third party site you can develop a special API and get exactly what you want (for example IOS Rentals API Client (http://iosr4.isopensource2.com/rentals-api-demo.html)). To do this without access to third party site you need to develop a script that will do these:

- Load remote URL via PHP CURL
- Remove the html from the page that you dont need
- Remove styling and javascript
- Display the resulted HTML in your site with the style you want.

To provide you the best answer I must know EXACTLY what you want to do.
Title: Re: Embed external URL
Post by: bully on December 10, 2018, 14:33:16
ok, I know, a lot of time passed, and less taken care off due to some work ..

I have multiple sites, one of them is a pure shopping cart (blesta).
What I need/want to:

fetch via ????? certain products/pricing/descriptions/promotions ...... and display in the elxis site. None of them equals a page, e.g. hostings starts as from (lowest value) categories ....
and the ????? is likely mysql as a straight forward.

Also would be possible, to extract the values via a cron job and and force it into the Elxis content, however, that is not really, what I want, as extensive work for little value
That was with the lovely php insert before 4.x very well working.

Whilst the wrapper is working pretty well, it's always only the whole page and ONLY the whole page and the IFrame fails again on the none-existing sites and still would add all, after the required.