Tags:
create new tag
view all tags

Question

Hello,

I am starting a project, and would like some advice on the best way to accomplish it:

I am creating a web for our company that will contain information on various cities. Each city will have several pages of information, maintained by different departments. I would like the pages to have a consistent look, and have each city's main menu page look exactly the same (except for the city name, code & country header at the top, and links to that city's pages). I would like to have each city's menu page be mostly an include file, that is shared with all the city menu pages. That way, if I want to add a menu item, I just add it in the include file, and all the cities will have it automatically. Also, that will hopefully stop people from trying to change a main menu page.

There are a couple of ways I can think to do this:

1. (this one I've tried) I named the files with the city name & country (e.g., HEL_Helsinki_Finland, or CPT_CapeTown_SouthAfrica, or NKH_NukuHiva_Marquises_FrenchPolynesia), and in the include file, I parsed out the file name and put the contents into variables, so that the page actually displayed something like:

City Code: HEL

City Name: Helsinki

Country / Region Name: Finland

I use the city code/name in other places in the page as well.

This got a little clunky when city or country names were long, or needed to include a state or province as well as country. It seemed like filenames started becoming too long, since every page for the city had to start with this string.

2. Have an external xml file with a record for each city, containing all the information needed. Pass the city code to the include file, and retrieve the rest of the city information from the xml file, and display in the page.

I have seen the xml query plugin (XmlQueryPlugin), but have not tried it.

We have over 600 cities, so I'm not sure if it might be slow to retrieve the data.

Does anyone have any advice?

Or perhaps an even better option 3? smile

Your help is appreciated!

Thanks Kathy

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows 2003
Web server: Apache 2
Perl version: Indigo Perl 5.8.6
Client OS: Windows
Web Browser: Firefox, IE
Categories:  

-- KathyDeLaCruz - 13 Oct 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

I would advise putting your fields in a TWikiForms "!CityForm" in eacg topic, then either have a %INCLUDE including your master template getting the form values and displaying them via http://twiki.org/cgi-bin/view/TWiki/TWikiVariables#FORMFIELD_fieldname_renders_a_fi , or making the topics (or web) use a skin that include this master topic if you want to prevent people to disable the include. An exemple here is the form you see just below: WebForm and I can display the value of SupportStatus by a %FORMFIELD{"SupportStatus"}% = AnsweredQuestions

-- ColasNahaboo - 14 Oct 2008

I have never used forms, but I will check it out - I think this would accomplish what I need, and it sounds like it would be fast, since it doesn't have to search thru any file except the current one, for the field values.

One question: I would not like to display this form, so I am trying to create it like a normal html form, with hidden input fields:

 <form name="CityForm"><input type="hidden" name="CityName" value="Helsinki"></form>

But this did not seem to work ... when I use

%FORMFIELD{"CityName"}%
in the same topic to retrieve the value, I don't get anything.

Do I need to have it in the format of a table, even if I'm not making a form template? Or maybe I need to reference the form name?

Is there an advantage to using forms over setting a few variables in each topic with the values I need?

Thank you for your help!

-- KathyDeLaCruz - 14 Oct 2008

You cannot just use html forms (ot you can, but then you don't use the power of TWiki). Use TWiki forms and hide the form using a custom template with this in the text: %TMPL:DEF{"form"}%%TMPL:END%. See PatternSkinCustomization how to change pattern skin templates.

-- ArthurClemens - 14 Oct 2008

An advantage of using a form is that you can keep the topic name short, and then users can type the 3 letter airport code into the "Jump" box and get the topic they want. They could to the same with a name like "HEL_Helsinki_Finland", but it would be annoying to have to type in the redundant information all the time (since HEL implies Helsinki which implies Finland).

To hide a TWiki form, see HidingForms.

-- SeanCMorgan - 14 Oct 2008

OK, I now have a test setup here using forms, and using the instructions in http://twiki.org/cgi-bin/view/TWiki/PatternSkinCustomization#The_template_approach I've even created a custom skin (gasp! smile )to hide the form.

It seems to be working fantastically, so I'm going to write a script to generate all the pages for each city!

I like the idea of the user being able to just type in the code in the Jump box, and I was also thinking that another benefit to using forms is that I can search on form values, if I ever want to.

Thank you all for your advice!

-- KathyDeLaCruz - 14 Oct 2008

Change status to:
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2008-10-14 - KathyDeLaCruz
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.