Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-19 02:56:56

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

txp tags in article body

Is it possible to insert txp tags in article body? If so, how would I do that without getting errors?


<txp:Ruhh />

Offline

#2 2008-04-19 03:45:44

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: txp tags in article body

It depends upon what tags you want to use.

Offline

#3 2008-04-19 04:19:20

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: txp tags in article body

I want to insert an article custom tag. Is it possible without getting an error?


<txp:Ruhh />

Offline

#4 2008-04-19 06:42:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: txp tags in article body

I think that article_custom will not work in article body but you can use txp:if_article_id in the presentation tab to achieve the required result.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2008-04-19 15:21:13

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: txp tags in article body

Actually the article custom tag have a specified form. The specified form has everything I need for the article.


<txp:Ruhh />

Offline

#6 2008-04-19 15:31:53

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: txp tags in article body

Actually the article custom tag have a specified form. The specified form has everything I need for the article.

No. You just can’t use article_custom inside another article. You could simply use an another method. In example put the <txp:article_custom /> inside form or page template. Also, the <txp:article_custom />’s form wouldn’t anyway work inside another article – meaning if you want to pull the content form that article, it just doesn’t pass the global ID. You must use for that <txp:output_form form="" /> or put the tags to the article form that is first place used by the <txp:article /> tag.

Article inside article doesn’t make sense – and it doesn’t work. What els means is, place to your article form:

<txp:if_article_id id="44">
	<txp:article_custom id="66" />
</txp:if_article_id>

But that doesn’t make sense, as it isn’t needed. Also that really does slow your site down, as it makes extra queries per article.

Last edited by Gocom (2008-04-19 15:33:30)

Offline

#7 2008-04-19 16:01:41

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: txp tags in article body

Ok, I got it figured out. I just had to use a bunch of tags: if_category, if_individual_article, and else


<txp:Ruhh />

Offline

#8 2008-04-19 16:06:49

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: txp tags in article body

One could of course simply try and see if it works. Looking TXP code, I suspect that article_custom can be used inside an article, just as it can be used on an individual article page/template. It’s not something that is (well) tested or even officially supported, but that doesn’t necessarily mean it doesn’t work.

Offline

#9 2008-04-19 16:31:00

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: txp tags in article body

Sure it works :) I’ve done it before.

Offline

#10 2008-04-19 18:34:36

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: txp tags in article body

ruud wrote:

One could of course simply try and see if it works. Looking TXP code, I suspect that article_custom can be used inside an article

I meant trying to pass values from article to article, otherwice that is kinda like causing only extra queries, as the other article is just articles containing article. Better would be use that article tag individually or if you need extra output, then output_form, but there is also query pitfall.

Offline

#11 2008-04-19 18:51:23

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: txp tags in article body

article_custom can be used to get more flexible layout on recent_articles.

Offline

#12 2008-04-20 06:24:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: txp tags in article body

ruud wrote:

Looking TXP code, I suspect that article_custom can be used inside an article, just as it can be used on an individual article page/template.

bug of a feature:)?

Last edited by colak (2008-04-20 06:25:46)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB