Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-12-28 23:10:19

waznelle
Member
From: Australia
Registered: 2007-01-16
Posts: 13
Website

Article tags cannot be used outside ... with rss_if_search_results

Hello,

I am using txp 4.0.7 with 2 plugins:
rss_if_search_results
ako_random_comment

I have a form for the sidebar+footer that includes the following:
[code]
<txp:if_article_id id=“7”> <!— do not show quote at the bottom —>
<txp:else /> <txp:ako_random_comment id=“7” wraptag=“blockquote” />
</txp:if_article_id>
[/code]

The above works great on every page but when I try to search for something, only on the search results page I get the error that “Article tags cannot be used outside article context”

My search code in the default page is:
[code]
<txp:if_search> <txp:article pgonly=“1” /> <txp:rss_if_search_results> <h1>Search Results</h1> <txp:article /> <txp:else /> <txp:article_custom id=“9” form=“static_text” /> </txp:rss_if_search_results> <txp:else/> <txp:article form=“static_text” limit=“1” />
</txp:if_search>
<txp:output_form form=“sidebar+footer” />
[/code]

Would anyone know why this is happening? or how can I fix this?

Thanks,
Elle

Offline

#2 2008-12-29 01:00:52

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

Re: Article tags cannot be used outside ... with rss_if_search_results

Try this:

<txp:if_individual_article>
    <txp:if_article_id id="7">
	<!-- do not show quote at the bottom -->
    <txp:else />
	<txp:ako_random_comment id="7" wraptag="blockquote" />
    </txp:if_article_id>
<txp:else />
    <txp:ako_random_comment id="7" wraptag="blockquote" />
</txp:if_individual_article>

And you can replace rss_if_search_results with <txp:if_search_results> :)

Offline

#3 2008-12-29 01:12:07

waznelle
Member
From: Australia
Registered: 2007-01-16
Posts: 13
Website

Re: Article tags cannot be used outside ... with rss_if_search_results

Thanks Els. I figured that this error happened also when I viewed section pages. The above fixes it.

I still have 3 questions (if you don’t mind):
1. Does that mean I do not need the rss_if_search_results plugin anymore?

2. I added <txp:keywords /> as a metatag — which I get the same error when viewing section pages. should I add <txp:if_individual_article> to that as well?

3. Where can I find what new txp tags / capabilities are in newer versions of txp?

Elle

Offline

#4 2008-12-29 02:06:03

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

Re: Article tags cannot be used outside ... with rss_if_search_results

1. I’ve never used the plugin, but as far as I can tell it does exactly the same as <txp:if_search_results>, so yes, you don’t need the plugin anymore.

2. Yes, that’s right. Article tags represent fields in the textpattern table (where the articles are stored), therefore they can only be used in an article form or inside if_individual_article tags.

3. In the file history.txt that comes with every Txp release you can find all new tags and attributes for that version. In the Tag Reference on some of the tag pages you will find a ‘Genealogy’ chapter where changes to the tag are recorded, but not every tag page has it, and if it is there, it may not be complete.

Offline

Board footer

Powered by FluxBB