Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-07 18:10:08

jiraiya
Member
Registered: 2005-05-15
Posts: 13

Keywords or customer field in page template?

Are there anyway to output the keywords or customer field in the page template. Currently it only works in forms.

The tags I’m refering to is `<txp:custom_field name=“FieldName” />` and `<txp:keywords />`.

Are there any alternatives?

Thanks.

Offline

#2 2005-10-07 21:07:25

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

Re: Keywords or customer field in page template?

Can you explain what it is exactly that you want to achieve?

Offline

#3 2005-10-08 21:22:19

jiraiya
Member
Registered: 2005-05-15
Posts: 13

Re: Keywords or customer field in page template?

It’s for an ad program script. The ad is placed on the page template and not in forms. I can’t place the script in the form.

To use the ad program to my needs, I need to input keywords into the script for the different articles I write. The only way I can think of is use the custom_field or keywords. The problem is the custom_field and keywords does not work when using the tags in the page template. It only works in the forms.

Offline

#4 2005-10-08 22:14:17

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

Re: Keywords or customer field in page template?

Ah, I see. Are you sure it’s not possible to put the script in an article form? Something like this:

<code><txp:title />
<txp:body />
[script … <txp:custom_field name=“blah” /> … end script]</code><br />
If necessary you could wrap the script in a div to position it?

Offline

#5 2005-10-09 16:36:55

jiraiya
Member
Registered: 2005-05-15
Posts: 13

Re: Keywords or customer field in page template?

Sorry, let me clarify a little bit more.

The `<txp:custom_field name=“FieldName” />` works in Admin -> Presentations -> Forms.
The tag does work in a [script] if the [script] is in Admin -> Presentations -> Forms.

The `<txp:custom_field name=“FieldName” />` does not work in Admin -> Presentations -> Pages.
The tag does not work in a [script] if the [script] is in Admin -> Presentations -> Pages.

I am not sure if this is normal. I am using the latest version 4.0.1.

Offline

#6 2005-10-09 19:37:37

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

Re: Keywords or customer field in page template?

You’re right about that, the tag only works in article forms. But I was wondering if there was a reason why you couldn’t put the script there as well.

Offline

#7 2005-10-09 20:02:55

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

Re: Keywords or customer field in page template?

I am not sure if this is normal.

Yes, the tag only works in forms, not pages. It’s intended that way, because the query to fetch article-data is done when the tag is encountered during parsing of the page, it is not not know beforehand in the page-context.

You can use two article-tags on the same page. So in addition to your regular article-tag, you would have one where the ad is supposed to appear, which you would wrap in an txp:if_individual_article and call the article-tag with a form that only outputs the custom field you need. For this to work, you have to turn off “Auto append comments” in preferences, and add the necessary tags for displaying comments in the necessary places (if you are using comments at all).

Offline

Board footer

Powered by FluxBB