HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Questions about catalogues and multilang

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#50946 (In Topic #11112)
Avatar

Well-settled

I am sorry if I am repeat questions asked already but I was not able to find an answer using OCF search and these items seem to be not described in tutorials.

1. Can I have a catalogue with entries fit into multiple categories? It will be best explained by an example. I am working on the site about Diablo II mod and creating an items catalogue now. Items may fit into different categories - item type (ring, amulet, armor, weapon, etc.), quality type (normal, exceptional, elite - for weapons and armors only), artifact type (unique, set). What I'd like to do: fill in an item data then choose multiple categories it belongs to: weapon, exceptional, set for example. This way it could be viewed by the most appropriated feature the user is looking for. I could do it by putting item quality type and artifact type into the item itself and having users to perform search to limit an output but it reduces an initial visibility of things available. So if there is a way to place an entrie under multiple categories it would be really preferred. Though here we come to another issue - user should be able to choose multiple categories to display to get items which fall into all choosen categories. If this is not possible then the only way I can go is to put types mentioned above to the enrtie itself?

2. The second question is related to multilanguage site. I want to create the same set of information in two languages: English and Russian and display them according to the language choosen. The most obvious way I can see here is to create two zones: Russian and English and manually add every piece of information to these zones menu. This way I will have to duplicate each piece of content manually. I have not found a way to translate Comcode pages using Admin Zone tools - am I miss something? And is there more convenient way to maintain multiple language site? If someone has got into this issue already and resolved it in a more suitable way than stated above I would be very grateful for any tips :)
Back to the top
 
Posted
Rating:
#50954
Avatar

1- sorry, there's no multiple-category support for catalogue entries.

2- it needs to be done manually by copying the .txt files. We used to (a few years ago) support this in the Admin Zone but it didn't work well so we ended up turning it off. Maybe on day we'll get this back in again.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#50955
Avatar

Well-settled

1. OK, I'll try to do a trick around that in other way :)
2. Hmm, do you mean that if I create RU directory in comcode pages dir and place .txt with russian translation there it will show automatically in Russian? If yes it would be awesome.
Back to the top
 
Posted
Rating:
#50956
Avatar

Well-settled

Tested it - it works :) Cool. Now I need to figure out how to handle menus like that :) And then will be then most difficult thing to separate catalogues by lang.
Back to the top
 
Posted
Rating:
#50971
Avatar

Well-settled

Chris, I see now how can I deal with Comcode pages. Catalogues seem to be workable as well. There are two things which make me stumbled a bit.
1. Menus. Where should I look to learn how to make them multilingual?
2. It seems that your system uses internal LANG value to determine which language to use. Can I make it embedded in URLs? Current situation is good for surfers but it will cause many issues in SEO aspects. If I could to separate URLs for ENG and RU variants of pages it would be a lot of help.
Back to the top
 
Posted
Rating:
#50973
Avatar

1- you can override the panel_* pages to different languages in the same way as regular pages. Each override can use a different menu
2- side_lang block

Also in templates you can do like…

Code

{+START,IF,{$EQ,{$LANG},RU}}
Something Russian
{+END}
{+START,IF,{$EQ,{$LANG},EN}}
Something English
{+END}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#50974
Avatar

Well-settled

Just another thing I have thought about. I'm pretty sure it is not implemented into current release as I do not see anything like that in interfaces but it might be useful for future ones…

If catalogue entry has some fields unfilled it would be useful to be able to not show them for this entry.
What do I mean. I am starting to fill up items catalogue now and considering if it would be better to use different field for every possible item attribute. Like any item possibly could have "increased light radius" in Diablo but not everyone has it. If I make "+light radius" as an entry field it would display for all items regardless if they have it or not, am I correct? Or possibly I could do it with some kind of template trick? Does catalogue template receive all fields value so I could check first if it is empty and disable display for empty ones?

Hmm… it seems I have to check catalogue templates - the question contains a half of an answer itself :lol:
Back to the top
 
