Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-30 01:51:30

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Travel Guide Website

Just wondering if anyone has built a huge guide type website with txp, one with lots of sections/categories, directory listings, a shop etc.

I’m thinking of one… but am not sure if txp would be the right choice – so am looking for some advice on the matter.

These are the sort of sites I am looking to build:

iknow-yorkshire.co.uk
yorkshire-guide.co.uk

Any input appreciated :)

Offline

#2 2009-09-30 05:02:49

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: Travel Guide Website

I’ll take a stab at making a suggestion. I’m in the process of creating a site right now that has a bunch categories that correspond to specific sections — they act like “sub-sections”. I love using Txp and I wanted find a way to use it for this project even though there isn’t really a native way to incorporate actual sub-sections. I was able to arrive at a solution by gleaning great advice in the forum, in txp tips, and by testing many different plugins.

The solution I found requires that your article categories have parent category names that match the site’s section names. You’ll have to code the site menu so that the categories look and act like sub-sections.

For instance, you might have a section with the name “yorkshire” and another section with the name “north-yorkshire”

Keeping with the above example, the category tree in the article categories tab would look something like this:

yorkshire
  • bridlington
  • harrogate
  • hull
    north-yorkshire
  • helmsley
  • malton
  • north-york-moors

I use the stw_category_tree and smd_if plugins to generate the main menu on each page. Here is an example of two of the site section names in the menu (using the examples above). Each site section in the main site menu has to be hard-coded, then the subcategories will automatically output with stw_category_tree. This menu code will work on any page in the site because it uses smd_if to test for the section name or the parent category name to determine whether or not to show the subcategories in the menu.

I also wanted a “breadcrumb” type of menu at the top of each page that tells you where you are in the site at any given time.
I use the smd_if and smd_parent plugins to generate this “breadcrumb” menu. The menu comes in two flavors….
On a regular page (section/article), my breadcrumb menu uses this code.
If on a category page, my breadcrumb menu uses this code.

Each article may have a second category assigned to it (doesn’t have to be within the same parent/section). This is helpful for cross-referencing related articles that are in different sections. I suppose you could use more than two categories if you use a plugin like rss_unlimited_categories (though I’ve never been able to get that plugin to work… and I think it is orphaned now too)

Hope this helps you get started. There may be other forum-members with better advice. It took me a while to wrap my head around it, but I am really happy with how things are turning out for my site. The project is still in development — let me know if you want me to send you a sneak-peek off-forum. I will try to remember to post a link to the site here after launch.

Offline

#3 2009-09-30 06:23:48

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: Travel Guide Website

Take a look at trenc’s site posted yesterday that is very much like what you suggest. He provides some details of the setup (and backend) including rss_unlimited_categories and tru_tags. It’s in German but the same principle applies.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2009-09-30 23:59:19

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Travel Guide Website

Thanks photonomad, jacob and trenc… gives me lots of good information :)

Offline

#5 2009-10-05 21:26:26

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: Travel Guide Website

photonomad wrote:

… The solution I found requires that your article categories have parent category names that match the site’s section names. You’ll have to code the site menu so that the categories look and act like sub-sections.Keeping with the above example, the category tree in the article categories tab would look something like this:
yorkshire

  • bridlington
  • harrogate
  • hull
    north-yorkshire
  • helmsley
  • malton
  • north-york-moors

Interesting. Why is that not doable with normal section and category structure? Is it because you have something like this:

yorkshire * bridlington * Food * Accomodation * harrogate * Food * Accomodation

or

yorkshire * Food
  • Accomodation * bridlington * Food * Accomodation * harrogate * Food * Accomodation

Just curious.
-best
kevin


its a bad hen that wont scratch itself.
photogallery

Offline

#6 2010-03-04 08:18:22

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Travel Guide Website

Back to this one again :)

This site is going to be pretty big (150-200 sections & categories) – I have a plan for the structure and just want to run it past some people to see if I am doing it correctly (or in case you have better ideas).

I’m planning on building the main navigation with adi_menu.

There are going to be 6 main regions (sections), within those main regions there is going to be a section for each town in that region (up to 60 sub-sections per region), then for each town there would be various unlimited categories (for food, accommodation, music, sport etc).

