Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2021-01-21 07:38:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,724
Website GitHub Twitter

Re: Docs site refresh effort

li is a more common break for menus such as section_list and related_articles but I think that if the attribute becomes global, unset will be the list invasive.

Re Oleg’s very valid comment. I can see issues with a number of tags such as txp:die, if_yield, in fact most of the if_ tags, etc. I’m wondering if tags could be divided into front end presentation for the ones which actually render some content, and conditional for the ones that test the context. site_name is a strange hybrid tag which can be used both in the head and the body of an article, txp:css though is the one which might help into making the decision.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#50 2021-01-21 09:16:15

etc
Developer
Registered: 2010-11-11
Posts: 4,512
Website GitHub

Re: Docs site refresh effort

colak wrote #328295:

li is a more common break for menus such as section_list and related_articles but I think that if the attribute becomes global, unset will be the list invasive.

… I’m wondering if tags could be divided into front end presentation for the ones which actually render some content, and conditional for the ones that test the context.

Global attributes have no default value, one must call them explicitly. Also, they are (mostly) tag-agnostic. Actually, global break has little value per se: why would one want to break the site name? It was introduced mainly as a counterpart to fields="list(field)" article attribute. You can try this example with and without wraptag="ul" break="li" attributes to see how they work:

<txp:article_custom fields="authorid, list(title)">
    <h3><txp:author /></h3>
    <txp:title wraptag="ul" break="li" />
</txp:article_custom>

Offline

#51 2021-01-21 09:36:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,515
Website GitHub

Re: Docs site refresh effort

All good. I was thinking in terms of the default we set in the docs include file. Currently it’s br. When you call the include, you can optionally override this default by passing break="some thingy" into the include template. That will override the default value that displays in the tag for that attribute.

We often need this for class. It’s usually empty and takes whatever you give it, but sometimes the class is preset to be the name of the tag. So you can pass this in as an exception when the tag page is built.

What I don’t want to do is have the default for break set to ‘br’ and then find nearly every single include from every tag page needs to override this. I’d rather set the include to use the most common break attribute value we use in core, and then override it if necessary for a handful of tags. Make sense?


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

#52 2021-01-21 09:49:35

etc
Developer
Registered: 2010-11-11
Posts: 4,512
Website GitHub

Re: Docs site refresh effort

Ah, got it. Well, br seems to be the most common one among the tags that accept it natively, closely followed be the empty string.

Offline

Board footer

Powered by FluxBB