Fajer39
asked on
Sublime text 2 IDE - yeoman
Hi,
I'd like to ask how to create templates (modules) for a project in sublime text 2? I mean e.g. header and footer or navigation. So when you have 10 htmls it's compiling it for you from one file so you don't have to copy-paste the same things over and over again.
I know that this can be done in dreamweaver but I'm using yeoman generator now and ST2 is just awesome so I'd like to ask how do you do it there?
I'd like to ask how to create templates (modules) for a project in sublime text 2? I mean e.g. header and footer or navigation. So when you have 10 htmls it's compiling it for you from one file so you don't have to copy-paste the same things over and over again.
I know that this can be done in dreamweaver but I'm using yeoman generator now and ST2 is just awesome so I'd like to ask how do you do it there?
ASKER
This is very useful info Scott, thank you. But the thing is that I kind of know how to use ST2 very efficiently now - I use emmet and with other packages it's very powerful + yeoman on top of that...only thing what I'm missing (to be complete IDE) is that ability to "include".
I think that maybe some grunt package can do it somehow, I don't know but moving from ST2 is not an option now. There's gotta be a way to make yeoman even powerful.
NOTE: using php would be the best probably, but I'm a starting front-end dev (so I don't have own CMS) so I just want something to make things easier. Besides I would have to run XAMP on top of yeoman which I don't think is a good idea and my PC is not that powerful anyway
I think that maybe some grunt package can do it somehow, I don't know but moving from ST2 is not an option now. There's gotta be a way to make yeoman even powerful.
NOTE: using php would be the best probably, but I'm a starting front-end dev (so I don't have own CMS) so I just want something to make things easier. Besides I would have to run XAMP on top of yeoman which I don't think is a good idea and my PC is not that powerful anyway
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will look on that templating. Thanks.
Actually I foud https://www.npmjs.com/package/grunt-processhtml which can do this trick.
But I was thinking and It might be worth of the time to actually learn some basics of php and use it instead. I don't know. It's just too overwhelming for me right now. But thank you for your advises, I'll wait a while and then I accept your solution.
Actually I foud https://www.npmjs.com/package/grunt-processhtml which can do this trick.
But I was thinking and It might be worth of the time to actually learn some basics of php and use it instead. I don't know. It's just too overwhelming for me right now. But thank you for your advises, I'll wait a while and then I accept your solution.
Just a disclaimer, I used sublime for a short time and went to jetbrains phpStorm. There is a difference between how DW works and html editors such as Sublime, Jetbrains, Brackets, netbeans etc. Editors like Sublime have features that allow you to code faster and it takes a little time to learn all the little tricks and shortcuts.
If starting out from scratch, you would have some folders in your web application that may include:
+css
-- style.css
+images
--logo.png
+js
--main.js
+vendor
-- bootstrap folders and files
-- jquery ui folders and files
You can see the folder tree in Submlime and edit/add individual files just as you can in dreamweaver.
A template in DW is specific to DW and is actually doing a find and replace. In the dwt file you see code like this <!-- TemplateInfo codeOutsideHTMLIsLocked="t
When I create templates, I may have rendered html like
Open in new window
and in php my template would look like below using include files for everything common and add specific js and css for the current page.Open in new window
I have looked at, but not used yeoman. You are basically building items you use over and over again as json data and the code uses the json data to build your app. I don't believe it will manage templates as you did in DW.
https://www.youtube.com/watch?v=gKiaLSJW5xI