Forums / Templates, Stylesheets, Page Layout / How can I put an image into main page template?

How can I put an image into main page template?

Views: 2,439

Results 1 to 16 of 16
17 Feb 2016, 9:30 PM
#1
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

How can I put an image into main page template?

I'm not having much luck searching around, experimenting with templates and even trying to find an easy plugin that might work with my version of ZenCart.

All I want to do is insert a facebook image that is clickable to my client's facebook page for his shop into the top of the main page.

Can anyone tell me what template to tweak without it breaking the site? (I have gremlins in my fingers)

The red X is where I would like the image.
The code I'd like to insert looks like this:

<a href="https://www.facebook.com/redbodiesautojumble/"><img src="images/xxxx/facebook.png" alt="follow us on Facebook" /></a>

I have a larger image in the side boxes but those rotate with the other images. I would like something static.

Attachment 16056

17 Feb 2016, 10:18 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How can I put an image into main page template?

My first thought is:
includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

If that file is not there, then copy from the template_default directory (subsituting that into YOUR_TEMPLATE) and put the copy in your template's equivalent file path.

Then surround the image with applicable css related coding so that you can manage the exact position as necessary through the applicable stylesheet(s) and css...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

17 Feb 2016, 10:18 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How can I put an image into main page template?

My first thought is:
includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

If that file is not there, then copy from the template_default directory (subsituting that into YOUR_TEMPLATE) and put the copy in your template's equivalent file path.

Then surround the image with applicable css related coding so that you can manage the exact position as necessary through the applicable stylesheet(s) and css...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

17 Feb 2016, 10:30 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How can I put an image into main page template?

In a copy of tpl_main_page.php for your template at about line 149 add this in red

<table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper">

  <tr>
  <div id="facebook"><a href="https://www.facebook.com/redbodiesautojumble/"><img src="images/facebook.png" alt="follow us on Facebook" /></a></div>

<?php

if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {

  // global disable of column_left

And in your stylesheet at the end add this

#facebook {
	float: right;
	}

Make sure that you have the image uploaded also

Zen-Venom Get Bitten

18 Feb 2016, 12:28 AM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How can I put an image into main page template?

For consideration may want a span instead of div tag, but that all depends on how the new image fits into the overall theme, etc. At least a method has been provided of where it can go to be presented. Perhaps later once it is applied you would share the web address if more mod is needed to get it set as desired.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 Feb 2016, 1:52 PM
#6
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

Re: How can I put an image into main page template?

Awesome! Thanks everyone. I'll give this a try in a little bit and let you know how it works out.

The URL is fine to have. He just needs to start putting photos into his items for sale! I really didn't make a custom theme, just tweaked the CSS a bit to the color scheme he wanted.

http://redbodiesautojumble.co.uk

18 Feb 2016, 2:22 PM
#7
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

Re: How can I put an image into main page template?

kobra:

In a copy of tpl_main_page.php for your template at about line 149 add this in red

<table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper"> <tr> <div id="facebook"><a href="https://www.facebook.com/redbodiesautojumble/"><img src="images/facebook.png" alt="follow us on Facebook" /></a></div> <?php if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) { // global disable of column_left ``` > And in your stylesheet at the end add this > ``` #facebook { float: right; } ``` > Make sure that you have the image uploaded also PERFECT! Thanks!
18 Feb 2016, 4:11 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How can I put an image into main page template?

Twitchin Kitten:

PERFECT! Thanks!

FYI, now seeing how it was applied there are plugins that offer to put the facebook button on the page, some in a sidebox, others elsewhere. By using a sidebox you wouldn't lose that space that is now taken up by the div tag along the "first row". Such plugins include:
https://www.zen-cart.com/downloads.php?do=file&id=1550
https://www.zen-cart.com/downloads.php?do=file&id=1716
https://www.zen-cart.com/downloads.php?do=file&id=1821
https://www.zen-cart.com/downloads.php?do=file&id=1976

Additionally, many themes include at least a facebook option in addition to. Other social media options...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 Feb 2016, 5:38 PM
#9
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

Re: How can I put an image into main page template?

mc12345678:

FYI, now seeing how it was applied there are plugins that offer to put the facebook button on the page, some in a sidebox, others elsewhere. By using a sidebox you wouldn't lose that space that is now taken up by the div tag along the "first row". Such plugins include:
https://www.zen-cart.com/downloads.php?do=file&id=1550
https://www.zen-cart.com/downloads.php?do=file&id=1716
https://www.zen-cart.com/downloads.php?do=file&id=1821
https://www.zen-cart.com/downloads.php?do=file&id=1976

Additionally, many themes include at least a facebook option in addition to. Other social media options...

Thank you! I'll have a look into those. I run forums and setting up those little "extras" are easy, but on the carts I find it a bit overwhelming as I do not code and I do a lot by trial and error.

One more question if you will? For the life of me I cannot find where to add a contact link in the header or footer. I see one in the "more information" side box but it's not very obvious. I'd like a static link next to or floating right of "home" at the top and bottom of the page as well.

18 Feb 2016, 5:57 PM
#10
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

Re: How can I put an image into main page template?

