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.
Post Reply
kathryngz
Propeller Head
Posts: 75
Joined: Wed May 14, 2014 11:31 am

Best way to display data from one source in multiple topics

Post by kathryngz »

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
chrisj
Propeller Head
Posts: 87
Joined: Thu Jun 26, 2014 8:08 am
Location: Omaha, NE

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

Post by chrisj »

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
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

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

Post by doc_guy »

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.
Paul Pehrson
My Blog

Image
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

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

Post by doc_guy »

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.
Paul Pehrson
My Blog

Image
kathryngz
Propeller Head
Posts: 75
Joined: Wed May 14, 2014 11:31 am

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

Post by kathryngz »

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
chrisj
Propeller Head
Posts: 87
Joined: Thu Jun 26, 2014 8:08 am
Location: Omaha, NE

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

Post by chrisj »

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/C ... g_Home.htm
Chris Jones
Product Content Manager - TEAM Software
Image
kathryngz
Propeller Head
Posts: 75
Joined: Wed May 14, 2014 11:31 am

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

Post by kathryngz »

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
chrisj
Propeller Head
Posts: 87
Joined: Thu Jun 26, 2014 8:08 am
Location: Omaha, NE

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

Post by chrisj »

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
kathryngz
Propeller Head
Posts: 75
Joined: Wed May 14, 2014 11:31 am

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

Post by kathryngz »

Yes, I'd love to attend the webinar! I look forward to more information. And thanks for sharing the code!
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

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

Post by doc_guy »

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.
Paul Pehrson
My Blog

Image
kathryngz
Propeller Head
Posts: 75
Joined: Wed May 14, 2014 11:31 am

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

Post by kathryngz »

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: 75
Joined: Wed May 14, 2014 11:31 am

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

Post by kathryngz »

Chris, I just wanted to check back with you about getting copies of your Flare files. I understood from the webinar that they would be sent out to viewers, but I haven't seen them. Do you know if they've been sent out yet?

I'm eager to see them because they will help me make a huge improvement on my site :)

Thanks again! Your webinar was one of the most helpful I've ever seen.

Kathryn
Tavia_Pennington
Jr. Propeller Head
Posts: 4
Joined: Mon Jun 10, 2019 11:35 am
Location: Ohio

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

Post by Tavia_Pennington »

Chris, this is also exactly what I'm looking for. Would you be willing to send me a link to your recorded webinar and/or the code you sent Kathryn?

Tavia Pennington
Tavia Pennington
Technical Writer
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

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

Post by Nita Beck »

Tavia_Pennington wrote:Chris, this is also exactly what I'm looking for. Would you be willing to send me a link to your recorded webinar and/or the code you sent Kathryn?
Welcome to the forums! :)

MadCap’s recorded webinars (along with assets such as slides and demo projects, where applicable) can be found on MadCap’s website, starting here: https://www.madcapsoftware.com/resource ... inars.aspx.

Or try Googling (ugh) “MadCap recorded webinars Chris Jones”.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
kathryngz
Propeller Head
Posts: 75
Joined: Wed May 14, 2014 11:31 am

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

Post by kathryngz »

Nita, thanks for posting the link to the webinar recordings! It's good to have the webinar and slide deck link. But I'm not seeing any code or Flare project I can download. Did I miss it?

If not... Chris, is there still a chance you can share your code with us? If you ran into issues about sharing it (maybe your company considers it proprietary), could we ask you questions as we try to figure things out, based on your webinar?

Thanks again!

Kathryn
Post Reply