Jump to content

Recommended Posts

Posted

Hi All,
 
I'm playing around with the Blog Profile and I'd like to figure out the best way to add an image file (ex: a signature) at the bottom of every post. What I love about Processwire is that most times, there is no one way to do things. This also means that I wonder how others are doing it.
 
I've tested my solution by adding:

<?php echo "<img src='http://lorempixel.com/200/200/people/9'>"; ?>

 to the bottom of the .postbody div in post.php. To have a signature (image file) in it's place, I'm unsure if I should create a field, insert it into the post template, etc. or use a different method? Thoughts?

Thanks for any and all help and feedback.

Posted

I certainly don't see anything wrong with your approach, but if you set up a settings page in the admin and added a "signature_image" field to it, it would be easier for you / your clients to change this image in the future. Then you could simply echo the image in the same place using:

$pages->get("/settings/")->signature_image->url();

  • Like 3
Posted

adrian,

That worked like a charm and seems like the most efficient way of doing it. Thanks for the help.

  • Like 1

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
×
×
  • Create New...