Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-06 15:29:25

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

How to separate the front page?

Yes, I have read Textbook, FAQ, 22739, 29311, 31419 topics of the forum, but I still not quite catch the TxP philosophy. Particularly, on how special contents should flow to cover pages of search, category, author indexes — how to avoid flooding by sticky scraps everywhere?

After a bit of horror I have made a front page, separated from sections and indexes by if_author, if_category, if_search searchsticky, and article_custom means only. Here is my (valid) default template:

	<txp:if_search> <h1>Reward</h1>
<txp:article searchform="reward" searchsticky="1" /> <txp:else />
	<txp:if_category> <txp:category title="1" wraptag="h1" />
<txp:article listform="listing" status="sticky" />
<txp:article listform="listing" /> <txp:else />
	<txp:if_author>
<txp:article form="author" status="sticky" limit="1" sort="ID" />
<h2>Author's contribution</h2>
<txp:article listform="listing" />
	<txp:else />
<txp:article_custom form="caption" status="sticky" section="cover" />
<txp:article_custom form="listing" />
	</txp:if_author></txp:if_category></txp:if_search>

Is there any simple default way to put some context headers and description paragraphs to non-section (front page, categories, authors, query, etc.) listing view?

Last edited by Vienuolis (2009-08-07 20:53:54)

Offline

#2 2009-08-07 06:08:13

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

Re: How to separate the front page?

I think most problems would solve an additional description field to section and category settings, as is in TxP links settings. On English language sites it is possible to adapt section and category names as page headers (capitalized), and thus titles as descriptions, but not in other languages, because of Latin letters requirement for URL.

An example of the problem: if I want to describe sections, usually I should place an appropriate sticky articles in that sections. But while section is set to be shown on front page, the sticky articles will be spread as headers on all categories, author indexes, search results, and on the front page as well (on all pages, generated by the default template). If switched off, all the section’s articles would disappear from category and other indexes, too. Caption as hidden article_custom id is not context-sensitive and will not serve as category descriptions, etc.

Last edited by Vienuolis (2009-08-07 09:38:48)

Offline

#3 2009-08-07 07:05:19

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

Re: How to separate the front page?

My first thought was a desire of additional special section for the front page (besides of Default) on Presentation: Sections tab. Where I would find some switch Use as index? (•) Yes, ( ) No — separate the front page from indexed content, witch is shown on categories, authors, search result views. Or better possibility to assign own page template (and stylesheet, too), instead of default for the front page only.

Of course, if there are no convenient ways to assign separate content chunks for appropriate index pages. Sorry for off-topic, these questions should apply for some discussion board of Textpattern architecture.

Last edited by Vienuolis (2009-08-07 08:24:09)

Offline

#4 2009-08-07 10:52:05

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

Re: How to separate the front page?

But while section is set to be shown on front page, the sticky articles will be spread as headers on all categories, author indexes, search results, and on the front page as well (on all pages, generated by the default template).

I am wrong, fortunately. By switching to sticky status, an article just disappears from any index view, by default. That may be tricky for designers new to TxP, although it is one of Textpattern power points — sticky articles will appear only where the special <txp:article_custom status="sticky" section="" id="" etc="" /> is inserted in a page template.

I believe in TxP concept and will do my best creating a usable server. These Web sites demonstrate, how large and complex databases can handle Textpattern, still being the slimest CMS on the planet.

Although the separate template for a front page and description fields for category settings would still be highly appreciated.

Last edited by Vienuolis (2009-08-07 20:38:56)

Offline

#5 2009-08-07 13:05:48

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to separate the front page?

Vienuolis wrote:

Although separate templates for a front page and description fields for category settings would still be highly appreciated.

I’m sorry, Vladas, but after reading your posts it isn’t quite clear to me if you managed to achieve what you wanted. My impression was that the code in your first post does exactly what you described you needed it to do, but I’m probably missing something…

Offline

#6 2009-08-07 20:31:08

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

Re: How to separate the front page?

the code in your first post does exactly what you described you needed it to do

Yes, almost. Not all, though:

  • no description on empty search result;
  • no category descriptions;
  • no reliable method to present authors;
  • while there is no txp:article on the front page, why to share the same default template with category and other indexes? Instead of using own individual page template and stylesheet of the Cover section.

The method with many nested if_s and a poor result I can treat only as workaround. I think there should be default mens for such standard situations. And I guess only a few of core code lines could make Texpattern even faster (with no unnecessary if_s) and more popular:

  1. assign to the author’s credentials his presentation article ID (at least description paragraph) and his portrait (avatar, icon ID);
  2. add a description field to section and category settings, as made for links;
  3. let assign to the front page its own page template.

And again, sorry for off-topic, if there are no convenient ways to achieve that standard situation.

Last edited by Vienuolis (2009-08-08 05:46:46)

Offline

Board footer

Powered by FluxBB