Adding page banner graphic to More Info pages

Questions and answers about ShopSite Custom Templates

Adding page banner graphic to More Info pages

Postby nsd999 » Mon Oct 10, 2011 11:35 am

Hi all,

Is there any easy way to display my page banner in a more info page?

Adding:
<img [-- PAGE.Graphic REMOVE_HTML --] class="pg_img" align="none" style="width:768px; " >

to my DEFINE MORE_INFO_PAGE section gave me a template error.

I was able to get it working using a product extra field but I'd rather not have to set it for every product. Is there any easier way?

Thanks,
Joe
nsd999
 
Posts: 17
Joined: Thu May 05, 2011 12:05 pm

Re: Adding page banner graphic to More Info pages

Postby Jim » Mon Oct 10, 2011 1:40 pm

More info pages are defined in the product template and therefor have no access to Page database fields.

You can define a background image to use on moreinfo pages under Preferences > More Info pages.
You can also enable the main store header and footer for displaying on more info pages on that same screen.
You could also hardcode the image into your custom product template in the [-- DEFINE MORE_INFO_PAGE --] section.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Adding page banner graphic to More Info pages

Postby nsd999 » Mon Oct 10, 2011 2:15 pm

Hi again Jim,

Thanks for the reply.

Each category page in our site has its own unique banner image. Is there any sneaky way of passing that image over to the DEFINE MORE INFO section?

As of now I added an extra product field called "mi_page_banner" with the hardcoded html image.. I can populate this via PowerEdit but I'd rather find an easier way if possible than change 2000+ products..

Any ideas?

Thanks,
Joe
nsd999
 
Posts: 17
Joined: Thu May 05, 2011 12:05 pm

Re: Adding page banner graphic to More Info pages

Postby Jim » Mon Oct 10, 2011 2:28 pm

I tried a couple of different ways to get a page image passed to the Moreinfo page but could not find anything that works.

As a side note, the moreinfo page only gets regenerated once during a publish cycle. If a product is assigned to multiple pages (or as a subproduct to another product) the moreinfo page will get generated the first time publish comes across a reference to the product. So passing an image from a page could result in a different image being displayed than you are expecting, if the product is a subproduct of another or the product is assigned to multiple pages.

The safest way to do it would be to use an image found in the product's data such as one of the extra product fields or a moreinfo image.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Adding page banner graphic to More Info pages

Postby ShopSite Lauren » Tue Oct 11, 2011 10:53 am

You can create a VAR tag in the page template, then use that VAR tag in the product template. For example, in the page template (just below the [-- DEFINE PAGE --] tag) you would add something similar to [-- VAR.BannerGraphic PAGE.Graphic --]. Then in your product more information page template, use [-- VAR.BannerGraphic --] in place of [-- PAGE.Graphic --].
- ShopSite Lauren
Contact me for help with any of your
custom ShopSite template questions.
ShopSite Lauren
 
Posts: 887
Joined: Fri Aug 11, 2006 1:35 pm
Location: Orem, UT

Re: Adding page banner graphic to More Info pages

Postby nsd999 » Tue Oct 11, 2011 11:19 am

Awesome, Lauren.

That's exactly what I was looking for.

One question though. I'm currently using:
Code: Select all
 <img [-- PAGE.Graphic REMOVE_HTML --] class="pg_img" align="none" style="width:768px; " >


This line doesn't seem to work (I guess the remove_html isn't valid here):
Code: Select all
        <img [-- VAR.BannerGraphic REMOVE_HTML --] class="pg_img" align="none" style="width:768px; " >


And this also doesn't work:
Code: Select all
[-- VAR.BannerGraphic PAGE.Graphic REMOVE_HTML--]


Any idea how to set the variable and still be able to style the image?

Thanks,
Joe
nsd999
 
Posts: 17
Joined: Thu May 05, 2011 12:05 pm

Re: Adding page banner graphic to More Info pages

Postby Jim » Tue Oct 11, 2011 9:20 pm

As I mentioned I tried all sorts of ways including the ones you tried. There just isn't a way to get the info that you want, in the form you want it, into the more info template without using the extra product fields. One possibility might be to use a [-- CALL .... --] method to parse the page.graphic value which is passed as a VAR and then use that to build the url. But unless you are a programmer or know someone who could do it for you it might be too difficult to attempt.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: Google [Bot] and 11 guests