Editable Header/ Footer For Clients

Hey there, I just purchased PulseCMS and am running into some problems making the header/ footer editable for clients.

I can’t figure out how to make the header/ footer editable from the admin panel. I was originally thinking I could turn them into blocks but that didn’t quite work. I have contact information in the header that I want clients to be able to edit if they need to, but it could be any information really.

Also, this is a bigger problem then it seems because if the client updates their contact information, then it should update everywhere on the site.

Is there a way to set this up in Pulse? Any help would be appreciated.

Hi @Escendrix,
Assuming you are using Pulse 4 you can embed blocks anywhere in your site by either placing the block shortcode in a page, block or blog post. Your short code will look something like this

{{block:my-block-name}}

and will be replaced by the block content when the page is rendered.

You can only use shortcodes like this when adding blocks within Pulse (to pages, blocks or posts). Typically this part of the template is rendered using the following PHP call;

<?php echo $parsedown->text($content); ?>

If you want to pull in content blocks (or galleries) from outside of this main content region then you’ll need to do it using the old (Pulse 3) way;

<?php include("content/blocks/my-block-name.txt"); ?>

I hope this helps. If not please reply and I’ll try again. :slight_smile:

1 Like

Great explanation there Tim - that should go in the docs!

I have a similar problem. My client wants to edit the header, too, but each page should be editable individually; in other words: not the same header for all pages.

So my question is: Is there any possibility for multiple content areas, like

<?php echo $parsedown->text($content_1); ?>
<?php echo $parsedown->text($content_2); ?>

or whatever? Otherwise, I guess I would have to put code from the layout.php file into the backend stuff (pages), but I fear that would be quite confusing and inelegant.

Multiple templates?
See here about those…

https://www.pulsecms.com/docs/template

Yes, this could be the solution, I will try it out, thank you.

On the other hand, one template for each page is a bit circumstantial if you have dozens of pages, in my opinion; multiple content renderings would make the system more flexible. I find such flexibility in concrete5 that I often use, but that is database-driven and an overkill in some cases. What I like with Pulse is its slimness and easy handling, and too many features would make it too fat, I guess.

1 Like

Most of my clients don’t touch the pages section of Pulse as the raw layout code scares them. They typically stick editing blocks and only ever tend to dip into the pages section to adjust things like page titles etc.

It would be good to see Pulse introduce something a bit more client friendly for pages (sub templates, layout builder, etc) so that simple structural changes could be made (add a sidebar, another column etc) without having to chop the code about.

2 Likes

Completely agree Tim!

Pulse 5 has WYSIWYG on the pages - so it's just like editing a Block in Pulse 4.

And with Blocs app integration around the corner - the layout builder ideal is getting closer for the immediate future:

We're getting there and moving forward :wink:

1 Like

That’ll please the clients but depending on how they use it may end up scaring me! :slight_smile:

Good point - maybe we need to make this optional…

Scares me, too. Clients using WYSIWYG for structural or layout stuff … no, please not! They even do terrible things to simple text content sometimes.

But what about making Pulse a multiuser system? Two roles would do – admin and user/editor.

Yes it will be an option for the admin.

And yes - two roles will be released in 5. Admin (as now) and an Editor :slight_smile:

Great! Thank you, Michael!

Another solution for headers (and/or footers) per page;

<?php $requri = getenv('REQUEST_URI'); $page = implode("/",array_slice(explode("/",$requri),1,1)); switch($page) { case "": include("content/blocks/home/header-home.txt"); break; […] default: include("content/blocks/header-default.txt"); } ?>
1 Like

A nice solution @Torsten although I think you can drop the first two lines as $page should already be a Pulse 4 global variable.

1 Like

Nice solution @Torsten - I like it! :slight_smile:

1 Like

Thank you for the hint, @TimPlumb! Yes, it works without the first two lines.

This topic was automatically closed after 11 hours. New replies are no longer allowed.