Jump to content
Graham Quince

Navigation widget - menu in a page

Recommended Posts

Great widget @Simon Law but I don't think it works on iOS - at least I can't get it to work (desktop browsers all fine).

 

It is this bit that fails on iOS.....

'.nav-navigation-container li a {click}': function(el, ev) { 
	$menu = this.element.closest('.sites_core').find('.sites_menu');
	$menu.find('a[data-uuid='+el.attr('data-uuid')+']').click();
},

 

Safari on iOS inspector and Chrome inspector report slightly different objects if you console out $menu and $menu.find('a[data-uuid='+el.attr('data-uuid')+']'), so perhaps this is why?

I found that this fixed the issue...

'.nav-navigation-container li a {click}': function(el, ev) {
	$menu = this.element.closest('.sites_core').find('.sites_menu');
	$menu.trigger('sites.changeLocation', {
		uuid: el.attr('data-uuid')
	});
},

Is this 'safe' to use?

Paul

Edited by pconkie
Link to post
Share on other sites
21 hours ago, pconkie said:

Great widget @Simon Law but I don't think it works on iOS - at least I can't get it to work (desktop browsers all fine).

 

It is this bit that fails on iOS.....


'.nav-navigation-container li a {click}': function(el, ev) { 
	$menu = this.element.closest('.sites_core').find('.sites_menu');
	$menu.find('a[data-uuid='+el.attr('data-uuid')+']').click();
},

 

Safari on iOS inspector and Chrome inspector report slightly different objects if you console out $menu and $menu.find('a[data-uuid='+el.attr('data-uuid')+']'), so perhaps this is why?

I found that this fixed the issue...


'.nav-navigation-container li a {click}': function(el, ev) {
	$menu = this.element.closest('.sites_core').find('.sites_menu');
	$menu.trigger('sites.changeLocation', {
		uuid: el.attr('data-uuid')
	});
},

Is this 'safe' to use?

Paul

 

22 hours ago, pconkie said:

$menu.trigger('sites.changeLocation', { uuid: el.attr('data-uuid') });

Hi Paul,

yes, that could be the way forward. the menu click event calls the 'sites.changeLocation' trigger, so we are just circumventing calling the menu tab..

  • Thanks 1
Link to post
Share on other sites

Cough...  i know it hasn't been that long yet...  but i kind of need to know if i have to manually set up the links or if the widget can be fixed????  Or worse still the issue is me!! 😞

Thanks!!

@Simon Law @Graham Quince  & @adamw (You seam to be the widget gatekeeper!! 😝)

Link to post
Share on other sites
16 minutes ago, pconkie said:

That didn't take 10 minutes! Sorry - the widget works fine for me.  Maybe you are on a different version of frog from me?

Hmmmmm..... it works....  just cant drill down to a sublist??

Link to post
Share on other sites
6 hours ago, pconkie said:

That didn't take 10 minutes! Sorry - the widget works fine for me.  Maybe you are on a different version of frog from me?

So it works...  untill you add the bit to only show the subject areas.....  even @Graham Quince had half a look and agreed it didn't work!!

image.png

Link to post
Share on other sites
6 hours ago, pconkie said:

That didn't take 10 minutes! Sorry - the widget works fine for me.  Maybe you are on a different version of frog from me?

Now i'm really confused.  Went to check both your version numbers and I can't see a navigation widget on Backwell's Frog.  You do have a menu widget up to version 27.  Is that your own @pconkie ?

Link to post
Share on other sites
25 minutes ago, Graham Quince said:

Now i'm really confused.  Went to check both your version numbers and I can't see a navigation widget on Backwell's Frog.  You do have a menu widget up to version 27.  Is that your own @pconkie ?

I bet @pconkie will have just made his own....  in fact i think hes working on Toad v1!!! 😜

Link to post
Share on other sites
1 hour ago, Graham Quince said:

Now i'm really confused.  Went to check both your version numbers and I can't see a navigation widget on Backwell's Frog.  You do have a menu widget up to version 27.  Is that your own @pconkie ?

No, that’s Simons widget (with a few modifications). Why does mine do what @ADT wants?!

Link to post
Share on other sites
3 hours ago, ADT said:

So it works...  untill you add the bit to only show the subject areas.....  even @Graham Quince had half a look and agreed it didn't work!!

image.png

Yes, I see the same error now. Assume you have added "Subject Areas" to the START NAVIGATION PATH preference?

Looks like a library the widget uses has been removed. If so might be a quick fix by loading the library on your dashboard before any pages with the widget load.  Then at least it works until a proper fix is pushed out.

Link to post
Share on other sites
2 minutes ago, pconkie said:

Yes, I see the same error now. Assume you have added "Subject Areas" to the START NAVIGATION PATH preference?

Looks like a library the widget uses has been removed. If so might be a quick fix by loading the library on your dashboard before any pages with the widget load.  Then at least it works until a proper fix is pushed out.

And in layman's terms?

Link to post
Share on other sites
1 minute ago, pconkie said:

I will give you some code to put in a html widget on your dashboards

It will make it work again

Pester frog for a proper fix though...

See thats what i hope you would say...  Hey you know me...  when do i ever stop pestering Frog!! 😜

You coming to this years virtual conference??

Link to post
Share on other sites

I've found and loaded the missing library, but there are some other issues which I can't figure out, sorry.

Maybe it's never worked or more likely the library has changed the way it works.  For Simon: searching the json for the navigation start doesn't return any nodes.  Looks like the xpath is wrong, I've tried changing it but i'm getting an invalid XPath error.

Link to post
Share on other sites
1 hour ago, pconkie said:

I've found and loaded the missing library, but there are some other issues which I can't figure out, sorry.

Maybe it's never worked or more likely the library has changed the way it works.  For Simon: searching the json for the navigation start doesn't return any nodes.  Looks like the xpath is wrong, I've tried changing it but i'm getting an invalid XPath error.

Thanks for trying...  I guess its back to making a manual navigation list!!

Link to post
Share on other sites
13 hours ago, pconkie said:

I've found and loaded the missing library, but there are some other issues which I can't figure out, sorry.

Maybe it's never worked or more likely the library has changed the way it works.  For Simon: searching the json for the navigation start doesn't return any nodes.  Looks like the xpath is wrong, I've tried changing it but i'm getting an invalid XPath error.

@Simon Law @Graham Quince @adamw

Any help??? 🙏

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By Sean_M
      Hello
      Wondering if anyone could help with an issue which popped up for some of our users (just students by the looks of it), seemly out of nowhere with no known changes to permissions, policy settings, etc.
      Student users are having the error, screenshot attached, "You do not have the required access to open menu.docs.network_drive.user_drive.default.".  When navigating to a page with the Network Files widget to their Home folder. Or in FrogDrive > Home Drive.
      I've checked the policy permissions for FrogDrive and Network Files apps/widgets, file paths in Users is correct, permissions of the folder on the file server. Nothing out of place as far as I can see.
      What setting am I missing to check? 
       
      Many thanks
      Sean

    • By Marcus Goluch
      Hi,
       
      I am going to ask a few questions regarding widget development:
      what DB software do you use (mogo, mysql, plaintext)? what npm module is used to manage this database? with out using any thing like frog forms, frog data viewer, csv files, frog documents of any kind. Could I please get access to give my widgets an actual database table? Can we get the ability to read console print outs from the server side code execution of widgets? Can we please get some form of API access for the server side part of EJS templates, mainly for use with databases.  
      Essentially as somebody who has limited experience developing web apps, I find that the current widget system of having to hack in things from locally hosted files, or using the client to connect to a Document based database hosted on 365 is too janky. Client side access for rendering inside an EJS template is exactly what I want but I don't have the tools available to do the really cool stuff I want to do.
       
      In a nut shell you can't watch Doctor Who on BBC one if you have a Television, but no TV channels. EJS is our television but right now we have no decent channels to watch.
       
      I know, I make a post about this every year but, Frog Code seriously needs to start being worked on again, right now we can not even delete our demo widget projects. I think Frog Code needs a road map and a clear plan, or it needs to be removed if you have no plans on finishing this feature.
       
      Sorry to sound like a brat, but I feel this is a seriously huge missed opportunity.
       
      Thank you
    • By Graham Quince
      Here's a new FrogCode widget:
      https://www.frogeducation.com/community/frogcode/frogcode-showcase/visitor-log
      We worked with George Bligh from Greenshaw on this widget.  When someone views a page with this widget on, it records their visit.  Anyone with Edit and Manage rights gets a button which displays a list of all visitors, their profile, their children (if a parent), how many times they have visited the site and the time and date of their last visit.

      (This widget uses the datastore - a little known about feature of Frog's API.)
       
      Updates
      This latest version 2.2 includes a "copy to clipboard" button, which allows you to copy the whole table and paste it into a spreadsheet program like Excel.
      The second new feature includes the ability to alter the Datastore's reference.  So if you wish to reset the log, instead of deleting the widget and adding it again, you can now change the reference and the information will remain stored.
       
    • By Graham Quince
      When I posted the snippet to allow you to restyle of My Notes, I hadn't thought that it wasn't as straight forward to change the title of Phrase of the Day. This bit of CSS is the easiest way I've found of changing all Phrases of the Day, although if you combine it with the the technique(?) mentioned in the restyling My Notes, you can restyle individual widgets in the same way.
      <style> .widget_phrase-wrap .header { height:50px; overflow:hidden; } .widget_phrase-wrap .header h2::before { content: 'My own title \a'; white-space: pre; } </style>  
    • By Phil Stiles
      Hi, I am trying to create a widget that is able to pull the Total Positive Behaviour Points into a variable, the end result is we will use an if statement to display a specific image depending on a number of points the student has.
      I have started by testing with the HTML widget. using the below code to see if I can use the behaviour.getBehaviourTotals API to get the total points this year for the user, however, it is not working.
      <script> var $ap,user; //Create a div, and give it a unique ID $ap = $("div", { id: Frog.Utilities.generateSimpleID() } ); $ap.html( '<b>Your House Points:</b>'+ '<table clase="table" id="your_points">'+ '<tr>'+ "<th>This Year</th>"+ '</tr>'+ '</table>' ); // Use Frog's API to get the logged in student user = FrogOS.getUser(); // Use Frog's API to get Behaviour points Frog.Model .api('behaviour.getBehaviourTotals',{ Student_uuid: user.uuid, }).done(function(behaviourResponse){ behaviourResponse.data.pos.year(function(work){ $ap.find('tbody') .append( '<tr>'+ '<td>'+ data.pos.year+ '</td>'+ '</tr>' ); }); }); arguments[0].append($ap); </script> any advice appreciated.
      Phil
×
×
  • Create New...