Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-04-13 16:51:19

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

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

#3 2005-04-13 17:28:28

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

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

#4 2006-01-02 08:53:52

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

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

#5 2006-01-02 19:04:40

takshaka
Archived Plugin Author
From: Below the Manson-Nixon line
Registered: 2004-06-02
Posts: 97
Website

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

#7 2006-01-02 21:19:33

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

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

Board footer

Powered by FluxBB