Loading...
 
Features / Usability

Features / Usability


Some problems understanding the syntax to access two trackers at the same time

posts: 210

This is not a bug report, merely, I did not quite grasp the concepts that CART utilizes to access trackers.

I want to establish -besides CART that successfully contains a small product shop- something to contain a database of magazines. It shall show magazine covers, and some table of contents. To reach that goal I copied the concept of CART.

I established two new trackers. One to contain every issue of the magazine, and a second to contain a table of content like listing of articles of all magazines. The two are interconnected via a text field containing the edition number (in the articles tracker defined as an element link) pointing to the text in the first tracker.

The data structure (that currently contains some demo elements) works well in looking at the tracker with list_trackers & view_tracker. Also, the first level (which is very close to what CART does on the product tracker) works well, too:

Copy to clipboard
code extracted #1


What I cannot get to run is that clicking on an edition shall open that edition. This itself works, just like in CART, but I want that listing to contain the data from tracker #4 where the edition field contains the id of the selected edition. I did not quite get the concept how to access that.

This code partially works:

Copy to clipboard
code extracted #2


Partially meaning: Cover & Edition & Year come correctly from tracker #3. From tracker #4 ONE result of column/title/subtitle gets selected. And I get way to many pages (one per record in tracker 4...). Currently, with my test data, there are 2 elements in magazine and 59 in articles (describing 59 articles in the 2 magazines).

What I would like to accomplish is to list every article from tracker #4, from the magazine selected.

Thanks
hman

posts: 210
Looks like I am unlucky in my efforts to escape the code samples with CODE-clauses. tiki.org obviously tries (and fails) to execute some of that code. Sorry... Will have to extract and save as attachment...

posts: 210
extract #1

posts: 210
Cannot attach files to my replies! I select the file, click on Post, and then comes an error message "a temporary folder was missing"...

posts: 8633 Israel

Sorry if I didn't understand you correctly because this is quite confusing...

I understand you have a trackerA with magazines and a trackerB with articles.
They have a relation via a text field, let's call it linkField.
You want to be able to displays items from TrackerA, then be able to display the list of the related items from trackerB.

Assuming this is correct, you can use a plugin List to display results within the trackerA items (magazine) and IN the template you can embedded a second plugin List that will use the value of the linkField from trackerA as a filter of the items of trackerB.

You can't have plugin list embedded at the same level, you need to call the arguments in a different template (you can cascade how many you want - I think).

hope this helps

posts: 210
Bernard Sfez / Tiki Specialist wrote:
Sorry if I didn't understand you correctly because this is quite confusing...


Sorry, I still cannot attach the code samples to illustrate this. So let's try to describe the task by laying out the data model in a simplified demonstration to show the concept. The data model itself works with tracker_adminview and tracker-view.

First tracker contains

EditionYear of publicationNo. of pages
1234202268
1211202148


Second tracker contains

ColumnTitleSubtitleEdition
PoliticsSummary of Government BThe first term at a glance1234
PoliticsDetails of law XYZRisks and Chances1234
MiscConcert scheduleConcerts in August1234
PoliticsSummary of Government AThe first term at a glance1211


Goal is that at entry level, all magazines from tracker #1 get listed with cover and edition. This is already achieved with a derivative from CART. Done.
Second goal: When clicking on a specific edition, user shall be presented the details of that edition. This is only partly achieved. The derivative of CART shows a larger cover image and the edtion. DONE.
What is missing is a listing of all articles from that selected magazine. CART has a second Wiki page for that, which calls a second template. What I can't achieve at the moment is getting the listing of all magazine articles from the selected magazine inside this one Wiki page (and template).

So in the above scenario:
Entry level shall show two magazines. DONE.

Detail level shall, when a magazine was clicked, show details and a listing containing three entries when edition 1234 was clicked, and one entry, when 1211 was clicked. As the details view from CART (product-item) has a dialog to directly jump to other entries (pagination numbers automatically embedded below the content) that shall only give two entries, as there are two magazine editions.

Currently I can only get ONE article entry, not all, but I get 59 pagination numbers below the content (there are 59 magazine articles in my test DB at the moment). So in the above example I would get 4 instead of 2.

posts: 8633 Israel

I don't know what you call CART (profile, plugin ?)

hman wrote:
Goal is that at entry level, all magazines from tracker #1 get listed with cover and edition. This is already achieved with a derivative from CART. Done.

hman wrote:
Second goal: When clicking on a specific edition, user shall be presented the details of that edition. This is only partly achieved. The derivative of CART shows a larger cover image and the edtion. DONE.

hman wrote:
What is missing is a listing of all articles from that selected magazine.


I think I understood correctly then.
In your template (displaying results from the Magazine tracker) you need add a wikiplugin List to filter all the items from tracker articles with the same magazine number. (we call it plugin list embedding)

hman wrote:
Currently I can only get ONE article entry, not all, but I get 59 pagination numbers below the content (there are 59 magazine articles in my test DB at the moment). So in the above example I would get 4 instead of 2.


You may have bug or other issue there...

I tried, but I'm not sure it is possible to solve this quickly using only the forum.

You may need to hire a consultants or a tiki freelance to help you with that.

posts: 210
Bernard Sfez / Tiki Specialist wrote:

I don't know what you call CART (profile, plugin ?)}
{/QUOTE}
Cart, Tiki's offical shop profile...

I tried, but I'm not sure it is possible to solve this quickly using only the forum.
{/QUOTE}

Maybe it becomes clearer when I can attach code samples, but currently, some bug (or misconfiguration) of tiki.org prevents attaching file ("a temporary directory is missing").


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting