Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-05-26 11:06:57

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

txp:css outputs "default" stylesheet even when set to "none"

This is with the current v4.9, but testing on the demo server shows this was also the case with 4.8.8. To test, try setting the articles section to have no stylesheet.

Perhaps this is a safety mechanism deriving from the old days when it was standard practice to load styles from the DB, but since it has been possible to set no stylesheet, my expectation would be that txp:css should not output anything if no stylesheet is set.
Maybe I am missing a setting or an attribute to prevent this?

For now, I got around it by testing for “default” in the link it produces:

<txp:evaluate query='contains("<txp:css />","default")' not>
    <txp:css format="link" />
</txp:evaluate>

Any views on the rights or wrongs of this?


TXP Builders – finely-crafted code, design and txp

Offline

#2 2024-05-26 14:04:45

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

Re: txp:css outputs "default" stylesheet even when set to "none"

I expect this is an oversight from the introduction of pageless sections. The css tag hasn’t kept pace. We should probably output nothing, as you suggest.


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

Offline

Board footer

Powered by FluxBB