How to make editable footer / page bottom block?

Permalink 1 user found helpful
Is there any way to make the footer as an editable block so that a non-programmer can simply go to Edit Page, click on the footer block and either edit it or add another block to it?

I (with some PHP/HTML experience) can change the footer to whatever, hard coding the template footer.php but this is not what I'm looking for.

Or alternatively how can I add a block to a bottom of the page so that it spans the whole page width and not just the width of the Main area?

linuxoid
 
jordanlev replied on at Permalink Reply
jordanlev
You've probably figured this out by now, but just in case...

Add this to your page type template:
<?php
$a = new Area('Footer');
$a->display($c);
?>


Put it wherever it needs to go depending on the html structure of your template. If you want it to span the whole width of the page, put it in a <div> that's outside your main content div, and set the width of that div to the width of the page via your stylesheet.

Hope that helps.

-Jordan
linuxoid replied on at Permalink Reply
linuxoid
Not yet. Sorry for being so dumb, but which file should this go into? Which page template file?

What's $c variable?
Mnkras replied on at Permalink Reply
Mnkras
$c is a global variable,

stick that code where you want the editable region
linuxoid replied on at Permalink Reply
linuxoid
I found it, all areas are in the theme's default.php.

Now that I've added my area to the footer, it appears in the Edit Page view, but how do I now make a link to Add stuff (blocks, content, etc.) to my new areas? The one above mine has 'Add to footer' link, the one I created are directly underneath it but there's no such link.

Thank you.
linuxoid replied on at Permalink Reply
linuxoid
Oh, my fault, forgot to change the area name (doh!). All's good now. Thank you.
JoHodges replied on at Permalink Reply
Hi

I also need to put across the whole of the bottom of a page ( Greek Yoghurt theme) with an image in it. I know nothing about the codes or where to put them.

Could anyone give me a step by step walk through as to what code to put where for a page with block on the home page?

many thanks

Jo
WHW1dotCOM replied on at Permalink Reply
I don't know why it was purposely made cumbersome to modify the footer section. This can be discouraging to users. I can only think it is an attempt to force control on that section with not allowing it to be easily modified and so forcing mention of Concrete5 in the footer section. Not exactly an open source way.
I guess my main point being that it could have easily been made so the footer was editable like other portions.

In any case, step by step:

I can only reference steps in relation to how Web Hosting With $1 (WHW1.com) installs and provides the hosting for Concrete5, but it should be good enough for most, if not all (even if with tiny modification in steps).

1. Go to hosting Control Panel.
2. Use hosting provided File Manager.
3. Via hosting File Manager, go to your Concrete5 Greek Yogurt installation folder.
4. Then go do the following sub folders ./concrete/themes/greek_yogurt/elements/ .
5. Make a copy of footer.php.
6. Edit the footer.php file (with the built-in File manager Code Editor; simply done by clicking the mouse right button on the file and choosing Code Edit).
7. Right after where you see it say <div id="footer">, add the following:
<?php
$a = new Area('Footer');
$a->display($c);
?>

8. Refresh/reload the Concrete5 page you are trying to edit, assuming you are in edit mode already, and you will see the full page range selection of Add To Footer show.


20120323 UPDATE:
You may want what you do int he Footer section to be sitewide. Meaning that you want a the change to show on all the pages.
In that case, instead of adding the code of step 7 above, then you would add this:

<?php
$a = new GlobalArea('Footer');
$a->display();
?>

If you wanted both sidewide and per page adding or modification ability, then here is what the modified footer.php code would look like:

<div id="footer">

<!-- 20120323-START-modify -->
<?php
$a = new GlobalArea('Footer');
$a->display();
?>
<!-- 20120323-END-modify -->

<div id="footer-inner">

<!-- 20120323-START-modify -->
<?php
$a = new Area('Footer-Inner');
$a->display($c);
?>
<!-- 20120323-END-modify -->
JoHodges replied on at Permalink Reply
Thanks for that - haven't tried it yet , but will do... I want to add
a footer across the whole of the bottom with funding logo's on. But
will this mean the original footer will still be there as it has the
'sign in' link on. If I replace the footer , how do I sign in to edit
the site?

Many thanks

Jo
WHW1dotCOM replied on at Permalink Reply
Yes, the sign-in and the copyright and what was there will continue to exist. Those are hard coded. Once you do that above, you will see.

If I recall correctly, to edit or remove the hard coded stuff, you would simply edit the php file referenced above.
For example that generic copyright statement may not be enough for you, and you may want something of your own or more legal statements added or a reflection of how far back the copyrighting go.