You are not logged in.
Pages: 1
I’m trying to find the reason for some very old code, and I’m stuck.
You may try to put this into a page:
<txp:article category="meaningful-labor" />
This is in vain: Textpattern ignores the category attribute and substitutes it with a value from the URL (http://example.com/?c=hope-for-the-future) when your page is visited, and it even erases the category completely when the URL supplies no category at all. This also applies to “author” and “excerpted”.
I’m trying to find a reason for this behaviour.
What can possibly go wrong if Textpattern uses the value from the category attribute at any occasion even if the page URL contains a ?c=somecategory bit?
Wouldn’t it be desirable that the site builder has a way of specifying an explicit category?
Try wet_quicklink | Me | @rwetzlmayr | +Robert Wetzlmayr | Repos
Offline
Presumably it’s to preserve the context-sensitive nature of <txp:article> and justify <txp:article_custom>‘s existence. But since:
I can’t see any sense in not allowing <txp:article> from having some overridable options that were hitherto only available in the non-paging-aware <txp:article_custom> realm. As long as it still retains its context-sensitivity if no attributes are supplied to override it, as you say, what could go wrong?
Last edited by Bloke (2012-06-27 11:35:07)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern.
Txp Builders – finely-crafted code, design and Txp
Offline
<txp:article /> has never supported attributes as section, author or category as far as I know. Those attributes and code-bits are presents only because these functions has been shared by two tags, including <txp:article_custom/>. On <txp:article /> those haven’t applied as <txp:article /> has by design been context-sensitive, only treating content requested.
If the tag listened to those attributes, it would interfere with displaying individual articles too, unless the attributes are ignored in such context, and overridden by the article’s data / requested data. Limiting factors include that you can’t really use multiple instance of <txp:article /> on a single page either. The first instance decides pagination and article count.
Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />
Offline
To clarify: I’m talking about article lists, not individual articles.
Try wet_quicklink | Me | @rwetzlmayr | +Robert Wetzlmayr | Repos
Offline
wet wrote:
To clarify: I’m talking about article lists, not individual articles.
To whom? If a page has a following tag:
<txp:article category="categoryname" />
And individual article is requested which is not in that category, what will the visitor see? A 404 error page? Empty page without any content? Or is the attribute overridden?
If an empty page is displayed, how will user check and see that the article isn’t meeting the criteria? Knowing that would be mandatory to displaying error pages when content isn’t present. If a page is displayed w/o the article visible, what will individual article tags outside the <txp:article /> block do? Display the content anyways?
On list pages what will happen when you have two instances of <txp:article />. As this:
<txp:article />
<txp:article category="categoryname" />
What will happen when you change pages? What will happen when you run out of pages on the second tag’s filtered list? Will be a 404 error page displayed?
Last edited by Gocom (2012-06-27 11:56:22)
Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />
Offline
Good points.
Nevertheless I’d like to return to the original puzzle: What can possibly go wrong if we do not override explicit attributes from URL vars in article lists?
Try wet_quicklink | Me | @rwetzlmayr | +Robert Wetzlmayr | Repos
Offline
wet wrote:
Nevertheless I’d like to return to the original puzzle: What can possibly go wrong if we do not override explicit attributes from URL vars in article lists?
Above will prove problematic, but sure you can do it. It can work just fine and doesn’t break the list itself. You then just gotta make it very clear that all instances of <txp:article /> need to have the exact same attributes (there the likes as offset and limit).
There are those individual tags as page_title, category and likes that will display the category name from the URL even when <txp:article/> doesn’t listen it. <txp:page_title /> says articles are about Windows (as in URL) while the articles read about iOS.
Last edited by Gocom (2012-06-27 12:20:27)
Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />
Offline
Pages: 1