Google Fusion Table Mapping Help! - Custom Info Window using Closure Templates - google-fusion-tables

First, some background:
I'm working with mapping from Google Fusion Tables and I'm trying to customize the info window using Dynamic Templating, which uses Closure Templates. I'm editing the window from the Configure Map area of my Fusion Table. I'm new to coding and I studied the HOWTO regarding Dynamic Templating here: Tip: Use dynamic templating
The problems:
However when I try to use an example from the HOWTO and adapt it to my own data I am having issues with some data not displaying despite using the correct column name, and I have no idea how to skip blank cells being displayed.
My Objective:
I'm mapping hospitals and nursing homes in the US. My fusion table has some columns that have data which is specific to a hospital and some which is specific to a nursing home in other columns. I just want my info window to display the appropriate data per facility type, which is one of my columns btw.
My Questions:
Am I right to use Closure Templates to customize the data shown in my info windows?
If so, can I specify which columns' data displays in the info window depending upon the facility type?
Hopefully, I've been clear enough for someone to understand what I'm doing/seeing here.

The dynamic templates are the correct choice.
Sample(modify the column-names and facility-types depending on the values used in your table):
{template .contents}
<div>
{if $data.value['facility type'] == 'hospital'}
{$data.value['name of desired column']}
{/if}
{if $data.value['facility type'] == 'nursery home'}
{$data.value['name of another desired column']}
{/if}
</div>
{/template}
so the basic syntax is:
{if $data.value['name of column which should match the condition'] == 'specific value'}
{$data.value['name of column whose value should be printed']}
{/if}

Related

Is it possible to overwrite the Standard Variant in SmartVariantManagement?

I created a smart table using the columns provided by OData service and the corresponding metadata. I also added the smart variant management to the smart table by setting the properties useVariantManagement, useTablePersonalisation and persistencyKey. I can now see the variant management control and create new variants. So far so good.
However, since there is no way to define the column width in the annotation file for the OData service (or is there?), the columns have a predefined width in the standard variant. Therefore, I am resizing the column widths in the afterRendering event of the smart table to consider the length of the data provided by the OData service. The problem I now face is that by resizing the columns, I am adjusting the standard variant and am therefore getting a modified flag (so it says Standard*).
I can see that it is not possible to adjust or delete the standard variant in the frontend but is there any way to save the new layout as the standard variant in the backend?
You can overwrite column widths client side in the XML:
<smartTable:SmartTable entitySet="Setname" ...>
<t:Table alternateRowColors="true" visibleRowCountMode="Auto" selectionMode="MultiToggle">
<t:columns>
<t:Column width="5em" sortProperty="Columnname" filterProperty="Columnname" app:p13nData='\{"columnKey": "Columnname", "leadingProperty": "Columnname"}'>
<t:template>
<Text text="{Columnname}"/>
</t:template>
<Label text="{/#Setname/Columnname/#sap:label}"/>
</t:Column>
...

Using ADF Web Activity for each row in a Query

Good Day!
I am pretty new to ADF and need some guidance on how to best accomplish using the ADF Web Activity for each record in a query/view. I have a system where we need to add new users daily. I have built a query that returns what users are new and I would like to call a rest API to add their accounts in other systems. Today, I accomplish this in a java program where we get a result set and then iterate through each row and call the API.
I am attempting to replicate this in ADF and running into not understand how to accomplish this. The ForEach activity does not appear to be able to connect to a dataset or query. I have seen other examples of using the ForEach when you are building a parameter list and understand how that would work. (for example: https://learn.microsoft.com/en-us/azure/data-factory/tutorial-bulk-copy-portal.)
Can anyone give me some direction on how you run an activity for each row in a dataset?
I was able to find a way to do this using the Lookup Activity and then passing the output of the lookup to the foreach activity. Here is a my pipeline:
When passing the data from the Lookoup to the ForEach look you wan to set the ForEach items to "#activity('Lookup1').output.value" If you use the 'add dynamic content' selection and pick the output data sent ADF sets the value to #activity('Lookup1').output which will through a weird error about the length function when you run it.
In my research I found this demo to be very helpful: https://www.youtube.com/watch?v=ROq5mVrZPY0

Cofoundry: How do I add a PageBlock inside a PageBlock?

I want to be able to build a site from the design view. Utilising Bootstrap, I want to be able to add rows, add columns to my rows and then add text and images etc. to inside those columns.
I though I could do this by making both "row" and "column" page blocks but if I do this I can't add anything inside the row or column page blocks once they're on the page (as they're not page templates).
The image below shows me adding a Row PageBlock to the introduction section in the Cofoundry CMS BasicTestSite starter theme provided by Cofoundry. But I can only add things below it, not inside it.
I know one option would be to add rows to the PageTemplate, but the limits the CMS to only being able to work with the number of rows on the page template. I want to be able to add rows and columns dynamically without touching code.
PS: I'm new to Cofundry, so apologies if I'm using this terminology incorrectly.
I think you should be able to use Nested Data Models to achevie this, whereby your row data model can have a nested collection of columns. However nested data models aren't associated with a template, and it is up to the container block type to know how to render your model.

How to translate non-page content in Kentico

We recently upgraded our Kentico 8.2 instance to 9.0 and are now focusing on localizing our site into two additional cultures. The textual content of our site is primarily stored in one of three places:
Editable regions
Text fields in custom page types
Custom tables
We're using the Kentico EMS license and would like to leverage the built-in Translation Services app in order to translate content in each of these locations, however it appears that it only supports with content within editable regions. I know Kentico has an input control for translating text boxes but it forces the content editor to create a distinct resource key for it; we simply have so much content I'm concerned this will get out of control for editors.
Additionally, we had considered migrating some of our content into pages but they don't logically fit there, and there are some complex relationships that would cause duplicate content so I'd really prefer to keep the content where it is. The other thought I had was to build either a custom module or custom form control to do some dirty work under the covers but didn't want to reinvent the wheel if there was already a known approach.
Is there a Kentico recommended approach, or workaround, to managing content translations within custom tables and page type fields?
You can use Translation in Kentico to translate page type fields and send them for translation. Check this documentation page for an example. It can be more complex at first, but it should do the trick for you. I have just tested creating a simple translation request for my page type and the resulting XLF file contained all page type fields.
For custom tables I will have to dissapoint you because custom tables in Kentico are not culture specific. If performance is important for you the best way to create translations is to add CultureCode field to your table in order to specify which culture the item is for.
For example you can have table with columns: ItemID, Text, CultureCode
And then the data would look like:
1, Dog, en-US
2, Hund, ge-GE
3, Pes, cs-CZ
If you would want to go even step further I would recommend to create this not as a custom table, but as a Custom class which will sit inside a custom module for which you can create your own interface which would allow editors to easily create all culture versions for the items.
For the custom page types and custom tables, you can change those text fields to localized text fields at the field definition and it will allow you to enter different values per language without a resource key. This is the best route IMHO for page types and custom table translation. Although this still does not allow for "automatic" or built-in translation.
I am not sure what do you mean by content translation in page type fields - there is support for translating page type fields. You can find example on sample site in Kentico installation. (The site is called DancingGoat - see image example for page type field localization in english and spanish language).

Multiple select field in LocomotiveCMS?

I need to set up a field in LocomotiveCMS that is similar to Select but allows multiple selections. Something like in HTML... does LocomotiveCMS allow for that, or will I have to do some ruby coding to get that to work?
Any help would be appreciated, thanks!
Old question but still a thing.
I'm unsure whether your question relates to fields within the Locomotive CMS Back Office or on the front end so I've addressed both below.
Front End
Irrespective of whether or not you're dealing with Locomotive CMS content types, either of the following will allow selection of multiple values on the front end:
Listbox (select element with the multiple attribute)
A series of checkbox inputs with the same value in the name property
Back Office
If you need to allow selection of multiple values within the Back Office, you can do this for content types using the has_many or many_to_many content type relationships.
If you need multiple value selection outside of content types (e.g. in metafields schema) you're unfortunately out of luck.

Resources