Best way to display data from one source in multiple topics

This forum is for all Flare issues not related to any of the other categories.

Best way to display data from one source in multiple topics

Postby kathryngz on Wed Feb 13, 2019 6:01 pm

Hi all,

I'm seeking advice on the best way to display data from a single source in multiple topics.

Here's my scenario. I have a list of of presentations that I need to display in several topic pages on a website. For example, on one of the pages I want to display the whole list and allow users to sort and filter it. On another page, I want to display information for only one presentation.

I've done this type of thing before using PHP/MySQL or XML/XSLT, but I'm trying to determine the best way to do it in Flare. I'm just not sure what's possible or feasible. I'd like to keep it simple and maintainable.

Here are the things I'm considering:

  • Put the data in an XML file and format it with Javascript or XSL.
  • Put the data in a JSON file and format it with Javascript (I did this before in Flare, and frankly, working with the JSON file was a bit of a pain).
  • Put the data in a MySQL database and use PHP or nodejs to pull the data into Flare topics. What would my best options be here? I've never tried using either in Flare.
  • Could I put the data in a snippet and use some native Flare function to pull part or all of the data into a Flare topic and allow users to sort and filter the data? I don't know of anything, but thought I'd ask.

What have you tried? What worked, what didn't? What would you recommend?

Thanks in advance!

Kathryn
kathryngz
Propeller Head
 
Posts: 57
Joined: Wed May 14, 2014 11:31 am

Re: Best way to display data from one source in multiple top

Postby chrisj on Thu Feb 14, 2019 10:24 am

Look into Snippet conditions. That's the solution built into Flare to handle this kind of scenario.
Chris Jones
Product Content Manager - TEAM Software
Image
chrisj
Propeller Head
 
Posts: 74
Joined: Thu Jun 26, 2014 8:08 am
Location: Omaha, NE

Re: Best way to display data from one source in multiple top

Postby doc_guy on Wed Feb 20, 2019 12:07 pm

Like Chrisj suggested, Snippet Conditions are the solution you're looking for, if you want a native-Flare solution.

Here's how snippet conditions work:
  • You create a new condition tag set in your project. I call mine "Snippet conditions" so I remember to never set any of these conditions in targets.
  • You create conditions for the various ways you want your snippet to appear in different topics.
  • You create your snippet, and apply the conditions from the snippet conditions condition tag set.
  • You import your snippet into the first topic, then right-click on the snippet and go down to "Snippet Conditions"
  • You exclude the conditions that don't apply to this topic. You don't need to mark any for "include" because as long as it's not excluded, it is automatically included.
  • Now you import your snippet into a second topic, then repeat the procedure, but excluding content that doesn't apply to this topic.

Remember: NEVER set include/exclude conditions on your snippet condition tag set in any target. Snippet conditions should always be left alone in targets.

Also, that note above about not needing to apply the "include" because it is automatically included. You need to remember that INCLUDE overrides EXCLUDE, so you only need to use the INCLUDE flag if there is a time when something is being excluded inappropriately. Content is included by default. So just mark the conditions for the items that you want to exclude from the individual topics, and you'll be fine.

Hope this helps you get started. Snippet conditions are a powerful single sourcing feature in Flare. They are hard to explain to a new user, because it is hard to find abstract examples of how they are useful. But when you finally get into a situation where you say "this snippet is almost exactly what I need in two places, but needs to be slightly different", then you can really see the power of snippet conditions in your project.

Let me know if you have any questions, or if the steps aren't clear.
User avatar
doc_guy
Propellus Maximus
 
Posts: 1895
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West

Re: Best way to display data from one source in multiple top

Postby doc_guy on Wed Feb 20, 2019 12:08 pm

By the way, Hi Kathryn! I didn't realize this original post was from you! Email me if you need help with this. I'd be happy to get on a call and help you understand how this works.
User avatar
doc_guy
Propellus Maximus
 
Posts: 1895
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West

Re: Best way to display data from one source in multiple top

Postby kathryngz on Tue May 14, 2019 1:48 pm

Chris and Paul, thanks for your replies! Somehow I missed the notifications that anyone had responded to my post. Just saw your answers today.

I have used snippet conditions before, and I agree, they're great! I can see how I could use them in several scenarios, since you mentioned it :)

But I'm not sure how to make them do what I want in two cases. I don't think I gave enough detail in my original post, so here's a little more. Then you'll be able to tell me if what I want to do is possible.

I give family history webinars regularly, one or two a month. So I have an ever growing list. Here's an abstracted example of my data:

English Research: Using the GRO Site to Find Missing Children
[Description of presentation]
15 January 2019

English Research: Using the FreeReg Parish Register Site
[Description of presentation]
30 January 2019

