![]() |
put content of Extra Field into the <head> ?
I'm building a site in 4.4.4 and I have to use an audio player on each product page that is HTML5 compliant (with flash fallback).
Considering 42% of my customers use an iPad or iPhone to read my marketing emails (stat thanks to mailchimp!) - only having a flash/swf dependent audio player will be stupid. SO many great audio players, but not very many are HTML5 compliant, and can embed an audio player for iPad or iPhone (without popping up the quicktime player, which I do not want!) I found jPlayer jplayer.org/ - and that seems to do the trick, but it wants the /path/to/audio/content to be placed in a script in the <head> Is this even possible with x-cart? I thought extra fields had to go into the <body>, yes? Has anyone every put an extra field into the <head> section? How? Examples? Thanks, J PS -- if anyone has a better solution for an audio player??? -- I need an audio player that is: iPad/iPhone compliant (to embed) and has a flash fallback for non-HTML5 browsers. .ogg or .m4a or .mp3 for audio, and each product will have Extra Fields with the path to the audio files. Surely this is a wheel that doesn't have to be invented? Thanks. PPS -- looks like jPlayer CAN have the player <script> in the page <body> -- so that means Extra Fields will work here... it';s gonna be a late night! :-) |
Re: put content of Extra Field into the <head> ?
Everything assigned to smarty from the php scripts is available immediatelly in the template(s) being called after the execution of that php script so yes you can access the extra fields info in the head section of home.tpl just like you will access it in the body section.
|
Re: put content of Extra Field into the <head> ?
Quote:
Really? Cool. For some reason I thought the Extra Fields module content was not available to home.tpl, and only to product.tpl (now product_details.tpl) I'll try this now. Thx J |
Re: put content of Extra Field into the <head> ?
Well that's a different story. Extar fields may not be available on some pages for example they are not on static pages but they are available on product details page and I think now even on products list pages by default, you'll be ok
|
Re: put content of Extra Field into the <head> ?
Quote:
|
Re: put content of Extra Field into the <head> ?
Thanks for the explanation. Makes total sense.
|
Re: put content of Extra Field into the <head> ?
I read this thread, and i am stunned, since i tried everything to get extra fiels in other pages than product pages. I need it in Product_list but it wont show up the way it shows up in product pages.
Maybe i am doing something wrong? |
Re: put content of Extra Field into the <head> ?
You will need to get the variables brought in by products.php
Try this (untested, but it should work): in products.php BEFORE Code:
if (!empty($active_modules["Subscriptions"])) { Code:
if(!empty($active_modules["Extra_Fields"])) { ONLY work on backups. |
Re: put content of Extra Field into the <head> ?
Hi Carpediem....
I put ur code into it, didnt work :( Actually i took also the exact code from PRODUCT.PHP and put it in Products.php and product_list.php... None of them worked. |
Re: put content of Extra Field into the <head> ?
Maybe little explanation WHY?
I need it cuz i am using extra fields just to have a possibility to automise a product price per unit. example: i sell a box with 24 jars, set a prices for that, than want to display the UNIT price also. In the product page it works perfect with this code: Code:
{foreach from=$extra_fields item=v} In the extra field i put the amount of units in the box, then a little math: price divided bij amount of units. outcome = $perstuk. |
Re: put content of Extra Field into the <head> ?
What didn't work? How did you determine if the extra field variables were/were not available to the template?
In the 4.1 branch, you have to do some hoop jumping to see available variables... and there is a specific format for the variables... http://forum.x-cart.com/showthread.php?t=12718 |
Re: put content of Extra Field into the <head> ?
BTW i am working on a complete new website using xcart 4.4.4 and template MODERN LIVING
|
Re: put content of Extra Field into the <head> ?
Extra Fields have been available on the product listings page since 4.1:
http://forum.x-cart.com/showthread.php?p=118321#post118321 |
Re: put content of Extra Field into the <head> ?
Quote:
Well.... Not at my New 4.4.4 website with Tha xcart stores Modern Living template. |
Re: put content of Extra Field into the <head> ?
The custom skin you are using should not matter. On products list pages it is not
{foreach from=$extra_fields item=v} It would be {foreach from=$product.extra_fields item=v} Above assuming you are already inside {foreach from=$products item=product} Extra fields array is part of each product's array inside $products |
Re: put content of Extra Field into the <head> ?
Quote:
WELL WELL... That did the job lol. Sometimes xcart is difficult from its easyness.... <-- is that english?? LOL Thanks Anyway. |
All times are GMT -8. The time now is 08:30 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.