Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2009-01-29 09:30:40
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: Restaurant Guide (Filtering by...)
Hello again,
I was trying to structure the site and encounter some problems doing it, I hope you guys can help me.
I am trying to use “sections” “categories” “child categories” and “custom fields” (with the plugins glz_custom_fields + sed_section_fields)
The problem I see is how to use all this to organize in an easy way for my client to upload its content.
For example:
These are the type of articles that will be published with their subdivisions inside:
1.-Restaurants (filters: “price range” “Atmosfere” “Location” “type of food”)
a.- Spanish food
b.- Italian food
c.- Asian food
d.- Contemporary food
e.- Mexican food
f.- etc…
2.-Entertainment (filters: “Location” “type of entertainment”)
a.- Theater
b.- Movies
c.- Clubs
d.- Casino
e.- Music
f.- etc…
3.-Shoping (filters: “Location” “type of shop”)
a.- Jewelry
b.- Flowers
c.- Books
d.- Toys
e.- Clothing
f.- etc…
4.-Beauty & Health (filters: “Location” “type of service”)
a.- Hair Dressers
b.- Spa
c.- Gyms
d.- Medical Centers
e.- etc…
As you can see there is alot of clasification to be done, and dont know what to put in sections, what in categories, child categories, or custome fields.
And make it all searchable by filtering to make it really easy for a user to find something, and also for my client to upload it to the correct place.
Has anyone done something this complicated? or has any idea how it can be done?
Thanks!
Last edited by mlarino (2009-01-29 10:02:17)
Offline
Re: Restaurant Guide (Filtering by...)
I think if you’re going to filter by more than two items at once you should definitely investigate glz_custom_fields, which will mean you will use custom fields more.
Looking at what you’ve written, it looks like every entry has a distinct location and a type that don’t overlap (a hairdressing restaurant is very unlikely) and some have extra information such as “atmosphere” (spelling!) and “price range”, which you might get away with just providing as information (or order-by sort value) rather than as a search criteria.
One suggestion:
- use your 1,2,3,4 headings as parent categories and the a, b, c, d, e, f, as child categories, as you’ve written them out here [ = type ]
- you could use “location” for the other category [ = location ]. Again you could use parent and children categories for towns and districts, regions and towns or whatever.
- maybe you use a grading/price-bracketing system ,e.g. 1-to-5 stars/dots/currency-symbol rather than concrete amounts to reduce the amount of editing you need to do later. As prices change over time, you then only need to change the explanation of the price brackets for each star rather than the prices in every article. You’d only need to change them if a particular shop goes upmarket. You could then use a custom field for this and use it as a “sortby” value rather than a filter.
- “atmosphere” is very subjective, so you might get away without making it a filter criteria but rather an “informative” item.
This is just one way, there are others too.
Last edited by jakob (2009-01-29 10:23:13)
TXP Builders – finely-crafted code, design and txp
Offline
#15 2009-01-29 10:49:21
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: Restaurant Guide (Filtering by...)
Thanks Jakob!
The price range is used for search, because that way someone can search for a Japanese restaurant between 30$-40$, depending on how much they want to spend.
Is something my client wants, because all the competitor websites use it. (but I will try to explain to him that they could be sorted)
Atmosphere could go only in the info, maybe using icons… That way I could use more than one Atmosphere per restaurant (Romantic + Modern)
When you say use =type as one Category and =location as another, they will all be displayed in the “Category 1” and “Category 2” in the Write tab right?
There is no way of separating both Categories with their Childs? (one in Cat.1 and the other in Cat.2?)
Because there will be a really Big amount of locations. Forgot to mention that in Location “Madrid” there will be sub-locations “23 districts” (all need to be used for filtering)
and in the near future, they will want to incorporate “Barcelona” with some more sub-locations. (Maybe Locations can be a Categorie, but sub-locations custome fields?
What do you guys think?
Is it posible to create a method to search by all this fields at the same time? like the one I posted before?
http://www.edwardkinsellaillustration.com/search.jpg
Last edited by mlarino (2009-01-29 11:04:44)
Offline
#16 2009-01-29 11:46:55
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Restaurant Guide (Filtering by...)
Unfortunately I’m in a hurry so I can’t elaborate now, but I dare to insist you shold use the smd_query plugin taking advantage of the new tag nesting capabilities of txp 4.08. You have to study it a little but if I’m not wrong it’s all you need.
Here’s a quick example (modified from the plugin’s help):
<txp:smd_query column="Title"
table="textpattern"
where="custom_1='<txp:custom_field name="location" />' AND custom_2='<txp:custom_field name="atmosphere" />'
form="yourform" wraptag="ul" break="li" />
I hope I’m not missing something but I think you should at least have a look at this approach.
Offline
Re: Restaurant Guide (Filtering by...)
As far as I know there’s no way of showing only some of the categories on the back-end. In that case you might want to take a different tack:
- make your 1,2,3,4, each a different section
- make your price-range either using a custom-field and glz_custom_fields or as a series of price-range categories (20-30, 30-40, 50-70,70+)
- make your type – 1,2,3,4 and a,b,c,d,e,f… – a category but still separate into parent and child, so that you can show only the child categories on each section. On the back-end you will still have the long category-list, though. On the front end output only the relevant child-categories for that section. You can then also use “type of [restaurant/entertainment/shop]” for the label of your search box.
- make your location either as a category (depending on what you choose to do with price), or as a custom field and us glz_custom_fields
- make a duplicate site for another entire region (Barcelona), either with an own-url or a subdomain.
You will need to test this carefully as you will need to make glz_custom_fields and categories work together.
You are right to investigate this carefully as textpattern is relatively limited regarding complex searching. If your client suddenly wants another search item added or a different url structure, you may find you can’t accommodate it. Again, it pays to investigate this in detail from the beginning as once you have a lot of data, it is a tedious job to update a new ‘factor/property’ that gets added as an afterthought. If you anticipate this happening (e.g. yo mentioned to keep up with competition and also added a new town to the equation in your last post), you may want to design your dataset to be able to cope with different search methods and for extensibility and then choose or design the realisation method afterwards. Txp may not be the most appropriate tool.
TXP Builders – finely-crafted code, design and txp
Offline
#18 2009-01-29 12:10:44
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: Restaurant Guide (Filtering by...)
Thanks Redbot
I was trying to read about smd_Query but I have no idea about SQL, so that would take me forever to learn… I will try to read more into it and see if I understand something.
Thanks for your help Jakob
This project is becoming a little crazy, there is no cash to hire a programer or someone to do all this, so I am in charge, all I know is HTML + CSS and how to use textpattern.
When you say textpattern may not be the most appropiate tool, what other tool would you suggest?
I will try all this Category/Section/Custome Fields mess and see if I am able to make a simple search for the user. (or at least as easy as posibble)
Thanks again!
Offline
#19 2009-01-29 12:38:30
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Restaurant Guide (Filtering by...)
Never post when you’re in a hurry.
Re-reading my post I realize I made it too easy and also my example is plain wrong.
I still think smd_query would be useful but you have to combine it with adi_gps and maybe some php to build the form so, sorry, maybe this was not the right solution in your case.
Offline
#20 2009-01-29 12:45:11
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: Restaurant Guide (Filtering by...)
No problem RedBot,
Can someone point me to a detailed explanation of the relationship of Sections/Categories/Childs with search?
Is there anything documented like that?
Thanks!
Offline
Re: Restaurant Guide (Filtering by...)
redbot wrote:
smd_query would be useful but you have to combine it with adi_gps
Not strictly true, as smd_query can read directly from the URL now and has the filtering capability to weed out bogus input.
However — as jakob is saying — the biggest problem is not what to do with the data but how it is organised. Once that hurdle is crossed and the structure is nailed down, then I’m sure smd_query / adi_gps / smd_if / glz_custom_fields / txp:if_variable et al can slice the data and produce something meaningful.
Last edited by Bloke (2009-01-29 12:50:02)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#22 2009-01-29 13:04:58
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: Restaurant Guide (Filtering by...)
Thanks Bloke,
I will try to nail down the structure like you say.
Will create a couple of different aproaches to the problem and see how sections/categories/custom-fields end up.
I will post my options of structure and maybe you guys can point me to wich you think is correct.
Thanks again for all your help!
Offline
#23 2009-01-29 17:39:44
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: Restaurant Guide (Filtering by...)
I was searching around the forum and found smd_if
I think it was you Bloke that was responding to someone that wanted to create a multiple search form. exacly what I want to do.
Will smd_if work for this?
That way I can create a form that will search for the 4 custome fields I will create at the same time.
right?
Offline
Re: Restaurant Guide (Filtering by...)
mlarino wrote:
Will smd_if work for this?
You mean like the thread I referenced in post #5? In which case, yes — with some cunning and ingenuity, it will work.
Be warned that it largely depends on how many articles you have, and whether you can pre-filter those articles (e.g. by section and/or category first). If you let smd_if romp through an entire site of a few hundred articles each time someone searches for a restaurant, then as your user base grows, you will:
a) annoy visitors because it will be slow
b) annoy TXP because it will have a lot of work to do
c) annoy your host and any other shared hosters, as you suck resources away from them
smd_query will more likely ease the load and get things back a lot quicker if you streamline the queries. People here can help design your queries for maximum efficiency, but you will have to have a reasonable idea of what you are going to store in which fields and how stuff is organised first.
How are your plans for that bit coming along? Got any more ideas that we can debate?
Last edited by Bloke (2009-01-29 18:28:33)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline