Master Pages and Optional Stylesheets

I am working on a project and using one master page. I have the header and footer areas marked out as common in the master page with an editable content div between them. On some of the derived content pages I want to omit one or two unused stylesheet and/or javascript references to improve performance.

I’m not having much luck and wondered if Pinegrow has a method or workaround for achieving this? Any help or advice would be greatly appreciated.

Open your page and then in the Styles panel, click the word Stylesheets with the dropdown arrow at the top left. This will open the list of stylesheets and you’ll see two buttons - Manage and Refresh. Clicking the Manage button will open a window with a list of all the stylesheets currently in use, and after each you should see a link allowing you to detach it from the open page. This will delete it from the HTML.

Alternately, you can just manually edit the HTML that references the location of the stylesheet you want to eliminate.

Printninja, that worked. I was concered that updating open pages or whole project would cause child pages to have their stylesheet entries overwritten by the master page but that, as you have clearly and kindly explained, is not the case. Easy when you know how I guess and I salute your excellent knowledge of the product.

I’d figured out the remainder of the product but was stuck on this last issue. Thank you so much, it helped me a lot and I am genuinely most grateful that you were kind enough to help a fellow Pinegrow user having difficulty. Best of luck to you and thanks once again, you are a legend and may good karma come your way.

I was also having the same dilema with scripts but I guess it’s easy enough to add an editable div at the foot of the page to enable an area to enter optional script tag entries. I can’t, offhand, think of a better way of managing optional scripts in child pages.

Hi Printninja, in addition to my last comment, I just had a problem. I removed some stylesheet references from the child of a master page and, on the first occasion, the changes survived me selecting “Update the whole project” from the Component menu option. However, on the second occasion, the stylesheet references were re-added, as per their presence in the master page.

One would have thought that this would have worked but this presents a problem if updates are overriding and re-adding stylesheets that have been removed in the manner that you suggested. Bizarrely, the stylesheets are still shown as being absent when I go and check them from page manage stylesheets, there they still are in the child page.

Has this been a problem for you also? I’d be very intertested to know. I’m using the latest version of Pinegrow PRO.

HI there @SouthCoder, well, if they haven’t already noticed it here, it might be worth posting it (or linking to, as its already well explained) in the #general:bug-reports channel too.

And well done both, either way :slight_smile:

2 Likes

Thanks, @schpengle, much appreciated and I will report it now in bug reports.

2 Likes