Forum

Thread tagged as: Question

How can I overwrite the core/help without it being overwritten on upgrade?

How can I overwrite the core/help without it being overwritten on upgrade? I know I can set a help url, but I like the help page is within the back office with the little side bar help sections. How can I put my own help text in there?

Lisa Morena

Lisa Morena 1 points

  • 6 years ago

You'd have to copy the /help/ directory and paste it back in once you've updated core. Some defaults can be overriden in /perch/addons//plugins/ui/ but not /perch/core/help/, I don't think… Anything you change directly in /core/will always be lost on update.

I'd love to be able to tweak/override the default markdown suggestions in /perch/core/help/modes/markdown.post.php.

So I basically just need to make sure I paste in my customised help directory whenever I update... that's a pain in the backside as I am sure to forget that I changed it in the first place!

Drew McLellan

Drew McLellan 2638 points
Perch Support

The official method for customising the help is to change the help link to a page of your own via Settings.

Yes I know, but it's nice to keep it all within the backoffice....

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can add an app with a help.php file - those get imported into that page.

Each region can have its own <perch:help> block of course. Is that useful for you?

Yes I have been using lots of those! Just wanted to have a bit of an intro/ how to section that is more specific to what the regions do.

P K

P K 0 points

I too needed this, and after seeing Drew's post above about the help.php, the workaround became clear.

Hopefully a feature wish can be custom pages in the admin section for things like documentation or other content for editors to refer to (that doesn't get overridden on upgrade). The Perch admin area is by far the most convenient and logical place for custom site documentation.

Not pretty, but here goes...

Edit one of your app's help.php files (I used the Blog), and shove some javascript in there that replaces the contents of default help div with your own that you add to the bottom of the help.php file. You'll need to add jquery even though it's already on the page. Best to use your own fixed version rather then share the Perch copy, as a future Perch update may see Jquery updated.

Ideally, the Perch team hopefully will make the default help page a special editable region for editors so we don't have to do this!

<script src="/scripts/jquery-1.11.3.min.js"></script>
<script type="text/javascript">

$(document).ready(function(){
    var newHelpContent = $('#newHelp').html();
    $('.body .helptext').html(newHelpContent);
});

</script>

<div id="newHelp">
    <h2>New Help Section!</h2>

    <p>etc...</p>
</div>