Posted
Rating:
#50975
Avatar

CATALOGUE_DEFAULT_ENTRY_FIELD
from:

Code

<tr>
   <th>{FIELD*}</th>
   <td>{VALUE}</td>
</tr>
to e.g.

Code

{+START,IF,{$OR,{$IS_NON_EMPTY,{VALUE}},{$NOR,{$EQ,{FIELD},+Something},{$EQ,{FIELD},Blah},{$EQ,{FIELD},+Light radius}}}}
<tr>
   <th>{FIELD*}</th>
   <td>{VALUE}</td>
</tr>
{+END}

That's quite an advanced example. The field will not show if it is blank for any fields named either "Blah", "+Light radius" or "+Something".

I haven't tested it.

You could take it further, for example make it not show if it is blank for any fields starting "+".

Code

{+START,IF,{$OR,{$IS_NON_EMPTY,{VALUE}},{$NEQ,{$SUBSTR,{FIELD},0,1},+}}}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#50976
Avatar

Well-settled

Great, thanks a lot :) It is a lot of work about data fill using this method but it becomes to be really interesting. I haven't seen any comparable Diablo items database to what your engine offers :thumbs:
Back to the top
 
Posted
Rating:
#51082
Avatar

Well-settled

One more question - I've created a catalogue and chosen plain category listing. Later I have decided that it would be better to have tree categories… but I can't do that by changing catalogue settings? O_o
I've put few tens of fields there already - not a big deal of course but I really hate to make new catalogue and type them again just because I need tree categories now :) Help me :lol:
Back to the top
 
Posted
Rating:
#51137
Avatar

We'll consider making this a proper feature, but I think you can do it by editing the database. Change 'c_is_tree' to '1' in the 'catalogues' table, for the row of your catalogue. That should work so long as you have exactly 1 category in your catalogue. If you don't have a category yet, make one. That category will become the root category.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#51176
Avatar

Well-settled

Thanks Chris, I've already recreated that catalogue :) Now my most pain is the idea that I need a multilingual catalogue with the same content but different entry names. The only thing I can see now is to create two absolutely identical catalogues just because of field names. It could be tough… I need to think about it again :D
Btw, I cannot get how field type "reference to catalogue entry" works? I leave it blank hoping I will be able to pick up an entry in the process of adding a new entry but I can't? Hmm… maybe I'm more stupid that I thought - I need to check it out with at least one entry already in catalogue - I will do it tomorrow :)
Back to the top
 
Posted
Rating:
#51181
Avatar

I'll give some thought to the multi-lang issue, and see if we can do something for 4.2.

Btw, I cannot get how field type "reference to catalogue entry" works? I leave it blank hoping I will be able to pick up an entry in the process of adding a new entry but I can't? Hmm… maybe I'm more stupid that I thought - I need to check it out with at least one entry already in catalogue - I will do it tomorrow :)

Hmm, that's an interest point I never thought of. I'll see if I can make it a bit smarter.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#51198
Avatar

Well-settled

Now I've got another question regarding "Reference to a catalogue entry" field type :) It works (as I guessed, it needed at least one entry to show choises) but now it becomes OBLIGATORY and there is no way to fill it with an empty value. I better illustrate it with an example:
http://test.bfe.net.ru/site/catalogues/category/47.htm
Transmogrify To and Better Gem fields should be optional but they add every time :) I have managed to hide non-filled fields, thank you Chris, but I don't know what to do with this one :) Catalogue entry reference is VERY convenient for the purpose of these fields but I need to find a way to not fill them for entries which do not need it. Am I doomed? :)
Back to the top
 
Posted
Rating:
#51200
Avatar

Does this work? (It should add a N/A option if the field is non-required, that passes in a blank value)

Attachment
sources/hooks/modules/catalogue_fields/reference.php
» Download: reference.php (4 Kb, 168 downloads so far)



Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#51201
Avatar

Well-settled

Awesome! Thank you Chris, you are super!
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: