vBulletin Modifications

Tool: Templates as HTML Files

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Discussion

Reply
 
LinkBack (1) Thread Tools
Old 09-16-2006, 04:53 PM   1 links from elsewhere to this Post. Click to view. #1
Coder
SirAdrian's Avatar
Join Date: Jun 2006
SirAdrian is on a distinguished road

Thumbs up Tool: Templates as HTML Files

Note: this for use with local vBulletin installations.

Explanation


Say if you are working on a new project (articles, for example). Once configured, it would read all of the article_ prefixed templates as HTML files into a new ./templates folder. You can open one up in your favorite HTML editor, makes a few changes.

Now we're stuck. This would mean you would have to copy paste the file contents into the AdminCP, so vB can recompile the template into raw PHP again. Nope! This will do it for you.

Say if you use Firefox, keep a tab open with this file opened, and you will have a few options:
  • Save All - Takes each HTML document and saves it back to the database safely. It will use the styleID, product and version you specify. It will even create new HTML files found.
  • Update All - To initially import, or update your HTML files with any changes made directly to the database, run this. It does the opposite as the above. Though, if you run the above first, this will obviously have no effect.
  • Remove Missing - This will compare your file system with the templates in the database and prune out any files that no longer have online counterparts.
Each of the following 3 actions will not only just use the prefix you specify (leaves your other templates out of it!) but you can also filter the processing further. There is a filter box above the main data table, where you could enter articles_view. It would then list the templates starting with that. You could then easily just save/update all of those at once. Redirecting back works with the prefixes as well (to maintain your sanity).

If you find yourself constantly saving/refreshing a file, you can press the 'Save' or 'Update' buttons on their own to prevent a redirect back to where you were.

Benefits

The main benefit is the ability to work outside of "alt-tab" constraints which I found myself hating more and more every day. No, screen real estate wasn't the problem. Instead of copying, switching into the vB AdminCP, pasting, saving then refreshing (not to mention multiple templates!), you can now just save, click, refresh. Simple, fast, easy.

The other benefit is if you use any source code control software (ex: CVS). You can share the templates much easier. I personally had to add another step for this - a cron job to synch them, but that's not really relevant.

The Code

I'm only sharing this because I found this extremely useful, and I'm sure others will too. Feel free to improve it, and use it for your own needs. I originally wrote this for vBlogetin, so there was last minute shuffling to get rid of the dependency on it, but I think it's okay.

You only need to edit the few lines under the config comment. I suggest leaving styleid and path as they are. Anyway, here it is. forums/template.php
You must first be a registered member to view any code.
__________________


vBlogetin: an advanced blogging tool for vBulletin
>> Beta 3 released with SE-Friendly URLs!




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 09-17-2006, 09:17 AM   #2
Coder
Idan's Avatar
Join Date: Feb 2005
Real Name: Idan
Location: Israel
Idan is on a distinguished road

Default

thanks for sharing.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-18-2006, 07:13 PM   #3
Coder
AHRIMANSEFID's Avatar
Join Date: Nov 2004
Location: IRAN
AHRIMANSEFID is on a distinguished road

Default

Thank You Code




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-31-2006, 09:52 PM   #4
Ken Iovino
Founder
Ken Iovino's Avatar
Join Date: Mar 2004
Real Name: Ken Iovino
Location: Miami, Florida
Ken Iovino is on a distinguished road

Default

This is an awesome tool and can be expanded easily. I've been using it that past couple of days and love the convenience. Thanks for sharing man!
__________________
Earnersforum.com - Learn how to make money online! New Look!

Ken Iovino / vBHackers.com
vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations

vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD

6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You.

Crawlability Network: vBulletin SEO | vBulletin Hackers




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 05:33 AM   #5
Coder
Senna's Avatar
Join Date: Mar 2005
Location: LalaLand
Senna is on a distinguished road

Default

Great hack, saves time in not having to go into the admincp each time




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-01-2006, 02:00 PM   #6
Coder
SirAdrian's Avatar
Join Date: Jun 2006
SirAdrian is on a distinguished road

Default

LW if you make any improvements to it be sure to share them... maybe this coming weekend I will apply my updates to it as well and fix a few other minor things with it.

I'm glad it's working for you guys... it has been a total time saver for me!




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-15-2007, 08:01 AM   #7
vB Newbie
Join Date: Jun 2007
pigsy is on a distinguished road

Default

Adrian,

Does this work with the latest version of vB3.6x? Do you still use it as it is? I'm interested in speeding up template editing, because it really slows me down, also if templates are stored in the filesystem we can put them into SVN.

Cheers,
Paul.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 06-16-2007, 05:01 PM   #8
Coder
Join Date: Apr 2007
Real Name: I'm with Stupid
Cube1233 is on a distinguished road

Default

what does he hack this mod do ?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-14-2007, 03:04 PM   #9
vB Newbie
Join Date: Aug 2006
radarhunter is on a distinguished road

Default

thank buddy




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



LinkBacks (?)
LinkBack to this Thread: http://www.vbhackers.com/f93/tool-templates-html-files-5419/
Posted By For Type Date
How do you set your template editing environment? - vBulletin.org Forum This thread Refback 12-07-2006 03:04 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
assigning templates to a product.... BigJohnny General vBulletin Support 1 09-05-2006 12:10 PM
HTML Parseing PigFat General vBulletin Support 3 07-11-2006 08:39 AM
Adding to Global templates Stewarty General vBulletin Support 0 10-15-2005 06:39 PM
Copy Templates for All Skins grindking vBulletin Modification Requests 6 05-31-2005 10:56 AM
bbcode parse nfo files as png tokenyank vBulletin Modification Requests 8 03-15-2005 10:19 PM


All times are GMT -3. The time now is 10:58 AM.


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. (Patent Pending)