ionic-cli to generate pages in certain folders - ionic-framework

I am using ionic-cli 2 for generating pages for my ionic project. I would like keep my pages separately in different folders . For example , I would like to keep pages like Login , Signup in a separate folder called authentication . But at the same time I would like to enjoy the ionic generate page command to quickly setup the page inside the authentication folder. Currently ionic-cli would generate the pages in pages folder. How can I make it in pages/authentication folder ?

I know it's been a while, but this worked for me using the #latest ionic (3.12.0)
Generate "sub-pages" from the app's root folder as you would generate "top-level" pages. Then, drag them to their intended place using Visual Studio Code.
Obviously you want to rename stuff such as modules and classes. For example, for the 'home' and 'standings' sub-pages of the 'team' page, I renamed the classes from HomePage and StandingsPage to TeamHomePage and TeamStandingsPage respectively.
Alternatively (and in retrospect recommended), name the pages using the desired structure, e.g., ionic generate page team-home (you'll still have to move them manually). This is especially useful for repeating patterns, e.g., if you also want 'home' and 'standings' sub-pages for say a 'tournaments' page.
Also see Can ionic2's pages support nested directory structure?.

Just run
ionic generate page pages/authentication
more information https://ionicframework.com/docs/cli/commands/generate

ionic g page src/app/pages/{your_pageName}
This Worked for me.

Reading the doc https://ionicframework.com/docs/cli/commands/generate
Seems that you can specify the folder where you want to generate your page or component directly when you call the command.
Typing ionic g page my_dir/my_page generate a page component into the my_dir directory.

I know this gets tricky in the beginning. Here, I'm mentioning the steps to create a page under specific directory.
Suppose your project follows the structure of directory as:
src
app
components
pages
pipes
To create a page under "pages", navigate to "app" directory and use command:
ionic g page pages/test
Reference: https://ionicframework.com/docs/cli/commands/generate

before creating a separate folder you have to manually create an authentication folder into your app folder.
CLI > ionic generate page authentication/login

Related

Multi-page Airconsole controller?

I'm just starting to create a controller for use with Airconsole. I'd like it to be somewhat complicated and will be using Angular to create different pages.
In Unity, I can drag in a controller.html file. However, I've been getting resource not found errors when I try to access say controller.js or controller.css. How can I upload multliple files to the Airconsole host? Is there a general pattern used by other games?
So far I'm considering
hosting my app separately and just redirecting to my separate web page. This seems to give errors in the emulator though.
Compiling the entire app into just one HTML file.. Not sure how to get these entirely into one file. When I run ng build I get a smaller dist compiled file, but it still consists of several smaller files. Will try dragging that into Unity and trying again. But dragging the entire Angular project inside Unity felt like a really bad idea..
Link to files hosted on separate pages but still have the uploaded HTML file do something.. But not sure how much I need to do here vs how much I can move to other files that I host.
You can create your controller using controller.html with Angular (1?!), have different pages (e.g. via ng-include and the angular routing module) and upload everything to AirConsole (developers).
By using ng-include you can have multiple .html views you dynamically load into the controller.html.
I once wrote an example app for AirConsole and Angular:
https://github.com/francois-n-dream/airconsole-angular-phaser
Just think of it as if you would make a (mobile) website which in addition uses the AirConsole API for device communication.
My basic "how to include other files" question was answered well by another question: How to include js and css.
For the more generic question of working with Angular, I still haven't quite figured it out. But what I'm doing at the moment:
I have an Angular project outside of Unity. I run ng build to compile everything into a folder dist. Then two options work:
Deploy the dist folder to static file hosting and change index.html's relative links to point to the separately hosted files with <base href="https://cloudfilehosting/airconsole-host/">
OR
Copy the dist folder into Unity's Assets/WebGLTemplates/AirConsole folder.

Ionic 2 missing ionic.css file

I'm creating a new Ionic app that I need to take a lot of styling from an old app for. The new app is ionic 2, the old is ionic 1. The ionic 1 app is pulling a lot of styles from lib/ionic/css/ionic.css. I can't find a similar thing in the ionic 2 app. Where do I find this? Do I just need to copy the file over? And will there be collision issues with ionic 2?
The css files would be under theme folder, app.core.scss where you define the folder path.
For example,
-App
--Pages
---Login(folder inside pages)
----Login.html
----Login.js
----Login.scss
---MainPage(folder inside pages)
--Theme
---app.core.scss(inside theme folder)
and define the folder path in app.core.scss :
#import "../pages/Login/Login";
Do note that the css styles are separated in ionic 2, but for my ionic 2 version, there are instances where same html ID css get mixed up, thus it would be better to have different IDs for different pages.
What boilerplate template did you use to create you app? There might be different structure for the folders and files. But the idea is that there will be bunch of .scss files in different folders which should be compiled to one css file when you build/serve the app.
For example there could be structure as indicated by #Gene or the main scss files could be in /app/app.scss and /theme/variables.scss, and individual components scss will be in the component directories

Github Page, how to make my project site to use main site layout?

I have an organization github page www.spoonmangames.cl and I created a project site called Unity3DTools so I can access this with www.spoonmangames.cl/Unity3DTools/
So far so good, but I want my project site to use the layouts I've created in my organization page. I tried to just add layout: default in the front matter section of index.html in the project site but it just show a blank page with the title (you can actually check in the url above).
I do not want to copy stuff into the project site, is there any other solution?
By the way the project site has only the readme.md and index.html, maybe I should add a config.yml with some special configuration?
Thanks in advance.
If the two things we're talking about is this main site and this subdirectory, then maybe jekyll doesn't really knows about your subdirectory so it doesn't try to serve it.
Have you tried to upload a unity3dtools.md (or ~.html) to main site's root directory and then permalink it to /Unity3DTools ?
The above could be one solution, but if you don't want to copy anything to the project site, maybe you should consider defining a new collection in the _config named something like "projects" and then each project you create, should contains a property "directory" which in this case points to the /Unity3DTools directory.
Try the following (be careful, try this first on your local development first)
collections:
projects:
output: true
Then make a _projects directory and make a Unity3DTools.md file with some of the followings:
---
name: Unity3DTools
permalink: /Unity3DTools
projectDir: Unity3DTools
[some extra stuff you want]
---
I'm pretty sure this is not enough, but maybe it helps your further research to accomplish. Share if you're moved ahead some steps!

how to create multiplatform file browser in ionic

I need help. I'm trying to create a multiplatform mobile application. One of the functionalities is a local file browser that will allow user to select a directory and create a list of file in this directory. I've already spent couple of hours on that issue and I can not find any solution for that.
I've checked http://ngcordova.com/docs/plugins/file/
But if I understand it correctly it is used when I already have a file, it not allows user to pick the directory.
I don't need anything fancy, it should as simple as possible
The Cordova FileSystem plugin (and ngCordova's wrapper) provide the ability the read directories from the file system. They do not provide any UI, so you would use the plugin to ask for a list of directories and then render it as you see fit. (A UL, a table, whatever.) To "browse" you could use a click handler on the list of directories such that when clicked, you then get the files/subdirectories of that folder. Again, the FS plugin adds support for doing that.

Can't find mosConfig_absolute_path in configuration.php

I am trying to move my Joomla1 website from localhost to my bluehost.com domain. For testing I have created a subdirectory on my domain for testing and moved all my Joomla! files to this. I have created this subdirectory under the public_html folder.
I am using different menus on the front page (custom page) and remaining pages. My problem is that the menu items on the front page are looking for pages in a subdirectory named joomla instead of looking for pages in my subdirectory (testing)
Based on suggestions from some websites I thought changing mosConfig_absolute_path will help but my configuration.php file in the testing subdirectory doesn't have a property called mosConfig_absolute_path. I do not face this problem on any of the menu items on the other pages.
Can someone please help me with this problem and how I should overcome it. Thanks.
The variable you're talking about is $mosConfig_absolute_path rather than $msConfig_absolute_path. You will also need to reset $mosConfig_live_site.
Also, migrating to Joomla! 1.5 would avoid this issue entirely; it automatically detects your base path and URL.