Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#361 2021-01-30 12:42:08
Online
#362 2021-01-30 17:07:15
Re: etc_query: all things Textpattern
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#363 2021-01-30 17:13:20
Online
#364 2021-01-30 17:49:58
Re: etc_query: all things Textpattern
Thanks so much Oleg,
I’ll install it and report if there are any issues.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#365 2021-05-16 19:20:01
Re: etc_query: all things Textpattern
Version 1.4 is released. Main news:
- added
ini
markup, to importini
-formatted arrays; - added
sort
attribute, to order (flat) multi-dimensional arrays by one or several fields.
Online
#366 2021-05-19 16:26:43
Re: etc_query: all things Textpattern
Version 1.5 is available. Main news:
- empowered
sort
attribute for ordering multi-dimensional (sub-)arrays by several fields. - chainable
markup
attribute, to enable customizable mixed markups.
Example:
<txp:variable name="winners">
name=Alice
age=11
place=2
--
name=Bob
age=9
place=2
--
name=Cindy
age=10
place=1
</txp:variable>
<txp:etc_query data='<txp:variable name="winners" />'
markup="list:--, ini"
sort="[place|age<nat]"
wraptag="ol" break="li"
>
{name?} ({age?} years old)
</txp:etc_query>
outputs
- Cindy (10 years old)
- Bob (9 years old)
- Alice (11 years old)
Online
#367 2021-06-15 14:44:44
Re: etc_query: all things Textpattern
Version 1.5.1 is CSV-import-able, thanks to Stef for a possible use case (wrap it into etc_cache
if needed):
<txp:etc_query markup="csv" url=".../export?format=csv" wraptag="table">
{$doWrap($|tr|td)}
</txp:etc_query>
Online
#368 2023-02-22 21:56:18
- lazlo
- Member
- Registered: 2004-02-24
- Posts: 110
Re: etc_query: all things Textpattern
Hey Oleg
I tried to install etc_query 1.5.8 as my first plugin on a completely a brand new 4.8.8 install.
I got this: “Badly formed or empty plugin code.” Sad Trumpet sounds …
Any advice here?
- Les
Offline
#369 2023-08-23 20:27:12
- ax
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 165
Re: etc_query: all things Textpattern
Indeed a very useful plugin, but now I am stuck with the task of reading very many XML files like this:
<?xml version="1.0" encoding="UTF-8"?>
<Image xmlns="http://schemas.microsoft.com/deepzoom/2008"
Format="jpeg"
Overlap="1"
TileSize="256"
>
<Size
Height="71029"
Width="62493"
/>
</Image>
The Size
parameters are wanted, but no output is generated with this simple code:
<txp:etc_query markup="xml"
query="//Image/Size" url="https://example.com/A01.xml" >
Height={Height?}<br />
Width={Width?}<br />
</txp:etc_query>
No luck with smd_xml
either. I wonder if it could be the XML syntax that prevents the size parameters from being extracted?
Offline
#370 2023-08-23 21:40:04
Re: etc_query: all things Textpattern
Two things:
- Your root
Image
is namespaced, which bothers the parser. Trymarkup="xml:"
(with:
afterxml
). Height
andWidth
are attributes, thus requiring a corresponding syntax:
Height={@Height?}<br />
<!-- or simply -->
{@Width}<br />
Online
#371 2023-08-24 05:28:01
- ax
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 165
Re: etc_query: all things Textpattern
Thanks so much. That did the trick!
Offline
#372 2024-10-24 13:06:29
Re: etc_query: all things Textpattern
I’m trying to get youtube thumbnails using the API.
For vimeo, it was:
<txp:etc_query url='https://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/<txp:yield name="media" />' query="." markup="json">
<img src="{thumbnail_url?}" width="{thumbnail_width?}" height="{thumbnail_height?}" class="grid_24" alt="{description?}">
{description?}
</txp:etc_query>
I tried:
<txp:etc_query url='http://www.youtube.com/oembed?url=<txp:yield name="media" />' query="." markup="json">
<img src="{thumbnail_url?}" width="{thumbnail_width?}" height="{thumbnail_height?}" class="grid_24" alt="{description?}">
{description?}
</txp:etc_query>
Any help would be appreciated.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline