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
Creating Child themes
Avatar
fiddlerman
Member
Free Members
sp_UserOfflineSmall Offline
Aug 29, 2016 - 10:12 am

Wondering if there should be any changes to this documentation seeing that it was written a while back?

https://simple-press.com/docum.....ild-theme/

I tried to create a child theme and it didn't work for me.

Also, if anyone would be so kind as to have a look at what I did, I would appreciate it. I'm not very good with this stuff.
https://www.dropbox.com/s/ryns.....e.zip?dl=0

"The richest person is not the one who has the most, but the one who needs the least."


Learn to Play Violin for Free - http://www.fiddlerman.com

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 29, 2016 - 10:17 am

I do tend to think we could do with perhaps a more basic version for the document but it is actually up to date and accurate as best we know.

While I see if I can look at your zip file why don't you tell us what you need and what you did...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 29, 2016 - 10:31 am

The only actual error I can see is that in the spTheme.txt file you have the 'Stylesheet' named as 'DefStacked.php' whereas it is actually called- and needs to be called 'DefStacked.css'.

However the .css file you have cerated there actually contains the original themes right-to-left (RTL) rules which I doubt it what you want! It is also screwing up the display alarmingly!

The point of a child theme is that you only need to include the items you want to change. So if you - for example - want to change 1 single icon, the images folder should only contain that one replacement icon. same with templates. 

What you appear to have done is copied everything which is more like a custom theme and will never have any components updated by us.

andy-signature.png
YELLOW
SWORDFISH
Avatar
fiddlerman
Member
Free Members
sp_UserOfflineSmall Offline
Aug 29, 2016 - 11:07 am

Thanks YS 🙂

Yellow Swordfish said
I do tend to think we could do with perhaps a more basic version for the document but it is actually up to date and accurate as best we know.
While I see if I can look at your zip file why don't you tell us what you need and what you did...  

I made changes a while back to the spTopicView.php. My page is very thin and the way I have it now with the columns makes it nice. Every time I update the theme I have to redo that. Last time I tried to update the Stacked Theme I couldn't correct it anymore using the same corrections as below.

I think you (Yellow Swordfish) did this for me way back in the day....
_____________________________________________

Let’s just got for it and you can see what you think. I don’t recall whether you already have a custom theme but after this you will need one – either custom or child.

So the theme template to edit – in the /templates folder of your SP theme – is spTopicView.php.

Find the section that starts with the comment: # User Info post row. You will see that it starts with the function sp_SectionStart(‘tagClass=spUserSection’); and ends with sp_SectionEnd(‘tagClass=spClear’);

Within that section locate the call to:

 

sp_PostIndexUserSpecialRank('tagClass=spPostUserSpecialRank spCenter');

 

We need to remove this line of code as it needs to be both modified and moved to a new location.

Now at the bottom of the section we need to add a break AND the function we have removed but with different arguments. So – the end of this section needs to look like this:

 

sp_ColumnEnd();
sp_InsertBreak();
sp_PostIndexUserSpecialRank('tagClass=spPostUserSpecialRank spCenter&stacked=0&showTitle=0&imgClass=spUserBadge');
sp_SectionEnd('tagClass=spClear');

This will centre your badges and remove the text label (necessary at the moment I am afraid). If you want them to be ranged over on the left then you will need to use:

sp_ColumnEnd();
sp_InsertBreak();
sp_PostIndexUserSpecialRank('tagClass=spPostUserSpecialRank spCenter&stacked=0&showTitle=0&imgClass=spUserBadge spLeft');
sp_SectionEnd('tagClass=spClear');

"The richest person is not the one who has the most, but the one who needs the least."


Learn to Play Violin for Free - http://www.fiddlerman.com

Avatar
fiddlerman
Member
Free Members
sp_UserOfflineSmall Offline
Aug 29, 2016 - 11:09 am

Yellow Swordfish said

The point of a child theme is that you only need to include the items you want to change. So if you - for example - want to change 1 single icon, the images folder should only contain that one replacement icon. same with templates. 

What you appear to have done is copied everything which is more like a custom theme and will never have any components updated by us.  

In that case, I want the Stacked theme to be updated except for the spTopicView.php 🙂

"The richest person is not the one who has the most, but the one who needs the least."


Learn to Play Violin for Free - http://www.fiddlerman.com

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 29, 2016 - 11:36 am

So - remove your new broken theme.
Download and install the Stacked Child There Framework.
For now - simply copy that one template from your current 'Stacked' theme to the same location in the 'Stacked Child Theme Framework' child theme.
That is ALL you need to copy from one to the other. Make your changes (if needed) to the one you just copied. And check it works.
Then we can talk you though what needs to be renamed,

By the way - I committed paging on PM threads today but it is going to need a lot of testing. And I do mean a lot as it has touched a lot of code...

andy-signature.png
YELLOW
SWORDFISH
Avatar
fiddlerman
Member
Free Members
sp_UserOfflineSmall Offline
Aug 29, 2016 - 3:13 pm

That was incredibly easy. WOW!

Thanks. I never realized that you guys had Theme Child Frameworks available to download for all the themes. That managed to slip by me. I was working off a duplicated older working theme that had the layout the way I wanted it. This makes way more sense to me. 🙂

Thanks so much for taking the time to explain this to an idiot. 

"The richest person is not the one who has the most, but the one who needs the least."


Learn to Play Violin for Free - http://www.fiddlerman.com

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 29, 2016 - 3:30 pm

🙂
So - can you handle the renaming bits? The main folder and the spTheme.txt is probably mostly what you need to change. That will prevent it being overwritten when we next do an update to the framework.

andy-signature.png
YELLOW
SWORDFISH
Avatar
fiddlerman
Member
Free Members
sp_UserOfflineSmall Offline
Aug 29, 2016 - 3:51 pm

I can rename them, but do I need to follow the instructions from the beginning now? Duplicate the folder and rename everything mentioned in the how to?

I actually thought I was good to go and didn't realize that the framework gets rewritten. LOL

Just rename the stacked-child folder? or duplicate it and rename it?
Then the spTheme.txt changing both the title and the stylesheet?

Thanks

Screen-Shot-2016-08-29-at-3.41.06-PM-1.pngImage Enlarger

"The richest person is not the one who has the most, but the one who needs the least."


Learn to Play Violin for Free - http://www.fiddlerman.com

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 29, 2016 - 4:06 pm

Just:

  1. Rename the folder from ;'tacked-child;' to whatever you prefer
  2. Open the spTheme.txt file in the newly renamed child folder and set the title (1st entry) to the name you have chosen. Remember this is case sensitive.
  3. Go to the forum admin > themes > and select the newly created child theme

and then you should be fine.

andy-signature.png
YELLOW
SWORDFISH
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: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625