Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#91 2012-07-14 14:36:17

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: rah_external_output

Excellent, so elegant. Had me fooled after I upgraded to this latest version until I rtfm and found my XML document renamed and tucked away midst the forms. As an aside, because I don’t know if it’s a v1.0 issue only, I can’t preview the output, an ATOM feed, in any of the browsers I have on my iPad, Safari, Chrome and Dolphin. Error messages say ‘Can’t handle or can’t download this file’. Not a big issue.

Offline

#92 2012-07-14 16:56:44

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_external_output

joebaich wrote:

Excellent, so elegant.

Thanks :)

As an aside, because I don’t know if it’s a v1.0 issue only, I can’t preview the output, an ATOM feed, in any of the browsers I have on my iPad, Safari, Chrome and Dolphin. Error messages say ‘Can’t handle or can’t download this file’. Not a big issue.

Could be a browser thing even. Is the generated Atom file working even when browsers report so? Can you share the code you are using to generate the Atom feed or a link to it? If it’s private and can not be shared, what content-type are you using? It could be either be a unrecognized content-type (by browser), contradicting headers or slightly invalid markup. XML documents are strict about validity.

If I’m not mistaking Safari’s current development version on desktop Mac OS (ML) drops feed support. When accessing a Atom/RSS feed you should be redirected to an application of your choosing. If no feed handler is set, you get nothing.

iOS and Mobile Safari (which is the only browser engine used under the hood on iOS including iPhone and iPad) do not open Atom or RSS feeds at all. iOS uses Apple’s servers to fetch, syndicate, process and convert feeds to HTML pages. If this Atom feed is local or not publicly accessible (e.g. password protected), you will get an error.

Offline

#93 2012-07-14 19:25:14

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: rah_external_output

Hello Again Jukka, Just to be clear, the feed works as intended on desktop (Mac) versions of Safari, Chrome et al. I wouldn’t have know about the iOS issue if I hadn’t been idly laying in bed this morning playing with my iPad. You can see the output in it’s pre-Feedburner state here. The code is:

; Content-type: text/xml
<?xml version="1.0" encoding="utf-8"?>
 <feed xmlns="http://www.w3.org/2005/Atom">
        <title><txp:site_name/></title>
        <subtitle><txp:site_slogan /></subtitle>
        <link href="<txp:site_url/>?rah_external_output=SAFEX-docs" rel="self" />
        <link href="<txp:site_url/>" />
        <id>http://iexpe.org/?rah_external_output=SAFEX-docs</id>
        <updated>2012-07-08T17:21:23Z</updated>
        <txp:file_download_list category="safex-newsletters" limit="1" sort="created desc" break="">
          <entry>
                <title><txp:file_download_name title="1"/></title>
                <link href= "<txp:permlink id='234'/>" />
                <id><txp:site_url/>file_#_<txp:file_download_id/></id>
                <updated><txp:file_download_modified format="%FT%TZ" /></updated>
                <summary><txp:file_download_description /></summary>
               <author>
                      <name><txp:file_download_author /></name>
                      <email>web.form@iexpe.org</email>
                </author>
         </entry>
        </txp:file_download_list>  
         <txp:file_download_list category="safex-incident-notices" limit="9" sort="created desc" break="">
          <entry>
                <title><txp:file_download_name title="1"/></title>
                <link href= "<txp:permlink id='237'/>" />
                <id><txp:site_url/>file_#_<txp:file_download_id/></id>
                <updated><txp:file_download_modified format="%FT%TZ" /></updated>
                <summary><txp:file_download_description /></summary>
               <author>
                      <name><txp:file_download_author /></name>
                      <email>web.form@iexpe.org</email>
                </author>
         </entry>
        </txp:file_download_list> 
  </feed> 

The generated links for each file item in the download list are intentionally identical so that they lead the site user to a password protected page where he or she can find the appropriate link to download the file, a PDF based incident report or newsletter, he or she is interested in.

The Feedburner processed feed behaves identically, it can’t be read in iPad browsers but gets downloaded and presumably could be read in an appropriate reader app. It really isn’t an issue that affects any of the Institute’s users, just me lying in bed playing with my iPad.

Last edited by joebaich (2012-07-14 19:35:56)

Offline

#94 2012-07-14 19:57:01

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_external_output

Everything in that seems fine, and the feed does open properly for me in iOS’ Mobile Safari on iPhone. Well, after Apple has downloaded it on their servers. Mobile Safari itself doesn’t process feeds, but uses a middle man. Never opened a feed in Mobile Safari on iPad so don’t know if acts differently to its little brother or has any error scenarios to look for.

Apple, if I’m remember correctly, will be dropping build in support for feeds from desktop Safari in couple of days when Mountain Lion launches. Same could very well happen to iOS. This doesn’t mean nothing will open feeds, but you will be redirected, or have to relay, to a dedicated application.

iPad browsers

Apple has certain limitation of what applications can do and be. On iOS you actually don’t have browser options. All of the browsers use Safari underneath, and can only change the GUI and behavior outside rendering and core browsing. The fact that every browser acts the same when you try to access the feed isn’t surprise; they are the same browser.

presumably could be read in an appropriate reader app

It can. And both Mac OS and iOS have number of good feed reader options, both web and application based. I personally prefer Reeder which syncs with Google Reader.

Last edited by Gocom (2012-07-14 20:06:17)

Offline

#95 2012-07-15 03:13:17

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: rah_external_output

Thank you for your insight. Yup, my iPhone showed the feed as it should too once I checked after your last. So maybe just an iPad issue, or even just a my iPad issue. Not at all life threatening and your tip about Reeder really fixes it.

Offline

#96 2012-08-31 11:28:20

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_external_output

