Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-11-05 13:46:24

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

Excerpted=0

Is it possible to set this attribute of article_custom a bit more precisely? I would like such meaning:

  • excerpted=“1” — articles with excerpt,
  • excerpted=“0” — no excerpt,
  • excerpted=”“ (unset, default) — all articles.

TL;DR
The situation is quite trivial. I’d let owners (not myself) to quickly publish very short messages (with no description, no excerpt) among others in News section. These short messages are visible on a general section of announces as a list items, not linked to its individual pages. While normal reports are excerpted and linked from the same section page. I’ve made the form, TxP works fine:

	<dl><txp:article limit="25">
		<txp:if_excerpt>
<dt><strong><txp:permlink><txp:title /></txp:permlink></strong> — <txp:posted /></dt>
<dd><txp:excerpt /></dd>
		<txp:else />
<dt><strong><txp:title /></strong> — <txp:posted /></dt>
<dd><txp:body /></dd>
		</txp:if_excerpt>
	</txp:article></dl>

Not so simple in a search form yet. Because articles on another five sections are not excerpted, too (it is sufficient to describe them by meta description, keywords). The txp:article has no section attribute to exclude them, and if_section is not sensitive in default search context. An article_custom could be excerpted="0", although it would mean “all”, not “no”. And txp:if, else cannot help in this context — or maybe I do not know how?

Last edited by Vienuolis (2017-11-05 14:05:23)

Offline

#2 2017-11-06 07:58:14

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: Excerpted=0

Vienuolis wrote #307648:

The <txp:article> has no section attribute to exclude them, and <txp:if_section> is not sensitive in default search context.

Would <txp:if_article_section> help (docs)?


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#3 2017-11-06 09:14:18

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

Re: Excerpted=0

Sorry, my inattention — worked out, now all goes well, thank you!

Offline

Board footer

Powered by FluxBB