The Timeline Grid: An Easy Way to Track and Organize Your Research
[Description of presentation]
15 February 2019

Reason Statements in Family Tree
[Description of presentation]
25 February 2019


1. I don't want to hassle with keeping my presentation list in alpha order. But on one page on my site, I want to display presentations in alpha order by the title. On another site, I want them grouped by topic (my actual data has keywords for each presentation), then alpha within topic. How could I do that?

2. I also want to give the user the ability to sort and filter the list. On other web sites, I've used PHP to pull data from a MySQL database and put it in a table. Then I've used tablesorter.js to allow dynamic sorting by columns (see demo here: https://mottie.github.io/tablesorter/). Also, I've used a filtering widget (can't remember the name off the top of my head) but it places a box above the table. When the user types text in the box, the list is filtered accordingly. Can I do that somehow with snippets, snippet conditions, and/or variables?

Paul, I just found your webinar on "Taking Snippets to the Next Level," so I'm going to watch that now :) But if you have any advice to share here, I'd welcome it!

Thanks again--

Kathryn
kathryngz
Propeller Head
 
Posts: 57
Joined: Wed May 14, 2014 11:31 am

Re: Best way to display data from one source in multiple top

Postby chrisj on Tue May 14, 2019 2:07 pm

If I understand what you are asking, it would be possible using conditions (or really any form of metadata you prefer) and a bit of javascript. For example, I've created a dynamic course catalog in my current project where users can filter by topic, or run a "search" for a topic. The search is essentially just a character filter on H1s, and the filters are filtering out by condition. I'm certain you could find an easy and usable alpha script if you wanted to be able to sort alphabetically. I think I maybe even had that in my original design but scrapped it.

For reference, here is a link to the catalog I built. http://help.teamsoftware.com/Training/Catalog/Catalog_Home.htm
Chris Jones
Product Content Manager - TEAM Software
Image
chrisj
Propeller Head
 
Posts: 74
Joined: Thu Jun 26, 2014 8:08 am
Location: Omaha, NE

Re: Best way to display data from one source in multiple top

Postby kathryngz on Wed May 15, 2019 9:17 am

Chris,

WOW!!! That is beautiful and exactly what I'm looking for! I have some questions, but is there a chance you'd be able/willing to share your code? I understand if not, as it may be considered proprietary. But seeing the code would probably answer most of my questions.

Thanks again! I am super impressed.

Kathryn
kathryngz
Propeller Head
 
Posts: 57
Joined: Wed May 14, 2014 11:31 am

Re: Best way to display data from one source in multiple top

Postby chrisj on Wed May 15, 2019 9:20 am

kathryngz wrote:Chris,

WOW!!! That is beautiful and exactly what I'm looking for! I have some questions, but is there a chance you'd be able/willing to share your code? I understand if not, as it may be considered proprietary. But seeing the code would probably answer most of my questions.

Thanks again! I am super impressed.

Kathryn


I wouldn't mind sharing at all. It's obviously written for my project, so you would have to tweak it some. I'm actually getting ready to demo this (and some other things) in a Webinar in... 40 minutes if you are interested. I'll send you a direct message a bit later with some more specifics on the code.
Chris Jones
Product Content Manager - TEAM Software
Image
chrisj
Propeller Head
 
Posts: 74
Joined: Thu Jun 26, 2014 8:08 am
Location: Omaha, NE

Re: Best way to display data from one source in multiple top

Postby kathryngz on Wed May 15, 2019 9:43 am

Yes, I'd love to attend the webinar! I look forward to more information. And thanks for sharing the code!
kathryngz
Propeller Head
 
Posts: 57
Joined: Wed May 14, 2014 11:31 am

Re: Best way to display data from one source in multiple top

Postby doc_guy on Wed May 15, 2019 9:46 am

Chris,

Sounds like really cool code.

Kathryn,

No, Flare doesn't do this natively, as you've discovered. You'd need something like Chris's code to make this work. Tables and table sorting/filtering is where my mind went. I also use the table sorter jquery. I haven't seen the table filter jquery. That might be interesting for some of our longer tables.
User avatar
doc_guy
Propellus Maximus
 
Posts: 1895
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West

Re: Best way to display data from one source in multiple top

Postby kathryngz on Wed May 15, 2019 11:11 am

Chris, that webinar was fantastic. I can't believe what a perfect fit the information is for my current job. I'm even using Captivate to create e-learning (I got my master's degree in instructional design, but I've been a tech writer for the last 20 years, so I wear both hats).

It sounds like the code will be sent out with the webinar recording link, so I'll watch for it there. Thanks again!
kathryngz
Propeller Head
 
Posts: 57
Joined: Wed May 14, 2014 11:31 am


Return to Flare's General Discussion

Who is online

Users browsing this forum: No registered users and 5 guests