Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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 usingtxp:if_variable
ortxp: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
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
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
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
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
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