Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2025-06-04 11:50:15

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

Re: Inline Microdata vs JSON-LD

jakob wrote #339799:

I’m not sure what among its txp siblings means

PS: I found you also need [-1] after the tag name if using txp:if_variable or txp:evaluate to test for second-pass content.

You answer your own question :-) In the block (without [-1])

<txp:if_variable name="json-ld">
<script type="application/ld+json">
{
<txp:variable[-1] name="json-ld" />
}
</script>
</txp:if_variable>

<txp:variable[-1] name="json-ld" /> will be processed after its txp siblings inside the parent block (none here), but the block itself will not be postponed.

Offline

#14 2025-06-04 12:02:43

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

Re: Inline Microdata vs JSON-LD

Bloke wrote #339800:

But I’m not sure if that means the value has to be put inside the add attribute itself, or if the container contents will be used if it’s valueless.

Subtle valueless combination are available:

<txp:variable name="var1" value="hello" />
<txp:variable name="var1" add>world</txp:variable>

outputs helloworld, and

<txp:variable name="var1" value="hello" />
<txp:variable name="var1" add value>world</txp:variable>

gives worldhello :-)

Offline

#15 2025-06-04 12:19:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,779
Website GitHub

Re: Inline Microdata vs JSON-LD

etc wrote #339805:

Subtle valueless combination are available

These need adding to the docs! That could be remarkably handy in some situations.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#16 2025-06-04 21:57:36

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

Re: Inline Microdata vs JSON-LD

Pat64 wrote #339792:

I’m using massively JSON-LD (7 scripts) on this kind of page without any Google Page Speed Insight penalties (global scores : 99/100 for Mobiles; 100/100 for Desktops).

That’s good to know.

https://atelier.clos-mirabel.com/painting-holidays/kat-o-connor-atelier-clos-mirabel-france-french-pyrenees

Would you be able to perhaps share how you brought in the Instagram feed (perhaps over on this thread to avoid polluting this one)? It’s nice and simple and looks like you’re not using instagram’s own embed, so doesn’t track users, right?


TXP Builders – finely-crafted code, design and txp

Offline

#17 Yesterday 07:07:42

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,659
GitHub Twitter

Re: Inline Microdata vs JSON-LD

@Julian:

Yes. It’s a kind of fake Instagram feed (as many websites do). All images are stored within Textpattern and I use the alternative text to serve the links.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#18 Yesterday 08:05:20

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

Re: Inline Microdata vs JSON-LD

Pat64 wrote #339808:

@Julian:

Yes. It’s a kind of fake Instagram feed (as many websites do). All images are stored within Textpattern and I use the alternative text to serve the links.

Ah, okay, so it doesn’t update automatically; you need to prep the content for Textpattern and for Insta (unless you’re posting to Instagram directly from Textpattern?). I was hoping to find a way of getting a RSS-feed for insta so that I could embed the timeline from the feed.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB