Copy link to clipboard
Copied
Is there a way to use 'ALT+click" to show css properties in php files?
When I ALT+left click an element, on a php file with include(...) I only see:
Is this one of the limitations of working with php files?
Copy link to clipboard
Copied
Thank a lot.
Should I change anything here once i create the alias?
Copy link to clipboard
Copied
it's depend,
now, your server folder is the one created on your hard drive and that contains the web site (where the alias point at)
and the url is your localost followed by the alias name.
Copy link to clipboard
Copied
Thank you for your time & effort !
I followed your instruction and yes, now http://localhost/DnD_B4 takes mo to my website.
However, it does not solve the 404 issues when i use a link relative to root, e.g.
<link href="/css/main.css" rel="stylesheet" type="text/css">
I still have to use this unclean method if i want the styles to be applied and DW to show me the element properties:
<link href="<?php echo siteRoot()?>/css/main.css" rel="stylesheet" type="text/css">
<?php if(isLocalSite()):?>
<link href="/css/main.css" rel="stylesheet" type="text/css">
<?php endif?>
I guess i'll have to stick with this
Copy link to clipboard
Copied
what give a PHP file just cotaining this
<?php echo siteRoot()?>/css/main.css
Copy link to clipboard
Copied
If I only use this i cannot see any properties when i use ALT+click
If i don't use it i have no styles
Copy link to clipboard
Copied
Try putting base href in the head of your pages:
<base href="http://localhost/DnD_B4/">
If you want to save the effort of of updating between testing server and live platforms do something like this with PHP:
<?php
$dev = array('localhost', '127.0.0.1');
//Check If testing server before outoutting stuff
if(in_array($_SERVER['HTTP_HOST'], $dev)) {
echo '<base href="http://' . $_SERVER['HTTP_HOST'] . '/DnD_B4/">';
}else {
echo '<base href="https://' . $_SERVER['HTTP_HOST'] . '">';
}
?>
Copy link to clipboard
Copied
Should the above be used with the alias (DnD_B4) ?
Copy link to clipboard
Copied
well, I tried both and it still the same.
If i just use "/" as the site root and not a relative path or my siteRoot() function, the styles are not applied.
Copy link to clipboard
Copied
even if i put the following ocde in a php include:
if(isLocalSite()):?>
<link href="/css/mediaQuery.css" rel="stylesheet" type="text/css">
<?php endif;
i will not be able to see these visual media queries
Copy link to clipboard
Copied
any reason i still see this in google chrome even though i used the alias method + your code the set teh base?
why does it not look search under:
localhost/DnD_B4/css/...
??
Copy link to clipboard
Copied
could you please, do this as I already asked you
what give a PHP file just containing this
<?php echo siteRoot()?>/css/main.css
Copy link to clipboard
Copied
it gives this:
/localhost/DnD_B4//css/main.css
Which is what i would want it to be but if i use this:
but this:
<link href="/css/main.css"..
is translated by the browser to /localhost/css/main.css
even though I set teh alias
Ant yet a gain, these 2 are syntax identical:
<link href="http://localhost/DnD_B4/css/main.css" rel="stylesheet" type="text/css">
<link href="<?php echo siteRoot()?>/css/main.css" rel="stylesheet" type="text/css">
yes, only this one:
<link href="http://localhost/DnD_B4/css/main.css" rel="stylesheet" type="text/css">
allows me to view the css properties which i accepted as DW limitation you mentioned at the beginning.
Copy link to clipboard
Copied
and now what gives
<?php
echo '/'.trim( $_SERVER['DOCUMENT_ROOT'], '/' ).'/css/main.css';
?>
Copy link to clipboard
Copied
it gives:
C:/xampp/htdocs/css/main.css
Copy link to clipboard
Copied
Which I think is the root cause of this issues - it should be C:/xampp/htdocs/DnD_B4/css/main.css
Copy link to clipboard
Copied
karpiyon wrote
Which I think is the root cause of this issues - it should be C:/xampp/htdocs/DnD_B4/css/main.css
Something just struck me that may solve the problem. Try links relative to site root.
I tried this using another program with positive results. No fiddling around with PHP code.
As side note: Birnou has indicated that he is sick of the criticism from one poster in particular. He will not be coming back. A PM to get him back here will not go astray. Hopefully others will follow suit..
Copy link to clipboard
Copied
Thank you again for all the effort spent on this thread.
...its not working...
I'll stick with my unclean solution for now.
Copy link to clipboard
Copied
Thanks for the feedback. Sorry it hasn't worked out.
Have a great holiday period and stay safe.
Copy link to clipboard
Copied
I understand Birnou very well, this has been too long for me as well.
I have found a solution as stated before - not a clean one but it is wokring.
i'll try the "Site Root" and let you know.
Thank you all !!!