How to build a linked, single page FAQ list?

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

How to build a linked, single page FAQ list?

Postby muttly » Fri Jul 16, 2004 9:48 pm

I have an FAQ list that will be beween 10-15 questions. Answers are about a paragraph each, each answer is too short to justify it's own page, but the list gets too long to scroll thru. I would like to have my single page output look like so:

FREQUENTLY ASKED QUESTIONS
    Q. (auto linked to answer split) What is Nat'l Retailer Association?
    Q. (auto linked to answer split) Where are their service outlets?
    Q. (auto linked to answer split) Who serves on the board?
    Q. (auto linked to answer split) Where can I find good Coranto documentation?


FREQUENTLY GIVEN ANSWERS
    Q. What is Nat'l Retailer Association?
    A. a retailer's association, duh.
    (return to top)

    Q. Where are their service outlets?
    A. they're everywhere, man.
    (return to top)

    Q. Who serves on the board?
    A. some guys who manage retail outlets.
    (return to top)

    Q. Where can I find good Coranto documentation?
    A. Dude, OMG U suXX0Rz, RTFM
    (return to top)


Can I do a maginot split profile that cranks out an auto link, but builds the split to the lower half of the page instead of spawning a separate page?

Is maginot even the right tool for the job?
muttly
 
Posts: 178
Joined: Mon Jun 10, 2002 8:19 pm

Postby SrNupsen » Fri Jul 16, 2004 9:57 pm

The easiest would be to use the "Anchor tags" option in a standard profile, I guess. This is done the following way:

Create a headlines profile that you'll include on the top of your page. Have its corresponding style output something like:

<A HREF="#<Field: newsid>"><Field: CustomField_Question></A><BR>

Create a standard profile, set Anchor tags to ON and have it output everything (all the QA items).

Then, on your page, include the output of the first profile, then the output of the second. Should do the trick.

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Dale Ray » Fri Jul 16, 2004 11:55 pm

You can do this with one standard Coranto Profile with headlines and anchor tags enabled. For the example below I am going to assume that you are using the subject field for the question and the text field for the answer.

the headlines style would look like:
Code: Select all
<a href="#<ItemAnchor>">Q: <Field: Subject></a><br>


Then your questions answer style would look like:
Code: Select all
<p>Q: <Field: Subject></a><br>
A: <Field: Text></p>


In your html page put:
Code: Select all
<p><include headlines.txt file here></p>
<include profile.txt file (Q's and A's) here>


How you include the two files depends on how you are generating your pages. SSI or PHP includes are the most common.

You can alter the formatting in the style to suit your needs and the way you want your site to look.

Dead Link Removedby Author is a FAQ index that is managed with Coranto. This one uses viewnews.cgi to display the answers, so they are generated on the fly when the Question link is clicked. Whether you want dynamic pages or static is for you to decide.
Last edited by Dale Ray on Mon Feb 07, 2005 6:31 pm, edited 1 time in total.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby bozoka45 » Sat Jul 17, 2004 7:09 am

FYI, I created this page using the mentioned methods.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby egalvez_ » Wed Aug 03, 2005 11:28 pm

Dale Ray's first code quotation worked for me except it had a number sign after the <a href=" that shouldn't have been there. The anchor links work fine if the number sign is removed.

Code: Select all
<a href="#<ItemAnchor>">Q: <Field: Subject></a><br>


should be:

Code: Select all
<a href="<ItemAnchor>">Q: <Field: Subject></a><br>


Thank you all for this thread. It was very helpful to me in building an FAQ page where linked questions appear at the top of the page that, when clicked, jump down to the appropriate section below.
egalvez_
 
Posts: 24
Joined: Tue Sep 16, 2003 1:07 am


Return to Customization

Who is online

Users browsing this forum: No registered users and 5 guests

cron