Mobile detect
Permalink 1 user found helpful
Hi.
I'm trying to get mobile detect to work with c5
In my HTML / CSS template I have this php string
This code I put into my header.php
If I look at my source code, I can see that it makes this path
But it is not the right one, instead I want to take the theme path. like this
But the outcome of the path is then the whole php code.
I'm a little confused about how to get mobile detect to work with c5. Is mobile detect loaded correctly and how do i load the theme path before /css/custom.css and /css/mobile.css
I'm trying to get mobile detect to work with c5
In my HTML / CSS template I have this php string
This code I put into my header.php
If I look at my source code, I can see that it makes this path
<link href="css/custom.css" rel="stylesheet">
But it is not the right one, instead I want to take the theme path. like this
<?php echo $this->getThemePath()?>/css/custom.css
But the outcome of the path is then the whole php code.
<link href="<?php echo $this->getThemePath()?>/css/custom.css" rel="stylesheet">
I'm a little confused about how to get mobile detect to work with c5. Is mobile detect loaded correctly and how do i load the theme path before /css/custom.css and /css/mobile.css
because it already has a mobile page with CSS, and I just need to be able to change css depending on whether it is a desktop or handheld.
But can I customize it so it is only the header there is difference?
Otherwise if the client make a change in the content they have to do it on both sites, desktop and mobile? or?
But can I customize it so it is only the header there is difference?
Otherwise if the client make a change in the content they have to do it on both sites, desktop and mobile? or?
Just use the built-in library
Loader::library('3rdparty/mobile_detect'); $md = new Mobile_Detect(); if ($md->isMobile()) { ...
Ok that works :)Thanke you..
Is there a way to make the css path dynamic?
Is there a way to make the css path dynamic?
That should do the trick!