export imagelist type of assets

20 views
Skip to first unread message

alexey.v...@gmail.com

unread,
Nov 22, 2016, 6:40:40 PM11/22/16
to Google Web Designer beta
Hello,

I'm trying to create a component for gwd: a slideshow type of thing. I define img attribute as:
```
{
"name":"imgs",
"label": "Images",
"type": "imagelist",
"gwdSpecific": {
"type": "imagelist"
}
}
```
It works fine - I have image list pickup component, but images are not exported for preview/publish.

If I add { "asset": true } attribute then only first image is exported.

What makes the magic in my case?

PS: This is what I'm talking about: https://github.com/alexvish/gwd-alexvish-slideshow-panzoom ; build with npm install && npm run build

alexey.v...@gmail.com

unread,
Nov 24, 2016, 6:33:46 PM11/24/16
to Google Web Designer beta
Found solution.
tl;dr;
Name of attribute is important: renamed attribute from "imgs" to "images", and added asset:true. Here is attribute definition:
```
{
"name":"images",
"asset": true,
"label": "Images",
"type": "imagelist",
"gwdSpecific": {
"type": "imagelist"
}
}
```

------------

What I need is functionality similar to Swipable Gallery, 360° Gallery or Carousel Gallery: an attribute that contains comma-separated list of images.

When attribute definition contains type: imagelist and/or gwdSpecific.type: imagelist, GWD will provide this image pickup component, as an editor to this attribute.

asset: true - marks attribute that contain asset definition: assets are exported (basically moved + reference in attribute changed) on preview/publish

And if you have imagelist type of attribute your attribute should be named either of: "src","sources","images","source","poster" (my theory), so that you will have multiple images exported, not just one.


Advice to gwd component creators:

0. You should not have started to gwd component
1. Start with reading documentation: that will provide basics
2. Search through this forum
3. There are tons of minified javascript code in $HOME directory (c:\Users\<yourname>\AppData\Local\Google): grep through it.
4. goto 0

- Alexey
Reply all
Reply to author
Forward
0 new messages