Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-12-17 18:37:15

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

flat.url bug or feature?

I’m trying the following for atom feeds:

<link rel="alternate" type="application/atom+xml" title="Atom feed" href="<txp:feed_link flavor="atom" format="flat.url" label="Atom" section="" category="" />">

The expected output:

<link rel="alternate" type="application/atom+xml" title="Atom feed" href="http://domain.tld/atom/">

The output:

<link rel="alternate" type="application/atom+xml" title="Atom feed" href="<a type="application/atom+xml" title="Atom feed" href="http://domain.tld/atom/">Atom</a>">

When I delete the label tag or add label="" the output is

<link rel="alternate" type="application/atom+xml" title="Atom feed" href="">

Are these expected behaviours?

I would expect flat.url to just show the url as it does on css.

I know that I may most probably be missing something so I’m bringing it to the forum.


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

Offline

#2 2022-12-18 01:53:16

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: flat.url bug or feature?

Looking at the docs to refresh my memory, url is not a value for the format attribute in the case of <txp:feed_link />. Source. By extension, I don’t expect flat.url to work.

I never tried to build a feed link the way you do there, to be honest. Either I use <txp:feed_link /> standalone (examples in the docs page), or build it fully manually, but that was in the past. The way the tag works nowadays is sufficient.

<link rel="alternate" type="application/atom+xml" title="Atom feed" href="<txp:site_url />/atom/">

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#3 2022-12-18 04:53:41

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

Re: flat.url bug or feature?

I agree with you but building it manually does not allow for a url schema change. It is of course very minor and never occurred to me before either.

I would nevertheless think that the feed would be one of those constructs that flat.url would be handy.


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

Offline

#4 2022-12-18 06:54:23

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: flat.url bug or feature?

I assume your main purpose is easy toggling between https:// and http (not forcing one or the other)? The old trick will still work: simply omitting the URL Scheme in the link

<link rel="alternate" type="application/atom+xml" title="Atom feed" href="//example.tld/atom/">

If the UA is requesting pages with over https://, the link (feed URL) will resolve to that URL Scheme.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#5 2022-12-18 08:17:03

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

Re: flat.url bug or feature?

phiw13 wrote #334312:

I assume your main purpose is easy toggling between https:// and http (not forcing one or the other)? The old trick will still work: simply omitting the URL Scheme in the link

<link rel="alternate" type="application/atom+xml" title="Atom feed" href="//example.tld/atom/">...

If the UA is requesting pages with over https://, the link (feed URL) will resolve to that URL Scheme.

That was a typo in the forum:)


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

Offline

Board footer

Powered by FluxBB