Deep Linking in Foundation For Apps - zurb-foundation

I am new to Foundation for Apps and am trying to get deep linking to work with the zf-tabs directive. Basically, I have a view with tabs and I am trying to use $state.go in my controller to navigate to the view and activate a particular tab. I have gotten the URL to write correctly with the hash but the tab doesn't activate. I see a lot of discussion on how to do this in the other foundation frameworks but there is zero info on this for Foundation For Apps.

Related

How to build a Shinymanager and Brochure app with Golem

I don't really have a repository to share as I am falling at the first hurdle sadly. I was wondering how to build an golem app that is both a Brochure and shinymanager one as I am hoping to create a login page for my app that leads to a menu page that can lead to multiple options of other pages.
I have tried wrapping the first page UI with secure_app but nothing happens when I hit 'log in'. I'm not quite sure how to determine what page the auth page goes to after logging in.
Just looking for a starting point to go off! Perhaps there is something else I can use other than Brochure to create a multi-page app with shinymanager log in?
Please consider giving some form of code -- here is info on how to write reprex -- you are trying to execute, if you cannot provide a repo to work on.
Consider moving to the polished package for authentication. I have that working with the brochure package -- note it is still in development.

Ionic2 web app routing configuration

I am working on ionic2 project, which is web project (i.e. runs as a website on browsers not a mobile app). Here I am facing difficulty to give specific URL for pages. How do I implement routing in my project ?
I also worked with angular2. Where we can give URL to components. But here that thing is not working.
Take a look at this website: https://www.joshmorony.com/a-simple-guide-to-navigation-in-ionic-2/
and read up on the nav controller here: https://ionicframework.com/docs/api/navigation/NavController/
Some Context: While Ionic2 does use the native browser for each platform, it uses a special controller to change routes
NavController is the base class for navigation controller components like Nav and Tab. You use navigation controllers to navigate to pages in your app. At a basic level, a navigation controller is an array of pages representing a particular history (of a Tab for example). This array can be manipulated to navigate throughout an app by pushing and popping pages or inserting and removing them at arbitrary locations in history.
Before diving deeper into Ionic I suggest obtaining an understanding of this controller.
This sample ionic project will also help with the understanding of navController:
https://github.com/ionic-team/ionic2-starter-sidemenu

Adding React inside a Django project

I am a Django developer just getting started with adding React to one page of my app, and really enjoying it so far. (It's a normal Django app with a home page, an about page, etc, but also a "chart" page with an interactive chart, and I want to build the interactive part in React.)
The problem is that I've started with the downloadable React starter kit and I'm not sure how to do things the 'right' way, and it's complicated by using Django to serve my project (all the tutorials seem to assume you're using node, which I'm not).
Right now I just have this in my Django template:
<div id="myapp"></div>
<script src="/static/js/vendor/react.js"></script>
<script src="/static/js/vendor/JSXTransform.js"></script>
<script src="/static/js/myapp.js"></script>
And myapp.js has all the React code. I'm aware this isn't really the grown-up modern JS way of doing things.
Now I want to use React Bootstrap, but it seems that the only sensible way to do that is with npm. So it's time to make the switch, but I'm not completely sure how.
I have run npm install react and npm install react-bootstrap from inside my static/js directory in Django. This has created a node_modules folder with various files inside.
So three questions from a confused newbie:
Where should I put my React code to work with these npm modules (should I use var React = require('react')?
Do I need to compile this code somehow (using webpack?)
How do I then integrate this with Django? Should I compile it all to myapp.js and just include that in my HTML template?
I'm also doing the same thing right now - moving away from embedded HTML script tags into require land. Here is the tutorial I am following, and here is my file system so far. I am doing it in Node but it shouldn't be that different for a Django project as the React frontend code is decoupled from any backend other than API URL's.
Your node_modules folder contains react-bootstrap. In your myapp.js, use the require('react-bootstrap') to load up the library which is contained in your node_modules folder.
Where should I put my React code to work with these npm modules (should I use var React = require('react')?
You can put the code anywhere. If your file system looks like this:
project/
react/
myapp.js
node_modules/
react source code
react bootstrap stuff
Then you can just do var React = require('react'); in myapp.js.
Do I need to compile this code somehow (using webpack?)
Yes, I would consult the webpack tutorial I linked earlier, it should explain how to compile all your React code into a single bundle.js. Here is also another good tutorial. This bundle.js file contains all the source code of your requires. So if your myapp.js looks something like
var React = require('react');
var ReactBootstrap = require('react-bootstrap');
then the bundle.js now contains all of the React and react-bootstrap javascript code, along with the myapp.js source code.
How do I then integrate this with Django? Should I compile it all to myapp.js and just include that in my HTML template?
I've only done work on Nodejs, but my React code so far hasn't touched any Node code, and I don't think it will touch any Django code (again I've never done Django so I might be wrong). All you need to do is compile with webpack, which spits out a bundle.js. You put that bundle.js in your HTML and it'll load up myapp.js.
ReactJS code is still JS code. Even though you do require/import/other module based syntax when coding, in browser you will still load the JS code by a script tag.
The problem is how to let the script generated by webpack(bundle.js) to work with other 'VanillaJS' script. For example, if you only write an individual component using React, like a small table. And its data(props/state) will depend on another element/event written in VanillaJS, e.g, a click listener on a button render by django template. Then the question is, how they communicate with each other.
So far, the solution I know is:
when you write React Code, instead of calling ReactDOM.render explicitly with preset props/state, you can store that in a global function, the arguments could be the props. You load this script first, then the other script can use this global function to trigger the React render Component.
I'm using Django Rest Framework to build an API and then connect to that API from React (using simple Create react app), this way the front end and back end are separated and the application is very scalable. The second way to do this, is call create react app then run build and point your django settings to that react build, this way the front end is not separated from the backend. I hope this helped, good luck.

Using Zurb Foundation in Kentico CMS Portal Engine

I need to use Zurb Foundation front-end framework and Kentico CMS v7's portal engine development model. When I import the framework CSS into the CMS and apply the Foundation style sheet to a Page Template, the CMS styles and Foundation styles step on each other making the Design tab pretty much useless for the user:
No style applied:
Style applied:
I am wondering if I need to prefix styles in the Foundation CSS classes to try to prevent conflict, however my initial quick attempts didn't seem to have much affect.
Is there a way to include the Foundation CSS in a way that doesn't prevent portal engine development?
Only thing i can think of now is to add the CSS conditionally.
Put
<%= CMS.CMSHelper.CMSContext.ViewMode != CMS.PortalEngine.ViewModeEnum.Design ? #"<link rel=""stylesheet"" href=""http://www.zurb.com/assets/foundation.top-bar.css"">" : "" %>
into a page layout. I tried to add this to layout of master page (Root document -> Master page -> Edit template properties -> Layout) and it works fine. But it will add the CSS to the . Unfortunately this code does not get resolved in head section of master page.

Ember.js hybrid application - maybe embeded outlets

I am creating an Ember.js application which basically has a very simple UI: header, content, footer -- all this in the application layer.
But, when you see the site at first, you have a hybrid application -- google needs to reach parts of it, but login, registration, dashboard, and other pages, should be handled by Ember.
And I might have a bit of an issue, because if I render some views, say on the homepage, in some outlets, then those outlets are going to be different after login, on the user's dashboard.
I cannot show off the UI, but i could try to provide more details if needed.
My question would be how to handle this issue?
I used a bit of a hack for now: just before Ember initialize, I remove from the DOM the content rendered server-side.
This might be ugly, but it works. This way robots may reach the content I want them to reach, the users on the other hand will see something better.