Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Modding the topic view
Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 28, 2015 - 10:46 am

If I wanted to change how the topic view looks...borders and what not, I know this is handled in the reboot.php, correct?  Do I need to make the changes in reboot.php and copy the whole file into the child styles folder?  

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 28, 2015 - 11:13 am

Hey Alex,

No, you should have a read on the Creating a Child Theme codex page..

If you're only changing CSS then your child theme stylesheet only needs to contain the changes.

For example, if all you want to do is change the colour of profile links in topic view, the only thing you would need in your child themes stylesheet is that one change, so the entire child theme stylesheet would look like:

/*  ================================================
    This is the Reboot Child Theme CSS file
    ONLY add the CSS rules that you need to override
    the main rules form the parent Unified theme.
==================================================== */

#spMainContainer .spTopicPostSection .spUserSection .spProfilePopupLink {
    color: red;
}

This is loaded after the parent reboot.php so it overwrites the original rule but nothing else.

Also, your child theme stylesheet is as standard a CSS doc so it can only contain CSS and not PHP variables as the original reboot does, unless you want to change the extension to .php and also update the child theme stylesheet name in spTheme.txt in the root of your child theme.

Just to add, we are aware the text at the top of the child theme stylesheet says 'Unified theme' and we have a ticket open to update them.

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 28, 2015 - 11:39 am

I'm not understanding it correctly it seems.  

So let's say I wanted to change this:

#spMainContainer .spTopicPostSection {
  1. color: #000;
  2. background: #F8F3EE;
  3. border: 1px solid rgba(0,0,0,0.2);
  4. margin: 0px 0px 5px 0px;
  5. overflow: hidden;
  6. padding: 4px;
  7. position: relative;
  8. width: 100%;
  9. -webkit-box-sizing: border-box;
  10.  

    -moz-box-sizing: border-box;

  11. box-sizing: border-box;
  12. display: flex;
  13. display: -webkit-flex;
}
 
And I want to remove the border.  Don't I just need to add this in the theme editor.
 
#spMainContainer .spTopicPostSection {
  1. color: #000;
  2. background: #F8F3EE;
  3. margin: 0px 0px 5px 0px;
  4. overflow: hidden;
  5. padding: 4px;
  6. position: relative;
  7. width: 100%;
  8. -webkit-box-sizing: border-box;
  9. -moz-box-sizing: border-box;
  10. box-sizing: border-box;
  11. display: flex;
  12. display: -webkit-flex;
}
 
So it should look like this?
 
/* ================================================
This is the Reboot Child Theme CSS file
ONLY add the CSS rules that you need to override
the main rules form the parent Unified theme.
==================================================== */

#spMainContainer .spTopicPostSection .spPostUserAvatar img { width: 75px; }

#spMainContainer .spTopicPostSection {
color: #000;
background: #F8F3EE;
margin: 0px 0px 5px 0px;
overflow: hidden;
padding: 4px;
position: relative;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: flex;
display: -webkit-flex;
}

 
 
Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 28, 2015 - 11:52 am

You're some of the way there.. You need to think of CSS a bit differently.

The #ID and .Class (i.e '#spMainContainer .spTopicPostSection') can be re-used over and over again with different rules but those rules in every instance of the ID's and Class will always exist. When using the same rule such as 'color' it's only the last instance of the color rule that will be applied.

Think of it like stacking blocks..

So if you had this as your child theme stylesheet:

 

/* ================================================
This is the Reboot Child Theme CSS file
ONLY add the CSS rules that you need to override
the main rules form the parent Unified theme.
==================================================== */
 
#spMainContainer .spTopicPostSection {
    border: 1px solid red;
}

#spMainContainer .spTopicPostSection {
    border: 1px solid black;
}

#spMainContainer .spTopicPostSection {
    border: none;
}

then you would end up with a topic post section that had no border.

Basically, there's no need to include all the rules that already exist in the parent theme so your child theme stylesheet just needs to have:

/* ================================================
This is the Reboot Child Theme CSS file
ONLY add the CSS rules that you need to override
the main rules form the parent Unified theme.
==================================================== */

#spMainContainer .spTopicPostSection .spPostUserAvatar img { width: 75px; }

#spMainContainer .spTopicPostSection {
    border: none;
}

All the other rules for spTopicPostSection will still exist in the parent, but by removing the border rule it just picks it back up from the parent. By adding border: none; it overwrites the parent border rule.

Does that make sense? I never was that good a teacher!

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 28, 2015 - 12:07 pm

OK, I was placing all the code with the changes.  Basically, I just need to add or remove (by specifying none...etc) the code in the theme editor.  It wasn't taking effect because I needed to clear my cache.  

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 28, 2015 - 12:13 pm

You've got it..

And if you're having cache problems while editing CSS, you should always be able to disable the cache in the browser options, or if anything set the cache size to 0kb.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626