graphxks VIP
Total posts: 68
11 Июнь 2014 15:32

I'm building a site where individual assets (locations) have small thumbnail images attached to display things about that asset (restrooms, handicapped accessible, etc.)

I'd like to do a SQL Source statement that shows the icon image with the selection in the entry form, and then displays it on the article page.

Any ideas?

Thank you!

Последние изменения: 13 Июнь 2014


graphxks VIP
Total posts: 68
11 Июнь 2014 15:33

See for reference what I mean: Screen Shot 2014-06-11 at 11.29.12 AM


Sergey
Total posts: 13,748
12 Июнь 2014 01:32

What is your source table? Please show how it stores the data. There is the name and where is the picture name and so on.


graphxks VIP
Total posts: 68
12 Июнь 2014 02:25

Hi Sergey, thanks for your response.

Things displayed as icons are attractions, activities and amenities and each have their own type (see below).

Screen Shot 2014-06-11 at 10.09.09 PM

These types have an Icon field (see below).

Screen Shot 2014-06-11 at 10.09.24 PM

With these, I'm using SQL Source queries to add to the Asset creation form via multi-select, check box, etc. (see below).

Screen Shot 2014-06-11 at 10.12.39 PM

Now it looks like the selections from above are stored in "js_res_record" in the "fields" column as a combo of the record_id and text name {"5":"Spring","6":"Summer"} etc. (see below).

Screen Shot 2014-06-11 at 10.15.24 PM

But the actual images (links) are in "js_res_files". This also seems to include the same record_id as above.

Screen Shot 2014-06-11 at 10.25.13 PM

So what I THINK is needed is some kind of join request from the database that lets me pull and display the appropriate icon file from "js_res_files" whenever that icon's record_id is in the asset that is being displayed in an article.

Make sense?


Sergey
Total posts: 13,748
12 Июнь 2014 04:51

Yes, this make sence. And yes you need concatination and join request if you continue with SQL source.

But you also can use relation field parent/child. It will be easy to attach artilces from other section. Also control how it looks with custom template.

But if you want to continue with SQL query, please show me your query now and I'll try to advaice how to improve it.


graphxks VIP
Total posts: 68
12 Июнь 2014 11:37

Hi Sergey,

I guess I don't understand how parent/child works. Is there documentation about it?

In this case, the items with the icons (attractions, activities, amenities) are a set group determined by the site managers who then assign them to individual locations. They are displayed to, but never edited by, the site viewers.

If Parent/Child will work without reinventing the wheel I'm all for it!


Sergey
Total posts: 13,748
12 Июнь 2014 13:35

graphxks If Parent/Child will work without reinventing the wheel I'm all for it!

Actualy it should. But I cannot say for sure because I still do not understand vy you store attraction names as a separate articles. Only to attach Icon or you have description and people can browse through attractions.


pepperstreet VIP
Total posts: 3,837
12 Июнь 2014 14:11

Sergey But you also can use relation field parent/child. It will be easy to attach artilces from other section. Also control how it looks with custom template.

I was about to suggest the same solution ;) I would choose the parent/child route... because you can reach the same goal by configuration (and templates).


graphxks VIP
Total posts: 68
13 Июнь 2014 13:28

Sergey. Yes, attractions have additional data (description, etc.) attached to them.

Работает на Cobalt