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