ie7 has dedicated css but it also loads the non dedicated one - internet-explorer-7

hope sombody can enlighten me here,
i am writing a joomla template.
ie7 has a seperate css using:
<!--[if IE 7]>
<link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/css/template_ie7.css" type="text/css" />
<![endif]-->
but is also loads the non ie7 css and accepts its styles, so nothing get fixed....
does anybody know what to do?
thanks,
Jonatahn

Using conditional css loading this way is not (at least for me) the best way to handle this situation.
As you are writing a template you can acces to the $_SERVER['HTTP_USER_AGENT'] variable in order to determine if the iExplorer (or any other) css is needed and then use php to filter it's load
<?php
if(stripos ( $_SERVER['HTTP_USER_AGENT'], "MSIE 7.0") > 0 ){
/* LOAD IE7 CSS here */
}else{
/* LOAD normal CSS here */
}
?>
This way you can load the IE7 css ONLY.

Related

CakePHP 3.8 - How to access public path to webroot in view?

Migrating from 2.3.x to 3.8 and I can't figure out how I may access the public path to webroot in my views. Previously I could do something like this:
<link rel="stylesheet" type="text/css" href="<?php echo $this->webroot ?>wp-dist/acd76cde.css" />
But when I try this on 3.8 it says:
Error: webrootHelper could not be found.
I tried html helper, but can't find a helper method which gives just the public path to webroot. For example image() is relative to webroot/img, css() is relative to webroot/css and so on.
Am I missing something?
You're on the right track, you should be using the HTML helper.
For CSS:
<?= $this->Html->css('wp-dist/acd76cde.css'); ?>
Just FYI, internally this is using the options defined in config/app.php:
$pathPrefix = Configure::read('App.cssBaseUrl');
So in theory if you needed the same paths manually, you could read them out of the configs too - but you should just stick with the HTML Helper this is exactly what it's for.
From the Docs:
https://book.cakephp.org/3/en/views/helpers/html.html#linking-to-css-files
https://book.cakephp.org/3/en/views/helpers/html.html#inserting-well-formatted-elements
https://book.cakephp.org/3/en/development/configuration.html#general-configuration
Update:
As #ndm said in the comments above, the following works for me as well.
echo $this->Html->css('lightweight_lpbbd374e3', ['pathPrefix' => 'wp-dist/']);
Original my solution, which works too
$this->Url->webroot finally worked for me. So I'm including my css as follows:
<link rel="stylesheet" type="text/css" href="<?php echo $this->Url->webroot('wp-dist/lightweight_lpbbd374e3.css'); ?>" />
Until someone else suggests a better way, I'll continue using this.

Lightbox2 on simple html site (non WordPress) not working and I've tried almost everything

I can't seem to get the thumbnails I have placed on this page to open in the lightbox:
http://prussellartist.com/custom-leather-dog-collar-gallery2.htm
I tried changing the order and placement of these 2 elements:
<link rel="stylesheet" href="dist/css/lightbox.css">
<script src="dist/js/lightbox.js"></script>
At a glance is there anything wrong?
Please take a look at the JavaScript errors ... It seems like you forgot the fourth step of the getting-started guide (http://lokeshdhakar.com/projects/lightbox2/#getting-started) - namely - to include jQuery.

How to add a link rel code in Drupal 7?

I am a new developer and I want to implement a popup screen in Drupal 7.
I found a code online and it works, except for the "link rel" code the example has at the <head> section.
The code is the following:
<link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css" />
I tried opening this link and adding the whole code at the styles.css file, but the popup appears without any style.
Is there a way to do it correctly?
If you added the CSS content to your CSS file maybe you should clear the CSS cache to see changes.
You also should check the selectors match to the CSS rules (for instance with Firebug in Firefox browser).
Or in the template.php you can add external CSS in this way:
function mytheme_preprocess_html(&$variables) {
`drupal_add_css('http://www.jacklmoore.com/colorbox/example1/colorbox.css',`
`array('type' => 'external'));`
}

How to get absolute path for css and script

How to get absolute path for stylesheet or javascript files.
<?php echo $this->Html->css('/css/main.css');?>
Is giving URL
<link rel="stylesheet" type="text/css" href="/dev/theme/Default/css/main.css" />
And I am looking for
<link rel="stylesheet" type="text/css" href="http://localhost/dev/theme/Default/css/main.css" />
I'm really wondering why you would want to do so if the CSS files are served on the same domain as your website, but this will probably work;
<?php echo $this->Html->css($this->Html->url('/css/main.css', true));?>
HtmlHelper::url() (inherited from Helper::url() takes two arguments. The first is the path as a string or array (to make use of cakephp routing), if a Boolean 'true' is passed as its second argument, a 'full' URL is generated.
I'm not at my computer at the moment, so haven't been able to test it, but I think it should work.
update
I had a quick look at the source: https://github.com/cakephp/cakephp/blob/master/lib/Cake/View/Helper/HtmlHelper.php#L431
and HtmlHelper::css() uses Helper::assetUrl() internally;
https://github.com/cakephp/cakephp/blob/master/lib/Cake/View/Helper.php#L305
So this may work as well and if it works, it's a cleaner solution:
<?php echo $this->Html->css('main', null, array('fullBase' => true));?>

Changing icon and title of partial trust WPF xbap

I've been fiddling with a partial trust XBAP - how can I change the icon shown in the IE-tab and the title (aside from changing the assembly-name in the project properties)?
I would also like to change what is shown in the Internet header (right now it shows the address of the XBAP.
I had a similar issue where I could not change the title in IE 10 (this was the first stack overflow answer that comes up when you Google "xbap title"). I found the solution here:
In code, set Application.Current.MainWindow.Title to the title you want to show. This worked for me, hopefully this will be helpful for the next guy.
Load your XBAP from a HTML page using an IFRAME. In the HTML page add a title and icon.
Something like this:
<html>
<head>
<title>This is my title</title>
<link rel="shortcut icon" href="http://wherever.com/icon.ico">
</head>
<body>
<iframe location="something.xbap"
style="width:100%; height:100%; border:0; overflow:auto" scrolling="no"></iframe>
</body>
</html>
This is simplified from code that I actually use, except due to some other requirements I'm giving the iframe an id and setting its location using JavaScript in the body's onload event. I assume the above will work just as well.

Resources