[Pro] Solving disclosure triangle conundrum

To be consistent across site pages, I need to follow the lead of the navigation layout of a non FW blog. This requires using small disclosure triangles for a dropdown page menu.

I’ve been using the method explained by Walt in this thread:

http://freewaytalk.net/thread/view/156760#m_156880

As you can see on my linked page, I’ve tried three options:

Option 1
This achieves right-size triangles, but they aren’t the same shape because ASCII up and down triangles are different shapes

Option 2
This achieves the same shape, but the triangles are way too large (Walt’s method does not allow me to change type size within the “read more” link)

Option 3
This achieves right-sized type and triangles that match each other in shape, but only the triangles, and not the type in front of them, triggers the menu to expand and contract.

Recommendations appreciated!

And if the recommendation actually causes the triangles to rotate (rather than jump from up to down to up) that would match the blog nav action perfectly!

http://www.brockmanfamilyfarming.com/newsite/testpage


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You may want to look into using CSS generated content elements to make the triangles. You use the same fonts, but you can control the size of the triangles independently that way. Here’s an example I made a while ago: http://scripty.walterdavisstudio.com/accordion-with-disclosure-triangles.html

The JavaScript is still needed, because it is used to toggle the CSS class applied to the element when you click on it, but the triangles are added in using CSS trickery, so you don’t have to type them into the page directly. And because they are now independent elements, you can style them completely different than the rest of the type they are appended to.

Walter

On Mar 24, 2015, at 10:32 PM, Peter Laundy email@hidden wrote:

To be consistent across site pages, I need to follow the lead of the navigation layout of a non FW blog. This requires using small disclosure triangles for a dropdown page menu.

I’ve been using the method explained by Walt in this thread:

http://freewaytalk.net/thread/view/156760#m_156880

As you can see on my linked page, I’ve tried three options:

Option 1
This achieves right-size triangles, but they aren’t the same shape because ASCII up and down triangles are different shapes

Option 2
This achieves the same shape, but the triangles are way too large (Walt’s method does not allow me to change type size within the “read more” link)

Option 3
This achieves right-sized type and triangles that match each other in shape, but only the triangles, and not the type in front of them, triggers the menu to expand and contract.

Recommendations appreciated!

And if the recommendation actually causes the triangles to rotate (rather than jump from up to down to up) that would match the blog nav action perfectly!

http://www.brockmanfamilyfarming.com/newsite/testpage


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walt,

I have studied the accordion disclosures method and got that to work in a previous project.

If I understand correctly, you are suggesting I switch over to the accordion triangle disclosure method and adapt it, rather than attempt a mashup of the two methods.

If so, how do I get the triangles to appear after the copy rather than before the copy?. (I never understood what code specified the location of the triangles.)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The triangles are positioned as absolute elements, and so they hang off of the object that they are :after. Look at the CSS for the generated element:

#item1 h2:after {
  content: '▸';
  position: absolute;
  left: 6px;
  top: 0px;
  opacity: 0.5;
  font-size: 20px;
}

If you change left: 6px to right: 6px, that might get you where you want to be. Fiddle with it in a browser, using the Web Inspector so you can live-code it and see the change in your browser. Then sneak that new code into the example, and see how it works for you.

Walter

On Mar 25, 2015, at 12:30 AM, Peter Laundy email@hidden wrote:

Walt,

I have studied the accordion disclosures method and got that to work in a previous project.

If I understand correctly, you are suggesting I switch over to the accordion triangle disclosure method and adapt it, rather than attempt a mashup of the two methods.

If so, how do I get the triangles to appear after the copy rather than before the copy?. (I never understood what code specified the location of the triangles.)


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 25 Mar 2015, 3:35 am, waltd wrote:

You may want to look into using CSS generated content elements to make the triangles. You use the same fonts, but you can control the size of the triangles independently that way. Here’s an example I made a while ago: http://scripty.walterdavisstudio.com/accordion-with-disclosure-triangles.html

This looks really nice!!! Would it be possible to post the related freeway file for having a deeper look and understanding of what is going on there?

Thank you so much,

