Jump to content

[SOLVED] Easy Way to Add a Text or Graphic Message to Every Page?


deepee

Recommended Posts

Hi All

I'm running the standard prestashop template currently on Version 1.2.4.0 and want to add a short message showing the dates we'll be shut over the Christmas holidays.

I'm thinking the blank white space to the right of my logo would probably be the best spot.

Any recommendations on the easiest way to accomplish this?

Thanks
deepee

Link to comment
Share on other sites

I always add my holiday message on my contact form and in my forum signature. It doesn't seem to stop people contacting me though. I get just as many orders and work requests when I have the holiday message as when I don't.

To add a holiday message in the header, I suggest adding code like the following to header.tpl in your theme's directory in the header div:


{l s='Your holiday message goes here'}



Then add CSS like the following to position it wherever you like:

div#header p#holiday_message {
  position: absolute;
  left: 50px;
  top: 20px
}



Change 50px to how far from the left of the header you want the message and 20px to how far from the top of the header.

I think you may also need to add position: relative to the header div in your global.css for it to work.

Link to comment
Share on other sites

Hi Rocky

Yes, it seems nobody reads the messages in the contact form!

Last year I modified an image in the "Block Advertising" module to contain the message.
Trouble is, this block gets picked up by anyone using an adblocker and doesn't display.

Which lines, after and before, should your first piece of code go?
Does the second piece of code go directly below it?

Thanks
deepee

Link to comment
Share on other sites

Excellent Rocky, that works!

It currently appears above my logo and extends across the top of * contact * sitemap * bookmark and the search bar.

How do I get it below these elements and to the right of the logo so it's more prominent?

Thanks
deepee

Link to comment
Share on other sites

  • 2 weeks later...

Thanks to all for the feedback.
I really needed it to be viewable on all pages and managed to work it using Rocky's instructions.

It left me thinking it would be great to have a module that can insert a text or image box for this purpose and be easily configured from the back office, without the need to edit any code.

Link to comment
Share on other sites

  • 2 months later...

Soz guys, I got it to work but forgot to post the solution... Thanks Rocky!

Ok, my Header.tpl file looks like this:

>{$HOOK_HEADER}
   </head>

   <body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if}>
   {if !$content_only}
</pre>
<ul>{l s='This shop requires JavaScript to run correctly. Please activate JavaScript in your browser.'}</ul>
<br><div>

           <!-- Header -->


{l s='Toys | Cars | Shoes | Kids | Clothes | Bikes | Bags | Boards | Caps | Gloves'} 


                   {$HOOK_TOP}



           <!-- Left -->

               {$HOOK_LEFT_COLUMN}


           <!-- Center -->
<
Link to comment
Share on other sites

  • 13 years later...

In case somebody needs to add a quick message for the holiday and have Prestashop 8 like me, aside from a free pop module I added a text string in the header.tpl

Between the header_top block name and the div class header top right (line 74 for me)

It'll appear between the logo on the left and the search bar on the right, on every pages.

Link to comment
Share on other sites

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...