× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

subtable search, formatting

More
11 years 1 week ago - 10 years 11 months ago #1733 by marec33
subtable search, formatting was created by marec33
Hi,

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
Last edit: 10 years 11 months ago by joest.

Please Log in to join the conversation.

More
10 years 11 months ago #1754 by marec33
Replied by marec33 on topic Re: subtable search, formatting
Can I get answer please? I'm stuck here for 2 weeks.

Please Log in to join the conversation.

More
10 years 11 months ago #1755 by Dirk
Replied by Dirk on topic Re: subtable search, formatting

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: ""
}
The following user(s) said Thank You: marec33

Please Log in to join the conversation.

More
10 years 10 months ago #1856 by marec33
Replied by marec33 on topic Re: subtable search, formatting

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.

More
10 years 10 months ago #1887 by joest
Replied by joest on topic Re: subtable search, formatting
joodb.feenders.de/support.html
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.

More
10 years 10 months ago #1888 by marec33
Replied by marec33 on topic Re: subtable search, formatting
OK, I understand :) I have one last question:

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.

Moderators: Dirkjoest