CB 2.0.3 Template CSS Overrides

5 years 3 months ago #253784 by nant
Our CB 2.0 Tutorials - 31 - CB Template CSS Overrides
video:

www.youtube.com/playlist?list=PLp0puRITgC7PuyzPsMUECDI46VE7IFSAX

makes use of this example template plugin:


File Attachment:

File Name: example.zip
File Size:167 KB
Attachments:
The following user(s) said Thank You: Coffeymate, securialert, autobahn
5 years 3 months ago #254369 by tjohns92109
Appreciate the help there. I actually have no problem with the CSS. I've just overridden any styles I needed to change in my main template CSS file. I wanted to make changes to the default.php file in order to include a module position inside the user list. Would I just copy the default.php file from the default template into the example template folder and alter that?

Actually, I just tried it myself and it doesn't seem to make a difference when I make changes to the default.php file that I copied over.

Back to my original question... I'm guessing it's not safe to make changes to default.php file inside the default template folder?
5 years 3 months ago - 5 years 3 months ago #254376 by krileon
No, you can't just copy default.php over. First the filename it self needs to be changed. For example if your template is the example template it'd become example.php. Next inside of the PHP file the classes have the template name in them for example "CBProfileView_html_default", which would become "CBProfileView_html_example".

I highly highly suggest leaving the PHP file alone. Anytime we make fixes to it you will not have those fixes and will likely be posting why XYZ doesn't work or why you're missing ABC feature and chances will be high it's because your template PHP file does not have the changes. For example next CB release is making some fixes to the template PHP file. If you supplied your own you would not have these fixes.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
5 years 3 months ago #254384 by tjohns92109
That's good info. Thanks!

That's probably also the explanation to why the custom template I created didn't work.

I'll probably take your advice for now and not touch the php file. If I really need to add code to it, I'll just put it in an include and leave a note for myself to re-add the include statement when I update CB.

Thanks again.
5 years 3 months ago #254400 by krileon
Depending on what you're changing you could do an include of the default template then extend the default template PHP classes. No idea how well that'd work, but could minimize how much code you have to replace. So for example if you only want to change 1 of the functions out of all the classes then an extend would be the best approach so it's only possible for that single function to go out of date. Then on upgrade it's just a matter of comparing the two functions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
5 years 3 months ago #254405 by tjohns92109
Also a great idea (if I end up needing to do it).

Thanks again!
Moderators: beatnantkrileon
Time to create page: 0.446 seconds

Facebook Twitter LinkedIn