Project

General

Profile

Feature #6111

JQuery Mobile template

Added by Yannick Warnier almost 6 years ago. Updated about 3 years ago.

Status:
Assigned
Priority:
Normal
Category:
Global / Others / Misc
Target version:
Start date:
20/04/2013
Due date:
% Done:

10%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Testing out a mobile version of Chamilo using JQuery Mobile by updating the default template (copying default/ to jqm/).


Related issues

Related to Chamilo LMS - Feature #6110: Add template selector settingNew20/04/2013

Actions

Associated revisions

Revision af972d8c (diff)
Added by Yannick Warnier almost 6 years ago

Removed hardcoded template dir - refs #6111

Revision b32f3d33 (diff)
Added by Julio Montoya almost 6 years ago

Fixing default template settings see #6111

Revision 15dd95f2 (diff)
Added by Yannick Warnier almost 6 years ago

Added JQuery Mobile template first draft - refs #6111

Revision e761b035 (diff)
Added by Yannick Warnier almost 6 years ago

Removed top bar and help buttons from mobile template - refs #6111

Revision db872ede (diff)
Added by Yannick Warnier almost 6 years ago

Removed hot courses block from mobile template - refs #6111

Revision fc91321f (diff)
Added by Julio Montoya almost 6 years ago

Using the app.template_style instead of a harcoded value of default see #6111

History

#1

Updated by Yannick Warnier almost 6 years ago

  • Status changed from New to Needs more info
  • Assignee set to Julio Montoya

Julio, I've changed the template name in global.inc.php ( + in template.lib.php + I've put my server in test mode, but it's still not taking my new template directory into account. Any idea why this might be?

There's no content in my temp/twig/ dir.

#2

Updated by Julio Montoya almost 6 years ago

  • Assignee changed from Julio Montoya to Yannick Warnier

1. Did you create a folder with your modified files?

main/templates/jqm

2. I sent some fixes now you can change the setting in global.inc.php

$app['template_style'] = 'default';

If you change it to 'experimental' it will load the 'default/layout/experimental' folder

#3

Updated by Yannick Warnier almost 6 years ago

  • Assignee changed from Yannick Warnier to Julio Montoya

It still looks like it loads the layout files from the templates/default/layout/ directory.
When I select "experimental" in global.inc.php and I load the homepage (as anonymous), I still get the default template.
When I connect and get to http://my.chamilo.net/web/userportal, I get "500 - Template "experimental/userportal/index.tpl" is not defined (). " (which is alright, I can live with that).

However, what I did is the following: I copied the template/default/ directory to template/jqm/ and I added a <link> line in template/jqm/layout/head.tpl, just below the viewport line (to make it easy to spot).
Whatever I do, it seems like the template used is never 'jqm'... (maybe it is for jqm/userportal/index.tpl, but then I would expect it to load "all" tpls from my folder, not just a few random ones...

#4

Updated by Yannick Warnier almost 6 years ago

And when I add the same <link> line to main/template/default/layout/head.tpl, I can see the change straight away, which proves that it is not a problem of not refreshing the tpl, it is just a problem of loading the default instead of the template defined.

#5

Updated by Julio Montoya almost 6 years ago

Yannick Warnier wrote:

It still looks like it loads the layout files from the templates/default/layout/ directory.
When I select "experimental" in global.inc.php and I load the homepage (as anonymous), I still get the default template.
When I connect and get to http://my.chamilo.net/web/userportal, I get "500 - Template "experimental/userportal/index.tpl" is not defined (). " (which is alright, I can live with that).

However, what I did is the following: I copied the template/default/ directory to template/jqm/ and I added a <link> line in template/jqm/layout/head.tpl, just below the viewport line (to make it easy to spot).
Whatever I do, it seems like the template used is never 'jqm'... (maybe it is for jqm/userportal/index.tpl, but then I would expect it to load "all" tpls from my folder, not just a few random ones...

You have to edit this file: layout/jqm/main_header.tpl and change this: with your jqm template

{% include "default/layout/head.tpl" %}

to this:

{% include "jqm/layout/head.tpl" %}
#6

Updated by Julio Montoya almost 6 years ago

I think that is not random is hardcoded in the templates using this includes:

{% include "default/layout/head.tpl" %}

A good idea to improve this is to create a twig variable and use this everywhere something like

{% set style = 'default' %}
#7

Updated by Yannick Warnier almost 6 years ago

Yes, that is a good idea (although I think it should be theme_dir, not style). "random" was a way of speaking :-)

If you use set theme_dir='default', how do you use it in an include afterwards?

{% include $theme_dir."/layout/head.tpl" %}

?
The way it works now is a bit weird (to have to indicate the template directory to include other files of the same template).
#8

Updated by Yannick Warnier almost 6 years ago

  • % Done changed from 0 to 10

It's nice to see how just including the JQM library and a few data-* tags make your site look more "mobily" :-)

#9

Updated by Julio Montoya almost 6 years ago

"jqm" is too techy you could use just "mobile" or "jquery_mobile" ...

#10

Updated by Yannick Warnier almost 6 years ago

  • Status changed from Needs more info to Assigned
  • Assignee changed from Julio Montoya to Yannick Warnier

True, true...

#12

Updated by Yannick Warnier almost 6 years ago

Apparently this library is the best way to go to detect mobile devices' properties: https://github.com/serbanghita/Mobile-Detect

#13

Updated by Yannick Warnier about 3 years ago

  • Target version changed from 2.0 to 3.0

Also available in: Atom PDF