DIVs for a newbie

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
CopperCarla
Jr. Propeller Head
Posts: 8
Joined: Tue Jun 11, 2013 1:06 pm
Location: Vernon Hills, Illinois

DIVs for a newbie

Post by CopperCarla »

I'm working on my first Flare project. Nothing big... just converting a 1300-page programming guide from Frame. :-D It's a manual process and not an import because I'm doing some restructuring of content from a decade-old design.

Example of a topic file:

Title
  • overall description


Setvar
  • setvar description
    table of setvar parameters

Getvar
  • getvar description
    table of getvar parameters

Notes
  • any notes needed for this command

Supported Devices
  • device 1
    device n+

Related Commands
  • related command 1
    related command n+

Reference Links
  • snippet (they all reference the same two topics at this time

Tags
  • 1 or more tags


I've set up DIVs on the sections as follows:
  • div.title
    div.setvar
    div.getvar
    div.notes
    div.devices
    div.related_commands
    div.reference
    div.tags
Would you consider it sensible to use DIVs even though I have no immediate plans for them yet? As I become more experienced, I may get more creative with the output. I'm currently using the default Flare template, rebranded in our coloring with our logos and a few other minor tweeks. I set up a template file to SaveAs for new commands so all the placeholders and tags are in place, and then copy and paste from Frame.

What are the benefits and/or drawbacks of setting it up this way?
whunter
Sr. Propeller Head
Posts: 429
Joined: Thu Mar 12, 2009 4:49 pm
Location: Portland, OR

Re: DIVs for a newbie

Post by whunter »

I believe that Word output doesn't recognize DIVs, so that could potentially be an issue. But if you are going straight to PDF it's not a problem.

Other than that I'm not aware of any issues. It seems like it may be a bit of overkill to DIV every section, but if you have a template already set up with the sections, then I guess why not? (Maybe someone else will have a thought here.)

I guess it's more that I'm having trouble thinking of why I would want each section in a DIV. For example:
If I want to condition out content by section then a DIV would be useful.
If I want to float content around the page (like float the related commands up in a box in the top right) then a DIV would be useful.
If I want to put background colors or borders around whole sections then a DIV would be useful.

But otherwise if I don't want to do those kinds of things then I wouldn't do it. But there might be other benefits I'm not thinking of. Basically I just wanted to communicate the first sentence and then I felt like I needed to say something else. :)
CopperCarla
Jr. Propeller Head
Posts: 8
Joined: Tue Jun 11, 2013 1:06 pm
Location: Vernon Hills, Illinois

Re: DIVs for a newbie

Post by CopperCarla »

Not outputting to Word, so that's not a consideration.

I'm just scratching the surface of even knowing what I can do with DIVs, but it seemed like a good idea to plan ahead.

What I did was create a template file with all the sections layed out (and DIVed), and then copied and pasted the old content into new topics created from the template file. I only had to create the DIVs once in the template file, so there's no extra work on my part.

In thinking about this last night, I can picture a scenario where I put the div.setvar and div.getar in side-by-side presentation (two columns), without having to use a table. Or maybe your borders (Micros*ft makes their commands look like notecards... [example on MS site: http://goo.gl/9lwqd] is done with a DIV). I don't know how to set up stylesheets in Flare to do that yet, but I know it can be done.

I know enough to be dangerous, but I also know enough to know that I need to know more. Having been a poweruser of Frame for <cough, cough> two decades (since FM 2.0), it's humbling not to be the expert and know all the nuances and neat things you can make the software do. :lol:

-Carla
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: DIVs for a newbie

Post by LTinker68 »

There are several advantages to using DIVs.

1. You can style each DIV differently, so you can have text in one DIV one color, another DIV set to bold its text, etc. The styling is from the CSS, so it's all automatic and you're consistent in your appearance.

2. Since Word output isn't a consideration, then you can use DIVs to control your page layout and have DIVs behave one way in online output and another in print. So you can have DIVs appear side-by-side in online output, but have them positioned vertically in print output, or vice versa. Although you might want to test that for PDF output. It seems like I had problems with floating DIVs in PDF output, but it might work better with absolute/relative positioned DIVs instead of using the float attribute.

3. For online output, if you're using reveal effects (e.g., togglers), it's easier to apply the effect to a DIV that contains paragraphs, lists, tables, etc., instead of the individual paragraphs, lists, tables, etc.

4. Also for online output, you can use your own JavaScript or jQuery code for more advanced effects, although a lot of those would require specifying an ID for each DIV, which you couldn't easily do until v9 and the code/design split pane was introduced.

BTW, I would create a snippet file that had all the DIVs you're using with placeholder text and any reveal effects set up. Then insert the snippet into the topic then convert the snippet to text. You now have a topic that has all the DIVs plus reveal effects all ready for you to insert your content.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: DIVs for a newbie

Post by NorthEast »

Generally speaking, putting the content in DIVs is a good idea, as it gives you plenty of flexibility.

For (4), it doesn't really matter too much for scripting whether you use a class name or ID; the main consideration is that if you want to target a particular item in your page, then its class or ID name must be unique on that page.
Post Reply