Welcome, Guest
Username: Password: Remember me
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
  • Page:
  • 1

TOPIC: Subtemplates

Subtemplates 6 months 6 days ago #4677

  • ciminternet
  • ciminternet's Avatar Topic Author
  • Offline
  • Posts: 8
  • Thank you received: 0
Hi!

I have two linked tables. I wonder if is possible to use two different subtemplates, one for 'catalog-template' and one for 'single entry-template'.

Example:


Table 1:

Id
Name
Id_Country
Other fields ...


Table 2:

Id_Country
Name_Country
Other fields ...



In catalog template, I like to show only name_country field of table 2, but in single-entry catalog, I need all other fields of table 2. So, if I create subtemplate for table2 with all fields, it isn't possible to get only name_country in catalog-template.

Could you helpe me?

Thanks!

Please Log in or Create an account to join the conversation.

Last Edit: by ciminternet.

Subtemplates 6 months 5 days ago #4678

  • dirk
  • dirk's Avatar
  • Offline
  • Posts: 967
  • Karma: 21
  • Thank you received: 170
If you have the pro version you could create a n:1 relation.

country = Id_Country<=>Id_Country
Then you create a subtemplate with {joodb field|Name_Country} as content!

In your maintemplate you write
{joodb subtemplate|country}

See here
HERE

Please Log in or Create an account to join the conversation.

Last Edit: by dirk.

Subtemplates 6 months 5 days ago #4679

  • ciminternet
  • ciminternet's Avatar Topic Author
  • Offline
  • Posts: 8
  • Thank you received: 0
Thanks dirk,

Yes, I have the pro version, a n:1 relation and a subtemplate with country name. All works perfect, but if you read again my post, this is not my question.

I need two different subtemplates of the same relationship table1<=>table2. In catalog view, I only need country name, which is exactly the example you've posted me ... ok!

But, I also need a subtemplate including all fields of the countries table, in single-entry template.

So ... my question is .. could I have two different links for the same two tables, each one having a differente subtemplate definition?

Thanks!

Please Log in or Create an account to join the conversation.

Subtemplates 6 months 5 days ago #4680

  • dirk
  • dirk's Avatar
  • Offline
  • Posts: 967
  • Karma: 21
  • Thank you received: 170

ciminternet wrote: So ... my question is .. could I have two different links for the same two tables, each one having a differente subtemplate definition?


this should work, but remember you must define different names

Please Log in or Create an account to join the conversation.

Subtemplates 6 months 5 days ago #4681

  • ciminternet
  • ciminternet's Avatar Topic Author
  • Offline
  • Posts: 8
  • Thank you received: 0

dirk wrote: this should work, but remember you must define different names


Yes, of course! I'll try it, thanks!

Please Log in or Create an account to join the conversation.

Subtemplates 6 months 4 days ago #4682

  • ciminternet
  • ciminternet's Avatar Topic Author
  • Offline
  • Posts: 8
  • Thank you received: 0
Thanks Dirk, I've tested solution using two links whith the same two tables, and it works perfect, thanks!

I've another question about search. I'm using groupselect option in order to get a dropdown which all posible values, but field is one of the linked tables, and dropdown shows me the id of the field, it's possible to get the value instead of the id?

Thanks!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: dirkjoest