Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-25 14:20:31

Robirda
New Member
From: British Columbia
Registered: 2005-11-17
Posts: 7
Website

Tailored Browse Results page?

Hi all, I can’t seem to find this particular subject mentioned anywhere, so I hope you’ll forgive me if I missed seeing it and this question is redundant!

I’d like to be able to tailor the resulting page after use of the ‘browse’ tool, but can’t seem to find anything on a) if this is possible at all, or b) if it is, how to go about it.

To show you what I’m talking about; I’ve set up a fairly simple site, at www.robirda.net (It had to be simple, because I’m just learning all this stuff – styling, etc, along with Textpattern – which, by the way, has impressed me no end, so far!)

At any rate, to get back on track here, I’d like to be able to have the resulting page, after use of the ‘browse’ tool, list ONLY the resulting list of articles, without using any of the rest of the default page template, as it does now. Is this possible, or is it just a pipe-dream?

Thanks for any advice, ideas, feedback, et al – they’re all much appreciated! :-)

Offline

#2 2005-11-25 14:47:51

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Tailored Browse Results page?

I assume you are talking about browsing by category. The resulting list of articles uses the page template for the section you are in, as usual. So to get special formatting you can use the glx_if_category_list tag from the glx_if plugin (discussion thread). Or other tags from the same plugin. For example, you could put the stuff you don’t want on your category lists inside a glx_if_section_frontpage conditional.

Last edited by jsoo (2005-11-25 14:51:07)


Code is topiary

Offline

#3 2005-11-25 15:42:47

Robirda
New Member
From: British Columbia
Registered: 2005-11-17
Posts: 7
Website

Re: Tailored Browse Results page?

> jsoo wrote:

> I assume you are talking about browsing by category.

Yes, thanks, sorry I didn’t make that clear!

> The resulting list of articles uses the page template for the section you are in, as usual.

Yes, actually I was hoping for a simple way to tell TP to use a different page template for the Browse Results page…similarly to the way the search results page can be specified. I had a feeling it wasn’t going to be that easy though, sigh!

> So to get special formatting you can use the glx_if_category_list tag from the glx_if plugin (discussion thread).

Oh, ouch, my poor brain! I have a lot of trouble understanding what to do with this kind of conditional stuff. Let’s see if I’ve got this straight – if I use the glx_if_category_list tag, after it I basically outline what I want the page to contain, and then close the tag? – but won’t TP still use the same default page to display the results?

> Or other tags from the same plugin. For example, you could put the stuff you don’t want on your category lists inside a glx_if_section_frontpage conditional.

Oh dear, you’ve lost me completely…sorry! I’ll go look it over again and see if I can’t start to get a glimmer…

Offline

#4 2005-11-25 17:17:43

Robirda
New Member
From: British Columbia
Registered: 2005-11-17
Posts: 7
Website

Re: Tailored Browse Results page?

Oh well! The first idea works, sort of – it lets me put the browse results at the top of the body.

BUT, it still displays the rest of the default page, below – which I don’t want. Surrounding that content with the glx_if_section_frontpage or other similar conditional tags doesn’t work to exclude the content I don’t want to show up on the browse results page – I suppose because the site’s frontpage and category page are both considered to be the frontpage, as far as TP is concerned….

So since I can’t have that lower content displaying W-A-Y down the page, and there doesn’t seem to be a way to get it to not display at all – except to remove it from the frontpage – I guess I’m stuck with what I have. Thanks for the try though!

“Complicating things is easy; it’s keeping ‘em simple that’s the
hard part!” (Authur C Clarke)

Offline

#5 2005-11-25 17:27:00

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Tailored Browse Results page?

Yes, actually I was hoping for a simple way to tell TP to use a different page template for the Browse Results page…similarly to the way the search results page can be specified. I had a feeling it wasn’t going to be that easy though, sigh!

I don’t think you can, although I could be wrong!

Let me try to make my suggestion clearer. Consider how you want this section’s display to look when for three different cases:

  1. Article list
  2. Single article
  3. Category list

If all three are substantially different, you could handle this in the template like so:

<txp:if_article_list>
&nbsp;&nbsp;article list stuff goes here
</txp:if_article_list>
<txp:if_individual_article>
&nbsp;&nbsp;individual article stuff goes here
</txp:if_individual_article>
<txp:glx_if_category_list>
&nbsp;&nbsp;category list stuff goes here
</txp:glx_if_category_list>

If the article list stuff and the individual article stuff are the same, you could avoid repetition by putting that stuff into a miscellaneous form, and calling the form like so:

<txp:output_form form="myStuff" />

There are other ways of accomplishing the same thing, and what is simplest and best just depends on your particulars. The <txp:else /> tag can also be handy for this kind of thing. Unfortunately, it seems not to work inside a glx_if conditional.


Code is topiary

Offline

#6 2005-11-25 17:34:32

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Tailored Browse Results page?

BUT, it still displays the rest of the default page, below – which I don’t want. Surrounding that content with the glx_if_section_frontpage or other similar conditional tags doesn’t work to exclude the content I don’t want to show up on the browse results page – I suppose because the site’s frontpage and category page are both considered to be the frontpage, as far as TP is concerned….

I don’t think so — if I put a glx_if_section_frontpage statement in my page template, the stuff in that statement does NOT appear on a category list.


Code is topiary

Offline

#7 2005-11-25 18:36:51

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

Re: Tailored Browse Results page?

Robirda wrote:

BUT, it still displays the rest of the default page, below – which I don’t want. Surrounding that content with the glx_if_section_frontpage or other similar conditional tags doesn’t work to exclude the content I don’t want to show up on the browse results page – I suppose because the site’s frontpage and category page are both considered to be the frontpage, as far as TP is concerned….

I think you need glx_if_frontpage instead of glx_if_section_frontpage…

Offline

#8 2005-11-25 19:10:35

Robirda
New Member
From: British Columbia
Registered: 2005-11-17
Posts: 7
Website

Re: Tailored Browse Results page?

Aha, the lightbulb comes on! That was it, thanks ever so much!! I can’t say how much I appreciate your patience, and for taking the time to explain a little – I’m not so bad on the creative artist end of things, but as a techhead I’m…well, maybe not totally hopeless – but too darn close!

I must say, I’m truly impressed by how simple TP makes learning to do all this kind of thing – especially with a little help from people patient enough to not mind pointing out the obvious now and then!

Now if I can just get a better grasp of the concepts behind it all, the potential uses will be staggering! Too cool… :-D

The truth of a proposition has nothing to do with its credibility. And vice versa. (Robert A Heinlein, “Time Enough For Love”)

Offline

#9 2005-11-26 03:09:04

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Tailored Browse Results page?

You can do this without a plug-in. <code><txp:if_section name=”“></txp:if_section></code> will cover the front-page and <code><txp:if_category></txp:if_category></code> will cover anything in a category listing. And as I’m feeling generous, <code><txp:if_search></txp:if_search></code> will cover search results. Reducing your reliance on doing things with plug-ins that TXP can do anyway will reduce database load.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#10 2005-11-26 15:42:42

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Tailored Browse Results page?

> thebombsite wrote:

You can do this without a plug-in. <code><txp:if_section name=”“></txp:if_section></code> will cover the front-page and <code><txp:if_category></txp:if_category></code> will cover anything in a category listing.

Thanks, I didn’t know that <txp_if_category> could be used that way. Admittedly, the documentation in TextBook is clear enough on that point, however all the examples make use of the name attribute, and I failed to realize that the name attribute is optional, and that this tag does indeed take the place of glx_if_category_list.


Code is topiary

Offline

#11 2005-11-26 16:39:30

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Tailored Browse Results page?

Well I’m trying to find out if <code><txp:if_section></code> on it’s own with no attributes has a similar effect and can replace “if_not_frontpage” but nobody has answered my question yet. I’m patient though. ;)

EDIT

Well apparently not. Forget I mentioned that one. :)

Last edited by thebombsite (2005-11-26 18:04:50)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB