Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: txp:article_custom via php echo
zenman wrote #306785:
The idea with category url = article url is good. But I stumbled over breadcrumbs with it. And one more thing, you cannot see an article url without opening it which takes some time. How do you know where the parent China article is if there is several articles with China in the title, for example. You have to open it and look at its url. But to see an article id is easier because they are listed one by one in the Articles panel.
Performance-wise, ID
is better than url
because it’s a primary index of textpattern
table. Nevertheless, the whole ID=Category1
thing feels wrong. In 4.7 <txp:breadcrumb />
is more flexible and categories could suffice for your needs. If you can wait, of course :-)
Offline
Re: txp:article_custom via php echo
etc wrote #306797:
Performance-wise,
ID
is better thanurl
because it’s a primary index oftextpattern
table. Nevertheless, the wholeID=Category1
thing feels wrong. In 4.7<txp:breadcrumb />
is more flexible and categories could suffice for your needs. If you can wait, of course :-)
can’t wait to see. will categories suffice for the whole parent-child issue dusscussed here or just <txp:breadcrumb /> part ?
i usually use categories for admin purposes to sort out articles – featured, children, homepage. they are not indexed by google and not accessible by front-end users unless it is a standard blog.
Last edited by zenman (2017-08-31 15:08:19)
Offline
Re: txp:article_custom via php echo
I would follow this:
makss wrote #306779:
For example, a category tree can be:
country
china
lcl
...
hongkong
europe
...
and assign each concerned article two categories (Category1, Category2)
:
- parents (countries):
(country, china)
etc - children (services):
(china, lcl)
…
Then a service-by-country list can be output with
<!-- list of parent articles (countries) -->
<txp:article_custom category="country" match="Category1" wraptag="ul" class="Parent-Articles" break="li">
<txp:permlink><txp:title /></txp:permlink>
<!-- list of child articles if Category2 is the same as parent Category1. -->
<txp:article_custom category='<txp:category2 />' match="Category1" wraptag="ul" class="Child-Articles" break="li">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
</txp:article_custom>
IIRC, match
was introduced in 4.6, so you can test it. The advantage for users is that the category tree is available on Write
tab, and one does not need to create ID
-named categories. Actually, even <txp:category_list />
could do, I think.
Edit: it’s just a more standard approach, not necessary a cuter one.
Offline