Page 1 of 1
Adding page banner graphic to More Info pages
Posted:
Mon Oct 10, 2011 11:35 am
by nsd999
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
Re: Adding page banner graphic to More Info pages
Posted:
Mon Oct 10, 2011 1:40 pm
by Jim
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.
Re: Adding page banner graphic to More Info pages
Posted:
Mon Oct 10, 2011 2:15 pm
by nsd999
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
Re: Adding page banner graphic to More Info pages
Posted:
Mon Oct 10, 2011 2:28 pm
by Jim
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.
Re: Adding page banner graphic to More Info pages
Posted:
Tue Oct 11, 2011 10:53 am
by ShopSite Lauren
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 --].
Re: Adding page banner graphic to More Info pages
Posted:
Tue Oct 11, 2011 11:19 am
by nsd999
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
Re: Adding page banner graphic to More Info pages
Posted:
Tue Oct 11, 2011 9:20 pm
by Jim
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.