subtable search, formatting
- marec33
- Topic Author
- Offline
- Posts: 6
- Thank you received: 0
I have 2 questions.
1. Is possible to search in subtemplate(second table), If yes what I have to do? For example I have table publications and table authors using index table with relationship n:m. The main table is publications. When I type author name in searchbox It can't find anything.
2. How to change formatting of output from subtemplate? For example In catalog-template I have this: "{joodb subtemplate|author1}{joodb subtemplate|author2} but on output it looks like:
Steve Jobs
Bill Gates
I need to have it like that: Steve Jobs, Bill Gates
Thank you for answer
Please Log in to join the conversation.
- marec33
- Topic Author
- Offline
- Posts: 6
- Thank you received: 0
Please Log in to join the conversation.
- Dirk
- Offline
- Posts: 1222
- Thank you received: 225
marec33 wrote: 1. Is possible to search in subtemplate(second table), If yes what I have to do? For example I have table publications and table authors using index table with relationship n:m. The main table is publications. When I type author name in searchbox It can't find anything.
Not for a n:m relation because Autors can be related to more than one book.
The next version will have the possibility to choose the fields you want to search in.
Meanwhile you could add a field with the authors names to your table or generate a second Database with your authors.
marec33 wrote: How to change formatting of output from subtemplate? For example In catalog-template I have this: "{joodb subtemplate|author1}{joodb subtemplate|author2} but on output it looks like:
Why "{joodb subtemplate|author1}{joodb subtemplate|author2}?
If you linked the second table correctly you need only on subtemplate. The template will be repeated for every author of the book.
The problem might be the comma. Maybe you can take a List for it.
<ul class="authors">{joodb subtemplate|AUTHORS}<ul>
Make sure that your editor does not change the code an you have only a <li>{joodb field:AUTORNAME}</li> into your subtemplate.
If you do like this you can make a inline-list with a separator using CSS.
#taglist {
display: inline;
list-style: none;
}
#taglist li {
display: inline;
list-style: none;
background: none;
padding: none;
}
#taglist li:after {
content: ", ";
}
#taglist li:last-child:after {
content: ""
}
Please Log in to join the conversation.
- marec33
- Topic Author
- Offline
- Posts: 6
- Thank you received: 0
dirk wrote: Not for a n:m relation because Autors can be related to more than one book.
The next version will have the possibility to choose the fields you want to search in.
Is it possible in current version or when will be new one?
dirk wrote:
Why "{joodb subtemplate|author1}{joodb subtemplate|author2}?
If you linked the second table correctly you need only on subtemplate. The template will be repeated for every author of the book.
Here is my problem... in index table I have column id_author which is linked to id_author in table authors. If I have just one number (001) in it everything works fine but if I add more numbers (001 002 003) or (001,002,003) it doesn't works. I understand why, but I can't find solution how to make it work. Do I need to add somewhere in code that (,) is separator or something like this? Or exists some better solution?
I'm stucked here for weeks and I have very little time now. So please could you please give me fast answer? :) Thank you very much
Please Log in to join the conversation.
- joest
- Offline
The forum is your platform to help each other (we do read your posts and will help and answer every now an then. Remember - no direct support for the free version).
Please Log in to join the conversation.
- marec33
- Topic Author
- Offline
- Posts: 6
- Thank you received: 0
dirk wrote: Not for a n:m relation because Autors can be related to more than one book.
The next version will have the possibility to choose the fields you want to search in.
Is it possible now? If yes, how?
Thank you for all your help. You helped me a lot with my bachelor thesis.
Please Log in to join the conversation.