Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2010-12-02 10:45:39

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: rah_external_output

I’m trying to use this plug-in in combination with smd_xml. But something goes wrong…
I output an xml feed from one site and then manipulate it with smd_xml in other site.
This is my output url: Event Feed
The content type of this feed is text/xml.

I think the problem is in the output because I test smd_xml with a different feed and seems work well.
Can someone help me?

Last edited by wornout (2010-12-02 10:47:40)

Offline

#62 2011-04-15 02:48:46

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

Re: rah_external_output

Released version 0.6 of rah_external_output.

Changes:

  • Fixed: Saving snippets while changing name.
  • Fixed: Now remember the sent data in the editor if error occurs instead of fetching the old data from database.
  • Added: Translation support. Interface now uses language strings.
  • Added: <txp:rah_external_output /> tag now caches fetched results.
  • Added: Now uses plugin_lifecycle callbacks, and includes uninstaller.
  • Added: Adds an options link to the Plugins pane which directs to the plugin’s admin-interface.
  • Removed: Mime-interface. Was confusing and not so many used it. Trying to simplify the user interface.
  • Changed: The user-interface and markup. Removed heading, removed inline styles, added <tbody> and <thead> tags to the tables.
  • Changed: Now uses new, improved multi-selection/edit feature, seen in other rah-plugins.
  • Changed: now uses textpattern callback instead of outputting the snippets right away when the plugin is loaded.
  • Changed: Now checks if the saving/updating succeeds, instead of expecting.

More info and downloads

Offline

#63 2011-06-12 02:04:50

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

Re: rah_external_output

Version 0.7 is out. Changes:

  • Fixed: Error in <txp:rah_external_output /> tag.
  • Fixed: Closed open <thead> tag in the main list view.
  • Fixed: Now admin-side page title uses language strings.

More info and downloads

Offline

#64 2011-06-12 07:37:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: rah_external_output

Jukka, you’re on a real spring cleaning mission at the moment :-)

Just wanted to say I appreciate it and your plugins – too many of them to count – have made txp coding easier in so many ways. Nice too that you devote so much effort to the back-end interfaces too.


TXP Builders – finely-crafted code, design and txp

Offline

#65 2011-06-12 12:16:15

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

Re: rah_external_output

Thank you Jakob :)

Offline

#66 2011-07-26 12:04:07

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

Re: rah_external_output

Released version 0.8. Changes:

  • Added: CSRF (session riding) protection using Textpattern’s core functions introduced in v4.4.1.
  • Changed: Make sure the plugin interfaces is all in one language.
  • Changed: Only try to drop old database tables when humanly possible that there is old leftovers. Don’t run queries when updating from clean to clean.
  • Changed: set temporary version number when installing. Removes the possibility of running the installer twice for no reason.
  • Now requires Textpattern version 4.4.1 or newer.

More info and downloads

Offline

#67 2011-09-03 05:16:36

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

Re: rah_external_output

the plugin does not parse txp:image tag when in custom_field.

this is what I am experimenting with:

<txp:article_custom section="texts">
<txp:if_custom_field name="bookurl">
<a href="<txp:custom_field name="bookurl" />"><txp:custom_field name="bookimg" /></a>
</txp:if_custom_field>
</txp:article_custom>

where in <txp:custom_field name="bookimg" /> i have <txp:image id="232" class="book" />

The plugin output is

...
<a href="http://www.domain.tld"><txp:image id="232" class="book" /></a>
...

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

Offline

#68 2011-09-03 06:21:29

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

Re: rah_external_output

colak wrote:

the plugin does not parse txp:image tag when in custom_field.

Well, the custom_field tag doesn’t parse the contest of custom field, and as escape attribute is set to escape the output, neither can the default twice initialized parser.

But just removing the escaping isn’t enough in the case of rah_external_output. Unlike the core, rah_external_output doesn’t initialize the parser twice, which in case of the core, parses one extra level of tag depth. As things are so, if you want values stored in a custom field be parsed, you will have to do that yourself somehow.

To parse the custom field contents, for example, try calling parser twice:

<txp:php> 
	echo parse(parse(
		'<txp:custom_field name="bookimg" escape="" />'
	));
</txp:php>

Or same with rah_function plugin:

<txp:rah_function call="parse">
	<txp:custom_field name="bookimg" escape="" />
</txp:rah_function>

Or you could store the image ID in the custom field, instead of the tag:

<a href="<txp:custom_field name="bookurl" />">
	<txp:image id='<txp:custom_field name="bookimg" />' class="book" />
</a>

I may (or may not) change the behavior at the later date. I’m not really that keen on running the parser twice (as rah_external_output doesn’t even have a tag trace — a potential reason to run it twice). Running the parser twice would cause extra work for the server (a bit, not more than Textpattern pages do), but having it the way it is now, doesn’t always provide same results with TXP’s page templates as some tags do relay on twice ran parser, including article content tags. I’m wondering if the core behavior was originally intended or if it is a side-product.

Last edited by Gocom (2011-09-03 06:24:55)

Offline

#69 2011-09-03 07:31:20

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

Re: rah_external_output

Version 0.9 has been released. Changes:

  • Fixed: now handles raw PHP tags.
  • Changed: now parses tag structure in same fashion as core. Do it twice. Provides identical results with core in every scenario.
  • Added: ability to display tag trace, and error reporting, by adding rah_external_output_trace parameter (&rah_external_output_trace=1) to the snippet URL when site’s production status is set to debugging.

More info and downloads

Offline

#70 2011-09-03 08:25:05

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

Re: rah_external_output

kewl. It now works wonderfully! Kudos!


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

Offline

#71 2011-09-03 08:32:00

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

Re: rah_external_output

colak wrote:

kewl. It now works wonderfully! Kudos!

You’re welcome :) As of the latest rah_external_output release, v0.9, the tags are parsed in same fashion as core does it (runs the parser twice), and you shouldn’t need to do the tricks I mentioned. Depending (possibly) on the context, the tags in custom field should be parsed just by adding escape="" to the custom_field tag.

Offline

#72 2011-09-29 10:02:04

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: rah_external_output

A possible feature idea (coming from here): how about making it possible to import and export rah_external_output snippets for easy portability in much the same manner as you can with smd_macro?

An alternative idea – or an additional idea – would be to expand cnk_versioning to work with smd_macro and rah_external_output snippets. Then again, perhaps I’m just getting too lazy…


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB