Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Using keywords or else for dividing articles.
Everything is simple – there is movie site. There different genres (for ex.): comedy, thriller or drama and so on.
For every movie can be assigned more than one article.
I tried to reach the aim by using catagories – 1st category is film name, 2nd – genre. But it’s not useful to add category every time we need to write article about new film. And it cause’s some troubles in further work…
The idea is to make 2 lists:
1. List of all genres and write number of movies with such genre in (brackets);
For example:
Drama (2)
Comedy (12)
Thriller (3)
2. List of films with number of articles assigned to this film:
Terminator (13)
Alien vs Predator (3)
But there is a trouble – if I’ll use <txp:category_list /> for listing genres it will count all articles with such category. But as we have more than one article per movie, the counter will bo more than it should be…
I think that i should look to keywords, but how to use them right?
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#2 2007-09-21 20:28:40
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Using keywords or else for dividing articles.
If I were you I’d stick to using categories for genres, because that’s exactly what they are.
As for using custom fields for movie titles, there is one thing you should consider: to sort the articles by the content of a custom field, the movie titles should be spelled exactly the same everywhere. Unfortunately in plain TXP there is no such thing as a dropdown list for custom field content to choose from.
There is a new, very promising looking, custom field plugin, that does have a select feature and might suit your needs. Don’t know about the article count though.
Offline
Re: Using keywords or else for dividing articles.
Els wrote:
If I were you I’d stick to using categories for genres, because that’s exactly what they are.
I agree – using categories for genres – is in spirit of textpattern. But the will count now movies but articles, assigned to movies. And this is, as you can see, wrong.
As for using custom fields for movie titles, there is one thing you should consider: to sort the articles by the content of a custom field, the movie titles should be spelled exactly the same everywhere. Unfortunately in plain TXP there is no such thing as a dropdown list for custom field content to choose from.
I understand about exact writing – it’s not a problem. I’m suffering without an ability to use dropdown menu of yet entered custom_field values. May be there can be simple hack for this?
There is a new, very promising looking, custom field plugin, that does have a select feature and might suit your needs. Don’t know about the article count though.
As i can see it’s not free?
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Offline
Re: Using keywords or else for dividing articles.
I understand about exact writing – it’s not a problem. I’m suffering without an ability to use dropdown menu of yet entered custom_field values. May be there can be simple hack for this?
Not a simple one since if you want it as a <select>
you will also need some sort of interface for adding new values to the <select>
.
Doable, but not that simple. And most likely not a hack but a plugin.
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#6 2007-09-22 14:54:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Using keywords or else for dividing articles.
the_ghost wrote:
I agree – using categories for genres – is in spirit of textpattern. But the will count now movies but articles, assigned to movies. And this is, as you can see, wrong.
Then maybe use sections for genres?
obeewan wrote:
Not a simple one since if you want it as a
<select>
you will also need some sort of interface for adding new values to the<select>
.
In that case, why not use categories if you’ll have to add new values anyway?
Last edited by els (2007-09-22 14:56:51)
Offline
Re: Using keywords or else for dividing articles.
In that case, why not use categories if you’ll have to add new values anyway?
My logical brain started to brake down the problem with using custom fields and <select>
s to define. What it failed to see was the total solution as you have proposed.
I’ve been coding to much Javascript lately .. It ain’t good for my brain =D.
Last edited by obeewan (2007-09-22 15:36:58)
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#8 2007-09-22 18:11:59
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Using keywords or else for dividing articles.
Well, if I understand correctly, the_ghost’s idea in the first place was to use custom fields, and have new values, once entered for the first time, show up automatically in a drop down list. That of course would be a very nice solution, but probably not easy to achieve either.
Last edited by els (2007-09-22 18:12:50)
Offline
Re: Using keywords or else for dividing articles.
Well, if I understand correctly, the_ghost’s idea in the first place was to use custom fields, and have new values, once entered for the first time, show up automatically in a drop down list. That of course would be a very nice solution, but probably not easy to achieve either.
Actually, it would be very simple by hacking txp_article.php. But it is hacking, so it have it’s own problems. And secondly it addes a one search more to the write tab.
Cheers!
Offline