• 0

DMS 2 Adding Sections in Child Theme Folder Doesn't Work


Question

Posted · Report post

I attempted to modify the Masthead section by duplicating it to my Sections folder that I made in my Child - Skeleton theme. 

After making changes to the LESS in the Masthead folder in my  Child Theme / Sections folder, the changes were not seen upon save and refresh. 

 

Could this be due to the strange (to me) folder structure that I see in wp-content/themes/DMS? There are two dms folders and two Sections folders as automatically installed in wp-content/themes. See screenshot here: http://screencast.com/t/Q4s3ZW4g

Is this install how the folder structure should actually be?

 

If the above is indeed correct, can you please tell me how I can get my sections in my child theme to be "seen" and to take precedence over the DMS theme sections?

 

Thanks,

Bruce

 

 

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

Posted · Report post

If you only want to make simple changes then you can add your custom CSS or LESS CSS to correct file in your child theme. For example.

 

If you only plan on using standard CSS, then you add all this into your child themes style.css file.

If you plan on using LESS CSS and standard CSS, then you add this to your style.less file. The style.less file supports both.

 

Also, if all you want to do is override some aspects of a sections CSS, then you don't really need to make a child section. You can just override the CSS and add it to either the Custom > CSS/LESS Editor in the DMS Toolbar or use the style.css/style.less file. The main purpose of being able to create a child of a section is so that you customize all aspects of it, such as adding your options etc...

 

If you want to simply override a specific element then you don't really need to do it, but you can if you like. To override the default CSS without the need to create a child theme, see our documentation here - http://docs.pagelines.com/customize/overriding-default-css

2 people like this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi @Blafred1345

 

Did you reload the sections afterwards? 

 

How have you set up the Child theme - could you provide a screenshot of the file structure. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

I am unable to recreate your issue, here is what I did.

 

1. I uploaded Skeleton to my test site

2. Activated it as a the main theme.

3. Created a sections folder in the Skeleton directory.

4. Copied the masthead folder from the DMS sections folder and pasted into the sections folder in my Skeleton theme.

5. Went to the sections.php file for the Masthead sections in Skeleton >> Sections and replaced the following from Section: Masthead to Section: Danny Masthead

6. Saved those changes and then went to my website, clicked on Add to Page and Reload Sections button. When the site reloaded, my Danny Masthead section was visible.

 

https://cloudup.com/c_DcBxE_ppo

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Danny

 

I was able to follow your methods above, with the same results as you. 

I think what happened originally was I had previously put the DMS Masthead section on my page. I then made a change to the Skeleton Masthead section in LESS, and expected the Skeleton Masthead LESS to over-ride the DMS Masthead section. Which it didn't.

What I believe you are saying is the correct way to do this is to first make the Skeleton section, then place that section (ie Danny Masthead) into the page, then make LESS changes in the Skeleton Masthead style.LESS. 

Did I understand you correctly?

 

Thanks,

Bruce

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Bruce, that is the correct process. Once you have created your own child section within the child theme you can make any changes to the style by adding your code into the style.less within the child theme. This will be compiled with the main css and override the core code.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for the help!

 

It sounds like since I'm only overriding CSS, that my best bet is not to bother with creating a duplicate section in my Child Theme, and instead just using my style.LESS to override.

 

I appreciate the clarifications.

 

-Bruce

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

No problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now