Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-10 06:52:17

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

First timer questions

Hi, I’m building my first web site (temp. on www.mpetrov.info/barbara2) with textpattern and I just started learning the program. I will use this topic for asking you varous questions…

My first problem:
I want to display a single random quote on the home page. All quotes are stored as separate articles in a section called “testimonials”. I managed to display my single quote with this:

<code><txp:article_custom section=“testimonials” form=“testimonials” limit=“1” sortby=“rand()” /></code>

How can I exclude certain articles (quotes) from the testimonial section? Can I for exapmle create a category “not-good” which will be used for labeling quotes I don’t want to appear on the home page?

Offline

#2 2006-02-10 07:18:07

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: First timer questions

add make both “testimonials” and “not-good” categories, not sections then call them by category with article_custom as you have been doing.

  1. categories are for content
  2. sections are presentation, for broad funtions (divisions of your site)

Offline

#3 2006-02-10 07:26:13

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

Re: First timer questions

But I will have e section (with its own page) called “tesmtimonials” which will display all testimonials.

As long as I understand cateogies are for filtering or labeling (tagging).

P.S. If I have a section “about” and I create a subpage under about for all the testimonials, should I make that page a section too?

I’m still confused…

Last edited by neomatrix (2006-02-10 07:30:37)

Offline

#4 2006-02-10 11:52:15

BZ
Member
From: Stuttgart, Germany
Registered: 2005-11-24
Posts: 65
Website

Re: First timer questions

you could create 2 categories, “good” and “bad” and sort your testimonials that way. then you use the <code><txp:article_custom section=“testimonials” category=“good” /></code> to display only the good ones. do you know about the Tag listing? it’s a very good resource for looking up. look at the parameters of the tag.


Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com

Offline

#5 2006-02-10 22:15:40

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

Re: First timer questions

Thanks, that was easy….

Another question:
How can I remove the class=“whatever” created by “txp:comments_invite” ?

Offline

#6 2006-02-11 03:32:21

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

Re: First timer questions

And I want to ask another question.

Is it possible to put classes or id inside txp tags? I guess my question has been asked before but I’m having difficulties with the forum’s search engine (maybe I don’t use the right keywords).

Offline

#7 2006-02-11 04:18:41

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: First timer questions

When it comes to markup, <a href=“http://textpattern.net/wiki/index.php?title=Alphabetical_Tag_Listing”>TextBook’s alphabetical tag listing</a> is far more thorough than the forum search. It will tell you <a href=“http://textpattern.net/wiki/index.php?title=Attributes_Cross_Reference#class”>which tags support the class attribute</a>.

Offline

Board footer

Powered by FluxBB