Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2005-10-19 19:51:19

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: tags -in- tags

> maniqui wrote:

I undestand that <a href=“http://forum.textpattern.com/viewtopic.php?id=2306”>chh_article_custom</a> is context-sensitive (is that the same as section-sensitive?). It defaults to current section.

O o, I suppose your right. It really might suit my needs, I will give it a try. Thanks for the pointer!

Offline

#17 2005-10-19 20:18:08

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: tags -in- tags

> wet wrote:
If only txp:article_custom had the possibility to pass section="%current" or the like, %current being defined as a special purpose keyword…

One option could be to create a <txp: variable> tag which could be used to pass variables to tags. This is how XSLT does it so it is pro-xml. Basically something like this

<txp:variable name="current-section"><txp:section /></txp:variable>

You could then call that by doing <txp:article_cutom section="{$current-section}" />

Anyway that’s how XSLT does it. I have no idea how this could be implemented as I would think it would also require changing the parser. It would allow for turning the result of any tag into a variable which could be very powerful.


Shoving is the answer – pusher robot

Offline

#18 2005-10-19 20:24:57

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: tags -in- tags

Who will volunteer to write the eclipse plugin and the debugger for “txp – the meta script language”?

Offline

#19 2005-10-20 06:12:29

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: tags -in- tags

> Sencer wrote:

The shortest is to use PHP in your templates, the “cleaner” way is to write a plugin for that purpose.
Example:
<code>
<txp:php>echo article_custom(array(“form”=>“default”, “section”=> section(array())));</txp:php>
</code>

Is it true that this will work in page templates but won’t work in articles? At least in my case it delivers an error message stating:

Parse error: parse error, unexpected ‘=’, expecting ‘)’ in /www/xxxx/textpattern/publish/taghandlers.php(1605) : eval()’d code on line 1

I’ve checked nesting but could spot an error. Is there a way besides coding a plugin to embed this into an article?

//w&

Offline

#20 2005-10-20 08:01:42

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: tags -in- tags

IIRC you can’t use article or article_custom tags in articles either (leaving aside the potential problem of infinit loops if it was possible).

Offline

#21 2005-10-20 08:27:24

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: tags -in- tags

Thanks, Sencer.

I’ve finally succeeded by putting your code embraced by some enclosing conditionals into a form (to reduce clutter) and use txp:output_form in my section agnostic page template. Works as intended, great.

Last edited by wet (2005-10-20 08:27:56)

Offline

#22 2005-11-03 14:22:50

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: tags -in- tags

> maniqui wrote:

wet:
can you create a forum thread to discuss your djw_section_articles plug-in ? I cant make it work.

Done.

Offline

#23 2006-01-01 18:16:12

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: tags -in- tags

I’d also like to use php to circumvent using a tag within a tag to display a custom article for my photo gallery, but since I definitely lean more towards the “user becoming developer because of txp” crowd, I need some help to form the statement.

Please take a look at this post if you can help. Thanks!

Offline

Board footer

Powered by FluxBB