Hmm... had a look at those and I think I'm going to leave the facebook thing as it is until it gives me some trouble. these are used parts and really don't require all that stuff in the plugins on each individual page. Plus the site owner would lose his mind if there were trouble and I were not around. For him simple is best.

He neglected to fill out a lot of info re pages and stuff. I'm banging my head against a wall trying to figure this all out.
The EZ-pages manager isn't helping as there is nothing in there and those extra pages are showing in side boxes that he just isn't going to use. It says to put the page ID to omit but I'll be damned if I can figure this out.

19 Feb 2016, 9:42 AM
#11
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: How can I put an image into main page template?

One more question if you will? For the life of me I cannot find where to add a contact link in the header or footer. I see one in the "more information" side box but it's not very obvious. I'd like a static link next to or floating right of "home" at the top and bottom of the page as well.

You need to edit the tpl_header.php
It is in includes/templates/YOUT_TEMPLATE/common folder, if you don't see it there make a copy of it from includes/templates/template_default/common and place it in includes/templates/YOUT_TEMPLATE/common

Once done that add the following

<li><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>">Contact</a></li>

right after

<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>

He neglected to fill out a lot of info re pages and stuff. I'm banging my head against a wall trying to figure this all out.
The EZ-pages manager isn't helping as there is nothing in there and those extra pages are showing in side boxes that he just isn't going to use. It says to put the page ID to omit but I'll be damned if I can figure this out.

Just go to:
admin >>> tools >>> layout boxes controller
and disable sideboxes/more_information.php

19 Feb 2016, 1:10 PM
#12
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

Re: How can I put an image into main page template?

keneso:

You need to edit the tpl_header.php
It is in includes/templates/YOUT_TEMPLATE/common folder, if you don't see it there make a copy of it from includes/templates/template_default/common and place it in includes/templates/YOUT_TEMPLATE/common

Once done that add the following

<li><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>">Contact</a></li> ``` > right after > ```php <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li> ``` > > > > Just go to: > admin >>> tools >>> layout boxes controller > and disable sideboxes/more_information.php

awesome, thanks!

29 Feb 2016, 12:04 AM
#13
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How can I put an image into main page template?

If he/she were my customer, I would be asking WHY they want such a prominent out-bound link on the zencart store anyway...

Why invite your (usually hard-earned) visitors to LEAVE the webshop to go natter and gossip? Forrester's Research shows that once gone, only 20% or less will return.

Putting OUTBOUND links - even to a Social Page - on an ecommerce site is like standing at the door of your shop, and when customers try to come in, you say... "Actually, the Bar across the road is where it's all happening... Go there instead."

Outbound links on a webshop ? DUMB idea...

20 years a Zencart User

29 Feb 2016, 1:17 PM
#14
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

Re: How can I put an image into main page template?

schoolboy:

If he/she were my customer, I would be asking WHY they want such a prominent out-bound link on the zencart store anyway...

Why invite your (usually hard-earned) visitors to LEAVE the webshop to go natter and gossip? Forrester's Research shows that once gone, only 20% or less will return.

Putting OUTBOUND links - even to a Social Page - on an ecommerce site is like standing at the door of your shop, and when customers try to come in, you say... "Actually, the Bar across the road is where it's all happening... Go there instead."

Outbound links on a webshop ? DUMB idea...

He's not selling anything on his social page. He is using it to direct people to the shop. He belongs to many clubs related to his shop on social media and he's doing the right thing in this instance.

7 Mar 2016, 6:58 PM
#15
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How can I put an image into main page template?

Twitchin Kitten:

He's not selling anything on his social page. He is using it to direct people to the shop. He belongs to many clubs related to his shop on social media and he's doing the right thing in this instance.

What's the point of a "social page" within an ecommerce store? Gossiping should take place away from the store. To me (supported by the best research by many seasoned consultants and research houses) the only thing that needs to happen on an ecommerce site is product showcasing, and selling. The social websites - Facebook, Twitter, etc (if you're in business) should have a similar objective - to HARVEST prospective customers to lure them towards checkout. By the time people reach the web store, there is only one objective - to get them to share some of their wallet with you.

Your client would do well to read some of the many articles on how to leverage social media for commercial gain. Providing superfluous gossiping areas and linkbacks to social media on the ecommerce site has the net effect of losing customers - not gaining them.

20 years a Zencart User

7 Mar 2016, 10:00 PM
#16
twitchin_kitten avatar

twitchin_kitten

New Zenner

Join Date:
Jun 2012
Location:
USA
Posts:
18
Plugin Contributions:
0

Re: How can I put an image into main page template?

schoolboy:

What's the point of a "social page" within an ecommerce store? Gossiping should take place away from the store. To me (supported by the best research by many seasoned consultants and research houses) the only thing that needs to happen on an ecommerce site is product showcasing, and selling. The social websites - Facebook, Twitter, etc (if you're in business) should have a similar objective - to HARVEST prospective customers to lure them towards checkout. By the time people reach the web store, there is only one objective - to get them to share some of their wallet with you.

Your client would do well to read some of the many articles on how to leverage social media for commercial gain. Providing superfluous gossiping areas and linkbacks to social media on the ecommerce site has the net effect of losing customers - not gaining them.

Thank you for your concern and I'll pass along the information to him.