Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Textile for titles... again, please.
Another topic the forum search is really failing me on. (Btw, the search results of newest to oldest is not very useful when the gold is old.)
I seam to recall it requiring an smd_ plugin of some type that does strip-n-swap magic or something? I don’t recall.
Offline
Re: Textile for titles... again, please.
In 4.7 we get Textile for anything:
<txp:title escape="textile" />
<txp:variable name="textile_me" escape="textile" />
...
or
<txp:title escape="tidy,textile" />
to avoid wrapping the title in <p />
.
Offline
Re: Textile for titles... again, please.
Nice!
Offline
Re: Textile for titles... again, please.
Title field entry:
A review of _Bluebeard_
Form:
<txp:title escape="tidy,textile" />
Front-side:
A review of Bluebeard
Yay!
But, on permlink:
<a href="<txp:site_url />articles/<txp:article_url_title />
" title="<txp:title escape="tidy,textile" /> permlink"><txp:posted /></a>
I get:
A review of <em>Bluebeard</em> permlink
If I don’t use the escape
, I get the Textile:
A review of _Bluebeard_ permlink
Any way to strip the syntax entirely from the title attribute? I don’t care about the formatting there, but the visible characters is fugly.
Offline
Re: Textile for titles... again, please.
Not sure it’s the best way, but here we go:
<a href="<txp:site_url />articles/<txp:article_url_title />"
title="<txp:title escape="textile,tags,html" /> permlink"><txp:posted /></a>
Offline
Re: Textile for titles... again, please.
Thanks again.
I actually tried using this before asking, just as a guess, but it didn’t work:
<txp:title escape="tidy,textile,html" />
I should have removed tidy
from the start, of course, since it wasn’t relevant in my case.
After playing around with it just now, this works (html
has no discernible effect):
<txp:title escape="textile,tags" />
The title tag doc probably needs updated with the new escape
attribute functionality. I can do it if there’s an explanation somewhere about all the possible attribute values and what they are for.
Might be easier if someone who knew did it quickly.
¯\_(ツ)_/¯
Offline
Re: Textile for titles... again, please.
Destry wrote #309652:
The title tag doc probably needs updated with the new
escape
attribute functionality. I can do it if there’s an explanation somewhere about all the possible attribute values and what they are for.
There is an explanation, but done very quickly :-) Note that (almost) every tag is concerned, not only <txp:title />
.
Offline
Re: Textile for titles... again, please.
etc wrote #309653:
There is an explanation…
Ah, good. I think I saw that before, actually, but didn’t understand the power of what I was looking at. ;)
I also just realized why tidy
is important alongside textile
. It keeps the pesky p
tags out of things.
Offline
Offline
Re: Textile for titles... again, please.
I was just testing some pages in the Firefox’s ‘reader’ view and realized some things there:
- You see format syntax in the title, if used (e.g.
A title with _emphasized_ text
). - If you hide text strings in a
span
(e.g.display:none;
) they appear in reader view (they do for me, which is not the effect I want). - Using a custom field to add a conditional subtitle on article titles — something I think will be more popular when unlimited custom fields have their day — positions the subtitle down out of the reader header, out of title context.
I’m a big fan of browsers’ reader feature, so this has me rethinking how to do certain things and whether I should at all on some of them.
Offline
#11 2018-04-06 10:15:42
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,289
Re: Textile for titles... again, please.
etc wrote #309622:
In 4.7 we get Textile for anything:
<txp:title escape="textile" />...
or
<txp:title escape="tidy,textile" />...
to avoid wrapping the title in
<p />
.
still wrapping my title in <p>
form:
<div class="article">
<txp:if_article_list>
<txp:if_excerpt>
<h2><txp:permlink><txp:title escape="tidy,textile" /></txp:permlink></h2>
<txp:excerpt />
<p class="meta"><txp:permlink>Loe edasi</txp:permlink></p>
<txp:else />
<h2><txp:permlink><txp:title escape="tide,textile" /></txp:permlink></h2>
<txp:body />
</txp:if_excerpt>
<txp:else />
<h1><txp:title escape="tide,textile" /></h1>
<txp:body />
</txp:if_article_list>
</div>
Offline
Re: Textile for titles... again, please.
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