Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
attribute "current"
Since I posted a question in an other topic, I’m thinking about one thing:
Wouldn’t it be nice to have an attribute like “current”.
e. g. <txp:article_custom section="current" />
e. g. <txp:article_custom offset="current" />
Offline
#2 2005-04-13 17:07:52
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: attribute "current"
What would it do?
Alex
Offline
Re: attribute "current"
In the first example, it would out articles of the current section, which would be a nice feature for building page template. I often have to duplicate a page template just because the section attribute has to be set to an other section. So “current” would just be a way to set an attribute automatic to the current section
The second example would do that, what I was asking for here.
Offline
Re: attribute "current"
I’ve just seen a new entry in the FAQ: Can I use tags within tags?
<blockquote>
If you need to use a dynamic value as a tag attribute, the best way is to call the tag handler function directly, like this:
<br/>
<txp:php>
<br/>
echo article_custom(
<br/>
array('section'=>$GLOBALS['pretext']['s'])
<br/>
);
<br/>
</txp:php>
<br/>
<br/>
The first argument to the tag handler function is an associative array representing the tag attributes.
</blockquote>
So I have to re-ask this: Wouldn’t it be nice to have a “current” attribute for dynamic content? E. g.: <txp:article_custom section="current" />
Offline
Re: attribute "current"
txp:article works that way by default. It uses the current section and category for article lists.
If you want to do the same with an article_custom style list, you’ll need a plugin.
What you are talking about in the other thread is far more complicated.
Offline
#6 2006-01-02 19:35:48
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: attribute "current"
The problem is that you have to have all your sections set to the front page if you want to keep the built-in category lists (/category/_category-name_).
Offline
Re: attribute "current"
<blockquote>txp:article works that way by default. It uses the current section and category for article lists.</blockquote>
The problem ist, that if you creating an page or form that is used by several section and has to use different content for each section automatically, you normaly need an “article_custom” because more than one “txp:article” isn’t allowed and causing trouble (or did anything changed about this?!). If I like to have a list of further articles in a sidebar, this “current” attribute would help me.
@Mary: Can you explain this to me. I don’t understand the reason why one should have all sections set to the frontpage…
Offline
#8 2006-01-02 23:58:42
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: attribute "current"
I was responding to what takshaka said.
Offline