PDA

View Full Version : general question about templates/custom pages and styling


user25148
01-13-2015, 04:50 PM
So i have a custom page (template?) created and the tabs all link to it fine etc...

Now usually with a html/php page I could write the code and then link it to a css stylesheet. Now I obviously want my custom page to be the same theme as the rest of my forum and be able to change themes with the rest of the forum. To do this, should I write all the html code for the page by editing the template in the adminCP? If so, how would I go about adding CSS to the page while keeping my theme? The additional.css file is not inherited across all my themes, so if I added it in there I would have to go through each theme and add the css to that themes additional.css file. Is there another way to do this?

bridge2heyday
01-13-2015, 06:04 PM
I think you need to read this https://vborg.vbsupport.ru/showthread.php?t=228112

user25148
01-13-2015, 09:03 PM
I think you need to read this https://vborg.vbsupport.ru/showthread.php?t=228112

I've read over that several times, and already have the page created. I need to know where to style it using CSS.

cellarius
01-13-2015, 09:16 PM
additional.css. And if not all of your styles implement it, then make them. That's the way to do it through vB.

squidsk
01-13-2015, 09:29 PM
If you'd followed the guide as laid out by lynne then it would automatically be styled according to the selected style of the user. Further additional.css style rules would be used on that page as the setup includes the code necessary to include that file.

user25148
01-13-2015, 10:45 PM
additional.css. And if not all of your styles implement it, then make them. That's the way to do it through vB.

If you'd followed the guide as laid out by lynne then it would automatically be styled according to the selected style of the user. Further additional.css style rules would be used on that page as the setup includes the code necessary to include that file.

Thanks for the replies. I know additional.css would work but I wanted to know if there was a better way instead of going through each themes additional.css and add the same CSS code.

squidsk
01-14-2015, 12:06 AM
Thanks for the replies. I know additional.css would work but I wanted to know if there was a better way instead of going through each themes additional.css and add the same CSS code.
Yes create a template called mypage.css and link to it in the head section of your custom page. Naming the template with .css at the end will group it in with the other css templates in vbulletin.

cellarius
01-14-2015, 05:08 AM
Thanks for the replies. I know additional.css would work but I wanted to know if there was a better way instead of going through each themes additional.css and add the same CSS code.
You should have a parent style with your own styles as child style, so changes are inherited.

user25148
01-14-2015, 07:24 AM
Yes create a template called mypage.css and link to it in the head section of your custom page. Naming the template with .css at the end will group it in with the other css templates in vbulletin.

I went ahead and made a css file and it did group itself with the other css templates in the style manager. I tried to link my custom template page to this css file using <link rel="stylesheet" type="text/css" href="name of css template here"> in between the <head></head> tags however this had no effect and the code inside this css template did not run.

You should have a parent style with your own styles as child style, so changes are inherited.

The styles do have a main parent style but alot of the code that creates the variations of the themes is probably in the additional.css file and therefore it isnt inherited.

cellarius
01-14-2015, 07:56 AM
I went ahead and made a css file and it did group itself with the other css templates in the style manager. I tried to link my custom template page to this css file using <link rel="stylesheet" type="text/css" href="name of css template here"> in between the <head></head> tags however this had no effect and the code inside this css template did not run.

You don't create actual files in the template manager, and therefore you can't integrate them that way. That code would look for a stylesheet file with that name in your forum root, and where should that come frome?

You need to create an actual, physical css file in your file system and link to that properly.

user25148
01-14-2015, 02:14 PM
You don't create actual files in the template manager, and therefore you can't integrate them that way. That code would look for a stylesheet file with that name in your forum root, and where should that come frome?

You need to create an actual, physical css file in your file system and link to that properly.

Made a css file with the same name and popped it into clientscript/vbulletin_css, changed the filepath and it worked like a charm =p

Keeps all my styles and runs the needed css.

:up:

Black Snow
01-14-2015, 02:24 PM
Follow this: https://vborg.vbsupport.ru/showthread.php?t=315845

Start from the section titled: Custom Plugin & Template

Once you make the custom template, you can then make the plugin. Or, you could paste the CSS code here or PM it to me, and I will add it to a plugin and upload the plugin for you to download. Then the CSS will be added to all styles you have installed without the need to edit any styles.