v1.0.1 released. Changes:

  • Changed: Now doesn’t uninstall rah_eo_ prefixed form partials with the plugin. These forms could be used for something else than just as the plugin’s snippets.
  • Dropped: code path used as a plugin cache fallback. Now relays on existence of plugin-lifecycle callbacks.
  • Dropped: migration cleaner deployed in v0.6. Is no longer relevant.

More info and downloads

Offline

#97 2012-10-08 18:13:59

robbiia
New Member
From: New York
Registered: 2012-08-05
Posts: 8
Website

Re: rah_external_output

Want to use jquery .load function to pull content from a single textpattern install into several different static sites.

All sites are similar in that they only require a single BUTTON text and code to be edited.

I would like 1 txp install to power 6 different sites that have minor variations of info between them.
Because of cross-domain issue due to Same Origin Policy – i can’t do this easily

can I use this plugin to achieve what I need to accomplish?, and if so
what is the simplest method of doing so?

suggestions welcome! :)

Last edited by robbiia (2012-10-08 20:47:58)

Offline

#98 2012-10-08 18:32:35

robbiia
New Member
From: New York
Registered: 2012-08-05
Posts: 8
Website

Re: rah_external_output

Last edited by robbiia (2012-10-08 18:57:27)

Offline

#99 2012-10-08 18:53:14

robbiia
New Member
From: New York
Registered: 2012-08-05
Posts: 8
Website

Re: rah_external_output

Here is the link for the final site: http://www.chicagomeditation.com/new_site/index_ajax.html
Here is the link I am wanting to “pull” content from: http://www.introtomeditation.com/brochure/?rah_external_output=master.html

Help welcome.

:)

Last edited by robbiia (2012-10-08 18:57:51)

Offline

#100 2012-10-08 21:22:20

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: rah_external_output

Have you added a html content-type to your external output ?

; Content-type: text/html

See plugin help

Offline

#101 2012-10-08 23:22:55

robbiia
New Member
From: New York
Registered: 2012-08-05
Posts: 8
Website

Re: rah_external_output

@sacripant

Thank you

I actually just found out a solution from this forum:

I made a get.php file with:

<?php $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, 'example.com/?rah_external_output=name.html'); curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1); echo curl_exec ($curl); curl_close ($curl); ?>

and then .load with jquery like:

$("div").load('get.php');

Offline

#102 2013-03-07 14:28:29

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 605

Re: rah_external_output

I’m having some difficulties trying to include a snippet within a website. Here’s the URL I’m trying to include: http://example.com/calendar/?rah_external_output=db_events

This is the code I’m using to include the snippet:

<txp:php>
		include($DOCUMENT_ROOT .
			'http://example.com/calendar/?rah_external_output=db_events'
		);
	</txp:php>

and here’s the snippets code:

; Content-type: text/html
<txp:output_form form="sys_variables" />
<txp:smd_article_event section='calendar' limit="99999" from='<txp:smd_cal_now format="%Y-%m-%d 00:00:00" now=''<txp:variable name="date" />'' />' to='<txp:smd_cal_now format="%Y-%m-%d 23:59:59" now=''<txp:variable name="date" />'' />'>
	<!-- Status Indicators -->
	<p>
		<strong><txp:if_custom_field name="Event Status" value="New">New &nbsp;</txp:if_custom_field></strong>
		<strong><txp:if_custom_field name="Event Status" value="Cancelled">Cancelled &nbsp;</txp:if_custom_field></strong>
		<strong><txp:if_custom_field name="Event Status" value="Moved">Moved to <txp:custom_field name="Event Moved Date" /> &nbsp;</txp:if_custom_field></strong>
		<strong><txp:title /></strong><br />
		<txp:body />
	</p>
</txp:smd_article_event>

When viewing the page with the included snippet I keep getting the following errors:

Tag error: <txp:php> ->  Warning: include(): php_network_getaddresses: getaddrinfo failed: No such host is known.  while parsing form “calendar” on page “default”
Tag error: <txp:php> ->  Warning: include(http://example.com/calendar/?rah_external_output=db_events): failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.  while parsing form “calendar” on page “default”
Tag error: <txp:php> ->  Warning: include(): Failed opening 'http://example.com/calendar/?rah_external_output=db_events' for inclusion (include_path='.;C:\php\pear') while parsing form “calendar” on page “default”

I’ve also noticed that that the snippets text isn’t being escaped

Last edited by Algaris (2013-07-10 22:52:46)

Offline

#103 2013-03-07 15:10:40

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,377
Website GitHub Mastodon Twitter

Re: rah_external_output

What happens if you use <txp:php>echo file_get_contents('http://cms.truroschool.com/calendar/?rah_external_output=db_events');</txp:php>?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#104 2013-03-07 15:35:06

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 605

Re: rah_external_output

I then get these errors.

Tag error: <txp:php> ->  Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No such host is known.  while parsing form “calendar” on page “default”
Tag error: <txp:php> ->  Warning: file_get_contents(http://example.com/calendar/?rah_external_output=db_events): failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.  while parsing form “calendar” on page “default”

One less than before. Maybe that’s a step in the right direction?

Last edited by Algaris (2013-07-10 22:53:22)

Offline

#105 2013-03-07 16:36:11

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: rah_external_output

Algaris wrote:

Maybe that’s a step in the right direction?

Yes, but not in terms of the error. The error and issue is still the same; the function change doesn’t solve it. But, include() is the wrong function for anything network related and changing it to something else even to filesystem functions is better.

Anyway, as the error says the host name is unknown. In other words, your server can not resolve IP address for cms.truroschool.com. This could be caused by a DNS error or something of that kind.

Offline

Board footer

Powered by FluxBB