Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Templates vs. Styles Details »»
Templates vs. Styles
Version: , by Zhin Jio Zhin Jio is offline
Developer Last Online: Nov 2010 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-12-2003 Last Update: Never Installs: 0
 
No support by the author.

Hey all,

I have a question regarding styles vs. templates. My impression up to now is that the 'Style' portion of the show defines the overall look of the page, color/font/property-wise ... creating definitions for many variables that are used later on, especially in the templates (eg, {linkcolor} and the like).

The templates were/are a series of layout elements that get called from the various php scripts to lay down the page design.

And most importantly, that these two things are managed completely separately from one another. For example, it should be possible to have 10 different color styles that ALL use the same body of templates (like 'Default', for example).

Is this impression incorrect?

The reason I'm asking is because I tried creating a new style yesterday, to give users some different look/feel options and encountered problems.

Steps:
1) from admin cp, Add Style:
Title: plForum
Replacement set : Default
Template set : Default
User selectable : yes

2) created a new directory under my images directory called plForum to house all the images

3) copied ALL of the default images in, and then modified the ones I wanted to

4) modified the plForum style to have new color definitions

What I found was that both the plForum AND the Default style definitions were changed. In fact, any changes I made to the Default were ALSO reflected into plForum, and vice versa.

Clearly this doesn't seem to be correct behavior. Did I do something wrong? Is there a step I missed? Did I maybe do something accidentally that I didn't mention here?

Thanks in advance for the assistance.

Regards,
- ZJ

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-12-2003, 06:22 AM
joeboo's Avatar
joeboo joeboo is offline
 
Join Date: Jun 2002
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To have two skins working with their own styles and templates, you must create a new template set and replacement set for your new skin, not making it work with the default templates and replacement set. If you make it that the default skin and your new skin uses the same template set, then both skins will look messed up, having the templates mixed with both skins. So leave the default skin with its default templates and replacement set, and have your new skin have its OWN template set and replacement set. If you had hacks or anything else on your default template set, you'll have to re-add the template changes again to the new skin. Hopefully that made sense. Cheers
Reply With Quote
  #3  
Old 03-12-2003, 06:51 AM
Zhin Jio's Avatar
Zhin Jio Zhin Jio is offline
 
Join Date: Mar 2003
Location: Colorado
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by joeboo
To have two skins working with their own styles and templates, you must create a new template set and replacement set for your new skin, not making it work with the default templates and replacement set. If you make it that the default skin and your new skin uses the same template set, then both skins will look messed up, having the templates mixed with both skins. So leave the default skin with its default templates and replacement set, and have your new skin have its OWN template set and replacement set. If you had hacks or anything else on your default template set, you'll have to re-add the template changes again to the new skin. Hopefully that made sense. Cheers
Yup, it makes perfect sense. But doesn't it also make sense that so long as there isn't any color specific code in any template, that one template should do the trick? You say it will look 'messed up' in both. Why? Sure, I'll need to be less creative than I would otherwise (since I have to use the same types of buttons and images throughout... but what is really stopping me?

And, why was I seeing the behavior I saw?

- ZJ
Reply With Quote
  #4  
Old 03-12-2003, 07:02 AM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can use many styles with only one templateset. (i have 4 Styles on one set).
Just point the styles to different replacmentsets.
Reply With Quote
  #5  
Old 03-12-2003, 07:06 AM
joeboo's Avatar
joeboo joeboo is offline
 
Join Date: Jun 2002
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Zhin Jio

Yup, it makes perfect sense. But doesn't it also make sense that so long as there isn't any color specific code in any template, that one template should do the trick? You say it will look 'messed up' in both. Why? Sure, I'll need to be less creative than I would otherwise (since I have to use the same types of buttons and images throughout... but what is really stopping me?

And, why was I seeing the behavior I saw?

- ZJ
There you go. Just dont do custom design on a template that only pertains to one skin. Remember that you got more than one skin using info from that template set. Thats when you should use the new skin's new replacement set, not the default one. So you can use replacing variables.
Reply With Quote
  #6  
Old 03-12-2003, 07:09 AM
Zhin Jio's Avatar
Zhin Jio Zhin Jio is offline
 
Join Date: Mar 2003
Location: Colorado
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Kars10
You can use many styles with only one templateset. (i have 4 Styles on one set).
Just point the styles to different replacmentsets.
AH. Suddenly everything makes sense. I never actually expanded out the replacement set to see what was in it. Lookie there... all the link colors and stuff you define in the style. Fancy that.

Ok, that makes more sense now.

Thanks very much, I'll go try it out!

- ZJ
Reply With Quote
  #7  
Old 03-12-2003, 07:12 AM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No Problem buddy!
Reply With Quote
  #8  
Old 03-12-2003, 08:11 AM
Zhin Jio's Avatar
Zhin Jio Zhin Jio is offline
 
Join Date: Mar 2003
Location: Colorado
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This worked like a champ. I only found one issue with creating the new structure.

so for Default:
the imagesfolder variable points to:
images

for plForum, it points to
images/plForum

I'm also using vbPortal to give the front page a more homey feel. It broke. It was using imagesfolder to point to all its images. It also (sneakily) makes copies of the default top banner images in its own images folder.

so I needed to prepend the $bburl variable to all references to imagesfolder, and then it worked. This created a new problem, but nothing that couldn't be fixed with a quick filesystem symbolic link. All hail unix.

- ZJ
Reply With Quote
  #9  
Old 03-12-2003, 08:18 AM
Kars10's Avatar
Kars10 Kars10 is offline
 
Join Date: Jun 2002
Location: Germany/Franken
Posts: 748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can use somethin like this:

+ root
+ - images (set 1)
+ - images2 (set 2)

When you set your imagespath (like forums/images and forums/images2) in the style every {imagesfolder } - Variable points to the right set.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 02:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07345 seconds
  • Memory Usage 2,281KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete