https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× Welcome to the ToolsJX forum!


View of two tables

  • MaggiW
  • MaggiW's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 2 months ago #2761

Hello,
I purchased AllinOne Tools JX and want to create a view like you describe it.
My two tables are joomgallery and joomgallery_image_details.
At the Joomgallery table are fields like id, imagetitle, imagetext....
and at the joomgallery_image_details Table are id, details_key and details_value
this table looks a litle bit different to the first one:
for example:
The header of the table are:
id, details_Key, details_value
2, Length, 35
2, Width, 20
2, Striae, 12
3, Length, 25
3, Width, 22
3, Striae, 2
....

Both are connected by the fields ID.
What I tried is this text but I got an error 1060.

CREATE VIEW TestView AS
SELECT *FROM joomgallery t1, joomgallery_image_details t2

WHERE t1.ID = t2.ID

2.
From the "Joomgallery" table I create a table with imagetitle and imagetext.
So I want to link the field imagetitle from the table to the detail page of the joomgallery.
I tried it with customId and the text index.php?option=com_joomgallery&view=detail&id=@ID
but I got an error.

3.
I create a table with articels.
But now at the table are all articles shown. I want only articles of a specific categorie called "Diatomeen Steckbriefe" inkl. all subcategories should be shown.


Did anyone have an idea what I do wrong or can help?
Or how can I solve this.
Thanks

Last edit: 10 years 2 months ago by MaggiW. Reason: one more function to ask

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

More
10 years 2 months ago #2767

Hi,

I must say, you did not find yourself the easiest examples...

1. (not tested)

CREATE VIEW vMyImages AS
SELECT jg.*, dl.details_value AS Length, 
dw.details_value AS Width, ds.details_value AS Striae
FROM joomgallery AS jg
INNER JOIN joomgallery_image_details AS dl ON jg.id = dl.id AND dl.details_Key = 'Length'
INNER JOIN joomgallery_image_details AS dw ON jg.id = dw.id AND dw.details_Key = 'Width'
INNER JOIN joomgallery_image_details AS ds ON jg.id = ds.id AND ds.details_Key = 'Striae'

2.

If index.php?option=com_joomgallery&view=detail&id=@ID is the right link to open detail image and if you have selected id as the "Link Column", this should work. What kind of error are you getting? Could you post the error message?

3. You should use similar approach here as in 1. By creating a view and adding some joins to the articles and categories tables, you can get articles from a limited levels of subcategories.

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

  • MaggiW
  • MaggiW's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #2768

Hello,
thank you for your answer.
Yes, perhaps I was somewhat too naive, but I thought it would be a little bit easier to solve this...
1.
I tested it and got a result with 0 entries. No error message.
If I select the view with the fields at tablejx also empty.
Only if I create a view at the database their is an error message at the backend:
Warning: mysqli_close() [function.mysqli-close]: Couldn't fetch mysqli in /www/htdocs/.../.../libraries/joomla/database/driver/mysqli.php on line 210
But I asked my provider at this time.

2.
Thanks alot now it works.....
I selected a wrong column before.

3.
Ok, if I cannot solve 1., so I think I should not solve this point at the moment ....


Thanks you for your time and help...

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

  • MaggiW
  • MaggiW's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #2789

Hello,
so I found a friend he has coded a solution that work for one table.
But one question I have about the link function.
At the table one column will be shown (title) and this will be linked. This are different article of joomla.
For a correct link I use the "cid" for the link column and as the link column type I select
1. URL
2. Article ID
If I choose 1. the correct site will be shown with the whole breadcrumbs /Home/Steckbriefe/....) but the site would be shown as a content (Article) of the Homepage, all modules of the Homepage (Homesite) are shown right and left of the article. The modules are only selected for the home-Site and would not visible at another site (menu assignment only home marked)

If I choose 2. the article will be shown as a own site but the breadcrumbs will not be shown, only home is visible.

Do you have a idea?
Regards
Maggi

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

More
10 years 1 month ago #2793

The modules are shown depending on which menu item has been clicked. Joomla knows this by a GET parameter called Itemid. If you added &Itemid=15 to the urls of all your links in the table (15 is the id of the menu item) the modules should appear as the would appear if you clicked on the menu item with id 15.

You can do this once for all by using the custom ID link option

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

  • MaggiW
  • MaggiW's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #2795

Thank you for your answer, but I am sorry I didnot understand it correct what I have to config.....
What I have is a view of articles (Joomla content) from two different categories with subcategories.
The view has follow columns: cid, catid, kid, parent_id, k_title, path and title.
Only the Title Column is selected to show this a the table (Title = the name of the article).
This Name (title) should be linked to the article itself. So it is possible to link the title to the article, that also the breadcrumbs show the right navigation? How can I solve this when I use the customID link option?
Thank you for your help.
Regards
Maggi

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

Moderators: tomaz
Time to create page: 0.216 seconds

Contact Us

Contact us on Discord

Contact us on Facebook