There is also going to be other sections (which may mirror the categories, food, accommodation, music) with general information for the whole area and listings for each town. To achieve this is I was planning to create a category for each town also (so that each town can have its own section page, alongside a category in the food sections.

Now this seems pretty complicated to me, but I cannot for the life of me think of another method. I thought of sub-categories, but they would be specific to the parent.

Each town needs to be able to have its own articles, its own category listings and show relevant images in its own section and in the general sections (food, accomm etc)

Does that seem logical or is there an easier way?

Offline

#7 2010-03-04 10:05:32

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: Travel Guide Website

Tye, that sounds complicated and will certainly require detailed thought, especially the relating sub-sections (which txp has no real concept of) to their parent sections (if this is necessary). You might want to make contact with mlarino who over the past few months has been working on something similar and can probably give you much more detailed information about how to set it up and what to watch out for.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2010-03-04 11:25:06

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Travel Guide Website

Thanks jakob, that is a very good thread for me to read, it gets me thinking in a totally different direction – much easier to manage (but still needs thought before implementation of course :) )

Offline

#9 2010-03-04 12:28:54

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: Travel Guide Website

Hi Tye,
What I did to organize all the articles in sections, subsections etc etc etc, was completely dissmiss the categories in txp and use custom_fields

For the 6 Regions you can use sections.
for Towns use Custom fields.

This way you can create the following:

Section 1 (Region1) —-> (custom_field) Towns1: 1a, 1b, 1c, 1d, 1e, 1f…
Section 2 (Region1) —-> (custom_field) Towns2: 2a, 2b, 2c, 2d, 2e, 2f…
Section 3 (Region1) —-> (custom_field) Towns3: 3a, 3b, 3c, 3d, 3e, 3f…
Section 4 (Region1) —-> (custom_field) Towns4: 4a, 4b, 4c, 4d, 4e, 4f…

Using bot_wtc (white tab custumize) you can hide custom fields per section, so when you choose Section 1 you can display only the custom_field Regions1. (so the user doesnt get confused with so many Regions to choose from.

The rest of the categories (for food, accommodation, music, sport etc). I am guessing that any article from any section will use these. So again, use custom fields for all of them.

Then, to display the articles on the website you will use:

<txp:article_custom form=“your_form” section=“section name” customfieldname=“value” />

<txp:article_custom form=“your_form” section=“Region1” Towns1=“your_town” />

This will only display articles from the section Region1 with the Town1 custom field name “your_town”

customfieldname=“value”
Restrict to articles with specified value for specified custom field name. Replace “customfieldname” with the name of the custom field.

Offline

#10 2010-03-05 05:42:10

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Travel Guide Website

ah – not sure if this is going to work for me fully the custom field way… (unless I’m not thinking straight)

When each town article is displayed on the page, there will also be article list of food, accommodation etc for that town… I think the only way to acheive this is by using section or categories.

The problem I can’t figure out is how to send the the custom_field value to the other article_custom forms on on the same page so that all the article forms are populated with the correct articles…

Is there a way around this…. maybe using txp:variable , but I’ve never used that before…

something like

<txp:variable name="town" value="<txp:custom_field name="Towns" />" />

<txp:variable name="town" />

(or can you use comma separated values in txp:custom_field name…. )

then use the variable to in a nested tag…

Sorry – typing out loud

Offline

#11 2010-03-05 07:38:19

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: Travel Guide Website

The problem I can’t figure out is how to send the the custom_field value to the other article_custom forms on on the same page so that all the article forms are populated with the correct articles…

I’m not sure quite what you mean but txp:article and txp:article_custom can filter by custom field in a similar way to by section or category. You could then use a combination of the sort-attribute and txp:if_different to divide the search results into groups.

Is there a way around this…. maybe using txp:variable

You could use txp:variable in the way you suggest to grab the custom_field from the results of one “txp:article_custom” query and plug it into subsequent txp:article_custom queries on the same page.

or can you use comma separated values in txp:custom_field name

No, I don’t think txp:custom_field or txp:if_custom_field can. You can put multiple values into a custom_field separated by commas and then use smd_each or rah_repeat to grab an process multiple items one after the other but I’m not sure that helps you in your scenario.

If I recall correctly, a main reason for mlarino’s use of custom fields was to make use of the ability to filter by multiple criteria using glz_custom_field. It’s much more difficult to achieve three-way filters using txp:article_custom (typicall you can filter by two criteria then group the results using if_different) How your want to search for results may be a determining aspect of the site.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2010-03-05 08:26:13

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Travel Guide Website

Thanks for the help Jacob – I think txp:variable will work for this :)

Has txp:article always been able to filter by custom_field?

The more I work with txp, the more I love it :)

Offline

Board footer

Powered by FluxBB