Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ALT+click in live view does not show css properties in php files.

Engaged ,
Dec 19, 2018 Dec 19, 2018

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?

2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

Thank a lot.

Should I change anything here once i create the alias?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2018 Dec 21, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2018 Dec 21, 2018

what give a PHP file just cotaining this

<?php echo siteRoot()?>/css/main.css

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2018 Dec 21, 2018

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'] . '">';

    }

?>

Paul-M - Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

Should the above be used with the alias (DnD_B4) ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

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/...

??

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2018 Dec 21, 2018

could you please, do this as I already asked you

what give a PHP file just containing this

<?php echo siteRoot()?>/css/main.css

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 21, 2018 Dec 21, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2018 Dec 22, 2018

and now what gives

<?php

    echo '/'.trim( $_SERVER['DOCUMENT_ROOT'], '/' ).'/css/main.css';

?>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 22, 2018 Dec 22, 2018

it gives:

C:/xampp/htdocs/css/main.css

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 22, 2018 Dec 22, 2018

Which I think is the root cause of this issues - it should be C:/xampp/htdocs/DnD_B4/css/main.css

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2018 Dec 22, 2018

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..

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 22, 2018 Dec 22, 2018

Thank you again for all the effort spent on this thread.

...its not working...

I'll stick with my unclean solution for now.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2018 Dec 22, 2018
LATEST

Thanks for the feedback. Sorry it hasn't worked out.

Have a great holiday period and stay safe.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 22, 2018 Dec 22, 2018

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 !!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines