Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-12-12 12:38:57

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

txp:category_description

The long-awaited field to describe an article category appeared on Contents: Categories: Edit Category panel of Textpattern v.4.6, thanks to devs! What is the appropriate tag name, though? My guessed <txp:category_description /> is invalid. There are meta_description, link_description and file_download_description listed on Textpattern.net and Textpattern.io tag reference libraries. And introduction of meta_description (with if_description) only mentioned in the weblog post about Textpattern 4.6.0 release.

Last edited by Vienuolis (2016-12-12 12:39:16)

Offline

#2 2016-12-12 14:26:57

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

Re: txp:category_description

The <txp:meta_description /> tag is clever enough. I had a similar question here which was thoroughly answered by Stef.


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

Offline

#3 2016-12-12 14:47:33

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: txp:category_description

I believe this is Stef’s thorough answer.

The <meta_description /> tag is context aware and tries to be smart about what description it pulls. If you’re on a section landing page it uses the section description, if you’re on an individual article it uses the article’s meta description. If you want to alter the default, use the type attribute to override it. – Bloke

Offline

#4 2016-12-12 14:50:57

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

Re: txp:category_description

michaelkpate wrote #303235:

I believe this is Stef’s thorough answer.

he didn’t need to expand more! :)


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

Offline

#5 2016-12-12 15:27:23

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: txp:category_description

What a smart way! I’ve found my mistake: forgot form="raw" — no text would displayed without this attribute. Thanks for your help!

Offline

#6 2016-12-12 16:00:04

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: txp:category_description

I would also HTML to be allowed in a description field — as I have made under a section title on.lt/apydaira/ Sorry for my greediness.

Offline

#7 2016-12-12 16:25:50

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: txp:category_description

Sorry for my impatience — HTML in description is valid too, with an attribute escape="".

Offline

#8 2016-12-12 19:18:32

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: txp:category_description

Offline

#9 2016-12-13 00:22:54

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

Re: txp:category_description

Vienuolis wrote #303239:

Sorry for my impatience — HTML in description is valid too, with an attribute escape="".

Sure you can do that. The problem then is if you want to use the <txp:meta_description /> in the <head> of a document, it will output those html entities in your text (description), which is not really nice for search engines (about the only ones who see the <meta name="description" content="...">). You probably can work around that with a plugin that actually strips those tags out, e.g. smd_wrap or similar.


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

Offline

#10 2016-12-13 08:49:16

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: txp:category_description

I see. And I’ve replaced a former custom field for <meta description> with the special <txp:meta_description /> tag in <head> right away 4.6 released. But I was confused by the term ‘meta’ and looked also for non-metadata tag, such as <txp:category_description /> — similar to existing <txp:link_description />, <txp:file_download_description /> tags. Both metadata and visible descriptions are now implemented together in the same webpage and work fine (for example, on.lt/category/kronika/) — thanks to Stef for such smart tag, and thank you all for the great help.

Last edited by Vienuolis (2016-12-13 10:45:21)

Offline

Board footer

Powered by FluxBB