CSS Syntax Highlighting in .PHP Files

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
User avatar
joemichaud
Posts: 39
Joined: Sat Sep 29, 2007 4:58 pm

CSS Syntax Highlighting in .PHP Files

Post by joemichaud »

Hi All,

I am developing for a content management system called Expression Engine and have one little issue for which I am unable to find a graceful solution. The CMS can be directed to save all of its templates - normally stored in the database - to flat files for development purposes.

On the whole this works great and allows me to edit with my beloved Webuilder and see my site in the preview pane exactly it would appear on the live site (thanks to the "Mappings" feature).

The PROBLEM is that the CMS saves all template files with the .PHP extension... so no syntax highlighting or auto-completion in CSS files. If I change the file extension then I loose several important advantages that I would rather not give up...

Is there an elegant solution? Is there some way to declare that a file is CSS inside of a comment block or something like that? Any help is greatly appreciated!!
Joe Michaud
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Post by Karlis »

You can not have some PHP files viewed as PHP files and then some other PHP files viewed as CSS. Either you define all PHP files as CSS (which can be done) or leave them as is.

OR (idea) you could append <style> and </style> before and after CSS code.
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
joemichaud
Posts: 39
Joined: Sat Sep 29, 2007 4:58 pm

Post by joemichaud »

Thanks Karlis!

Surrounding the CSS with a <style> block does the trick and everything works great in Expression Engine! Although I have not yet tried, I am willing to bet I can do something similar with Javascript pages - except surround them with a <script> block.

Just FYI, I think the Expression Engine community may be a great opportunity for Blumentals Software... It is a commercial open source CMS, very reasonably priced, and gaining popularity very quickly. Your software works very well as a development platform for EE and it may be worth your while to take a look. It may be very easy for you to integrate EE tags into your code parsing and auto-completion - then market to EE developers.

Best Regards,
Joe Michaud
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Post by Karlis »

Thanks. I'll give it a thought when some spare chunk of time pops up.
Karlis Blumentals
Blumentals Software
www.blumentals.net
Post Reply