Textpattern CMS support forum
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)
Released version 0.6 of rah_external_output.
- 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.
<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
<thead>tags to the tables.
- Changed: Now uses new, improved multi-selection/edit feature, seen in other rah-plugins.
- Changed: now uses
textpatterncallback instead of outputting the snippets right away when the plugin is loaded.
- Changed: Now checks if the saving/updating succeeds, instead of expecting.
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
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.
the plugin does not parse
txp:image tag when in
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>
<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> ...
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)
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=1) to the snippet URL when site’s production status is set to debugging.
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
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