Chris


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There isn’t one, this was written by hand in a text editor. It was carefully written in such a way that nothing about it could not be built in Freeway, though. I made certain to keep things as Freeway generic as I could (I’ve been reading Freeway-generated source since 1997, it’s kind of burned into me by now).

Walter

On Mar 26, 2015, at 8:19 AM, chrisss email@hidden wrote:

On 25 Mar 2015, 3:35 am, waltd wrote:

You may want to look into using CSS generated content elements to make the triangles. You use the same fonts, but you can control the size of the triangles independently that way. Here’s an example I made a while ago: http://scripty.walterdavisstudio.com/accordion-with-disclosure-triangles.html

This looks really nice!!! Would it be possible to post the related freeway file for having a deeper look and understanding of what is going on there?

Thank you so much,

Chris


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here is a test page showing the approach WaltD suggests. It works to be able to size the triangles independently from the type as I need. Below is a link showing this working.

http://www.brockmanfamilyfarming.com/newsite/testpage-disclose

But a couple of issues emerged.

FIRST ISSUE
As shown, I have two dropdown menus. Their titles (Site Page and Page Section respectively) are different widths, requiring the CSS generated triangle after each to be in a different horizontal absolute position. Therefore, I needed to create two different instances of dropdowns (#PagesNav and #SectionsNav) to specify the correct triangle position for each.

I need to have only one dropdown menu show at a time, and I can’t get this to work. The code provided to be used for this purpose through uncommenting is designed to work when the disclosures are both within the same run of disclosures. But in my case I have two independent runs to position the triangles differently. Uncommenting this code for #PagesNav or #SectionsNav causes one dropdown to disappear properly but not the other. Uncommenting both breaks the basic functionality of #SectionsNav. (In the example included I activated the one-at-a-time code for #PagesNav but not for #SectionsNav.) Is there a tweak to the JavaScript code to use to solve for this problem?

SECOND ISSUE
The dropdown menu behavior I am trying to match window-shades down into position like the “read more” code I started with, but with the approach I show here the dropdown simply appears and disappears. Is there a Javascript alternate I could use to get the window-shade effect and be able to size the triangles separately from the type?

ISSUE THAT NEITHER THE “READ MORE” OR “DISCLOSURE TRIANGLE” APPROACH ADDRESSES
The triangle actually rotates in position in the dropdown menu behavior I am trying to match, rather than jump from up arrow to down arrow. Doing it this way would also allow me to match the isosceles shaped Unicode triangle, which unfortunately is only available pointing down but not up.

Many thanks in advance for your help!

This looks really nice!!! Would it be possible to post the related freeway file for having a deeper look and understanding of what is going on there?

Thank you so much,
Chris

Chris, I can post a FW7 file showing how I made the above. Will do when I get it as resolved as I can.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I will take a deeper look at this later, but for now, I can tell you that the generated content triangles don’t have to be positioned separately for each of their parent lists. You can use a single positioning rule for both of them, because they are positioned relative to their parent. It’s just a matter of making your rule work like this (imagine that these two “list items” are actually children of two different-sized parent lists):

[ parent item one           ]
[ parent item two  ]

These items have a width to them, they also can be styled as being the parent of any positioned children. So your little triangle can have the rule:

position: absolute;
top: 0px;
font-size: 10px;
right: -14px;

And now it hangs off the right of its nearest positioned parent element. It doesn’t matter how large or small that parent is, a child positioned this way will always be 4 pixels to the right of the parent.

[ parent item one           ] >
[ parent item two  ] >

Sorta like that.

Walter

On Mar 30, 2015, at 1:14 AM, Peter Laundy email@hidden wrote:

Here is a test page showing the approach WaltD suggests. It works to be able to size the triangles independently from the type as I need. Below is a link showing this working.

http://www.brockmanfamilyfarming.com/newsite/testpage-disclose

But a couple of issues emerged.

FIRST ISSUE
As shown, I have two dropdown menus. Their titles (Site Page and Page Section respectively) are different widths, requiring the CSS generated triangle after each to be in a different horizontal absolute position. Therefore, I needed to create two different instances of dropdowns (#PagesNav and #SectionsNav) to specify the correct triangle position for each.

I need to have only one dropdown menu show at a time, and I can’t get this to work. The code provided to be used for this purpose through uncommenting is designed to work when the disclosures are both within the same run of disclosures. But in my case I have two independent runs to position the triangles differently. Uncommenting this code for #PagesNav or #SectionsNav causes one dropdown to disappear properly but not the other. Uncommenting both breaks the basic functionality of #SectionsNav. (In the example included I activated the one-at-a-time code for #PagesNav but not for #SectionsNav.) Is there a tweak to the JavaScript code to use to solve for this problem?

SECOND ISSUE
The dropdown menu behavior I am trying to match window-shades down into position like the “read more” code I started with, but with the approach I show here the dropdown simply appears and disappears. Is there a Javascript alternate I could use to get the window-shade effect and be able to size the triangles separately from the type?

ISSUE THAT NEITHER THE “READ MORE” OR “DISCLOSURE TRIANGLE” APPROACH ADDRESSES
The triangle actually rotates in position in the dropdown menu behavior I am trying to match, rather than jump from up arrow to down arrow. Doing it this way would also allow me to match the isosceles shaped Unicode triangle, which unfortunately is only available pointing down but not up.

Many thanks in advance for your help!

This looks really nice!!! Would it be possible to post the related freeway file for having a deeper look and understanding of what is going on there?

Thank you so much,
Chris

Chris, I can post a FW7 file showing how I made the above. Will do when I get it as resolved as I can.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I will take a deeper look at this later, but for now, I can tell you that the generated content triangles don’t have to be positioned separately for each of their parent lists. You can use a single positioning rule for both of them, because they are positioned relative to their parent.

I catch your drift, though would need further guidance.

Am wondering, however, if I should abandon pushing forward doing this with page markup and extensions. Perhaps to fulfill my need to emulate all these dropdown menu features without pushing FW’s coding envelope and requiring help from those like you with deeper coding knowledge, I should instead be pursuing a WYSIWYG solution I could build using Tumult Hype. In my FW7 file I’d then insert the menus next to each other in a fixed width and flexible height in-line box.

Any Hype users out there familiar with its capabilities to give me a sense if I should bark up that tree? The features are: rotating disclosure triangle, window-shade like movement of drop-down nav menus with links to in-site pages and on-page anchors, only one drop-down menu open at a time.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, Hype seems the way to go.

Was able to get all the aspects of the design I needed to emulate without resorting to code. Will be a more cumbersome work flow, especially to make global edits, however, though inserting the Hype using Paul Dunning’s Hype Support action is making iterating easier.

http://www.brockmanfamilyfarming.com/newsite/testpage-hypedro

Many thanks for your help, Walter.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, you got the look you want but at the expense of a semantically meaningful menu. I realize it may be pointless to even bring this up but I will any way.

Menus are important semantic structures for search engines and assistive devices, and what you’ve done with Hype looks fine but it falls over flat on its face when it comes to semantics (there’s no logical semantic flow to it) and accessibility: turn of js and poof … where’s the menu?

There are any number of ways to accomplish what you want that would yield a much friendlier and accessible end result, all with surprisingly little effort.

As Walter mentioned recently in another thread, code is not someone else’s job.

Todd
https://xiiro.com

Yes, Hype seems the way to go.

Was able to get all the aspects of the design I needed to emulate without resorting to code.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Todd,

Thanks for speaking up. What you brought up was off my radar.

I have been improving my skills at structuring content, but most of what I have been reading is about tags in the HTML5 context, using the more specific HTML5 content categories like main, aside, etc, providing alt text for images, and providing better metadata. Do you have any suggestions on what to read to get smarter about navigation structuring related semantics, so I either abandon this direction or mitigate the semantic damage Hype created?

Also, using Javascript was something I was doing with Walt’s help on the paths he was helping me head down, which from your comments I take to be bad practice, providing no navigation for those with old browsers or with javascript disabled. Perhaps Walt’s paths were better because he was doing this in a way that provided options for such users?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Javascript can be used safely and effectively in menus. It’s not inherently bad, but it does require more planning when you start considering things like accessibility and/or the absence of js. Then you need to consider fallbacks and/or progressive enhancement techniques.

Walter is well aware of the importance of accessibility and progressive enhancement and from the little bit I scanned of this thread it sounds like all he was doing was trying to explain was how to add the disclosure triangle. I seriously doubt he would endorse building such an inaccessible menu.

Menus are best built with lists, ul or dl which I believe is what the FW actions use by default. But if you are going to manually build a dropdown menu then there are many online tutorials and examples for doing just that, many built with pure CSS (no js).

Personally I would get rid of the Hype menu and find a better solution. Freeway has the tools but you will probably need to get a little hands-on to get it the way you want.

Todd
https://xiiro.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I was proposing that you build a set of styles that would inject the disclosure triangles into the page with CSS (so no non-semantic elements added to the document tree) and layer the style effects on with JavaScript. In the absence of JS and CSS, it would just look like a list. This idea is known as “progressive enhancement”. That principle sets the goal that the thing will still work without the extra eye candy, but it will look better and maybe work better with JS.

Walter

On Apr 1, 2015, at 6:29 PM, Todd email@hidden wrote:

I seriously doubt he would endorse building such an inaccessible menu.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I was proposing that you build a set of styles that would inject the disclosure triangles into the page with CSS (so no non-semantic elements added to the document tree) and layer the style effects on with JavaScript.

Thanks for explaining the difference: I was not aware of these additional criteria you were applying.

There are any number of ways to accomplish what you want that would yield a much friendlier and accessible end result, all with surprisingly little effort

Great! As described above, and illustrated with the menus I did in Hype, I need to be able to match the navigation look and behavior of the blog: the most visited by far on the site, chosen because of well it matches the use patterns of the client, in use since 2012, and that has a template that supports very minimal reformatting.

If there’s a way to do this in Freeway taking the progressive enhancement approach using extended and markup features it would be terrific.

If not, and there’s a way to mitigate the problems caused by Hype, I’d love to know about it. For example, I see that the code that Hype outputs includes “text content for search engines” comprised of an unstructured non-list of the nav items each in their own

s. Perhaps if I reorganized this and created two lists of them it would help?

If not, then it looks like there is no solution that doesn’t involve a trade off between navigation consistency and accessibility/seo.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It’s important to understand that with enough CSS-fu, you can make [anything] look like [anything else]. Period, full stop, whatever. The wonderful thing about Freeway is that given a particular set of inputs, it always outputs the same code. It’s predictable and you can count on things being in a particular format when you start injecting additional styles into it. (f you haven’t ever seen it before, an instructive example of this tenet is the CSS Zen Garden. There, a single page of plain HTML markup is mixed with any number of additional stylesheets and graphic elements to create a huge variety of wildly different layouts and presentations.

I haven’t had a decent look at your desired outcome, and I don’t have time to do that this morning, but I can take a whack at this piñata for you, as I am sure that Todd or Dave or Ernie could (and one of them might get to you sooner). Before any of us get to that, a very useful exercise for you would be to create a new page with little or no style applied, but all of your required elements included. If what you are not able to get working with the CSS Menus Action is the little disclosure triangles rotating, or some other “grace note” on the design, get it as close as you can without any extra fiddling. Freeway will build a stable base, and one of us can reach in with the tweezers and make the necessary changes to inject those accents. Publish this new page somewhere, and post a link to it along with an example of what’s missing, and we can look at this with new eyes.

Walter

On Apr 2, 2015, at 12:25 AM, Peter Laundy email@hidden wrote:

I was proposing that you build a set of styles that would inject the disclosure triangles into the page with CSS (so no non-semantic elements added to the document tree) and layer the style effects on with JavaScript.

Thanks for explaining the difference: I was not aware of these additional criteria you were applying.

There are any number of ways to accomplish what you want that would yield a much friendlier and accessible end result, all with surprisingly little effort

Great! As described above, and illustrated with the menus I did in Hype, I need to be able to match the navigation look and behavior of the blog: the most visited by far on the site, chosen because of well it matches the use patterns of the client, in use since 2012, and that has a template that supports very minimal reformatting.

If there’s a way to do this in Freeway taking the progressive enhancement approach using extended and markup features it would be terrific.

If not, and there’s a way to mitigate the problems caused by Hype, I’d love to know about it. For example, I see that the code that Hype outputs includes “text content for search engines” comprised of an unstructured non-list of the nav items each in their own

s. Perhaps if I reorganized this and created two lists of them it would help?

If not, then it looks like there is no solution that doesn’t involve a trade off between navigation consistency and accessibility/seo.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Many many thanks for your efforts!

The following is a link to a pretty blank page where I have gotten as close as I could get to the blog’s nav layout and interaction using the CSS menu action. On these pages there will be two dropdown: Site Pages and Page Sections

http://www.brockmanfamilyfarming.com/newsite/testpage-css-menu-action

The following is a link to the current blog showing the navigation I am wanting to match. This has only the Site Pages dropdown.

http://www.blog.brockmanfamilyfarming.com

Also note that I am using SmoothScroll on all the pages with anchors.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Okay, have a look at this page: Test Page - MaxWithCSSMenuAction

Things to note:

  • This is all done with CSS, no JavaScript needed (thus no worries about conflicts).

  • I removed your typed-in Unicode triangles, and replaced them with generated content. In order to match the example blog, I used their exact recipe for generating triangles out of borders. I translated their dimensions into ems, so the triangles would scale properly if the font size was increased (the blog will just break or look bad).

  • Because the CSS Menu works by manipulating the display property of the submenu elements, rather than their height and overflow, I added a CSS transition to the submenus so that they would animate open and closed. This introduces a fiddly bit to the proceedings, because the animation will not appear to work if the max-height is set too high, so you have to test this with your actual menus (since this trick can cause the bottom of really tall menus to be clipped off). If your actual submenus are wildly varying in height, you may need to either pick a maximum, and live with the shorter menus “snapping” down, or you will need to use a different technique (JavaScript animation with the Scriptaculous Effects library, most likely) to make these elements change height.

To add this effect to your existing test page, follow these steps:

  1. In your design view, remove the triangles you typed into the menu.

  2. View source of the example page above in your browser, and locate the CSS I added (look for the comments marking it out).

  3. In Freeway, choose Page / HTML Markup / Before , and type in the following:

    paste in the code I wrote here

Okay the dialog, and preview in a browser. You should see the triangles, and when you mouse over them, the submenus should animate downward and the triangles should rotate in synch.

Let me know how this works for you, and if you have any questions.

Walter

On Apr 2, 2015, at 11:10 PM, Peter Laundy email@hidden wrote:

Many many thanks for your efforts!

The following is a link to a pretty blank page where I have gotten as close as I could get to the blog’s nav layout and interaction using the CSS menu action. On these pages there will be two dropdown: Site Pages and Page Sections

http://www.brockmanfamilyfarming.com/newsite/testpage-css-menu-action

The following is a link to the current blog showing the navigation I am wanting to match. This has only the Site Pages dropdown.

http://www.blog.brockmanfamilyfarming.com

Also note that I am using SmoothScroll on all the pages with anchors.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Very cool!

Interesting to see you can transition a transform property. In searching for a way to achieve the rotating triangle in CSS, I had found the transform property “rotate” at w3schools but of course on its own it wouldn’t do the trick. Hadn’t fully grokked that transition can be applied to other CSS properties but it certainly makes sense now that I get it, and makes the transition property very versatile.

Also, its a quite clever way to get to a triangle: specifying a color only for one border, the length of the item bordered as nil, and the position as absolute.

Looking forward to doing some more playing around with this to see how the various other positioning specifications place the triangle where it is.

Thank you so so much for taking so much time to help me out, Walter.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You are welcome!

Walter

On Apr 4, 2015, at 12:21 PM, Peter Laundy email@hidden wrote:

Very cool!

Interesting to see you can transition a transform property. In searching for a way to achieve the rotating triangle in CSS, I had found the transform property “rotate” at w3schools but of course on its own it wouldn’t do the trick. Hadn’t fully grokked that transition can be applied to other CSS properties but it certainly makes sense now that I get it, and makes the transition property very versatile.

Also, its a quite clever way to get to a triangle: specifying a color only for one border, the length of the item bordered as nil, and the position as absolute.

Looking forward to doing some more playing around with this to see how the various other positioning specifications place the triangle where it is.

Thank you so so much for taking so much time to help me out, Walter.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options