Re: Product Extra Fields for text, pdfs and flash
I just uploaded version 2 of this mod updated to 1.5.4. I do not know when it will be available.
Now included are 2 more text fields. I also added in an htaccess file for the product_extra_fields folder that limits the types of files allowed and protects the folder (see instructions). I have included sql files for installation, deletion and upgrade this time!
I looked at adding these fields into the search but simply didn't get far enough along that path. I plan on it later.
Anyone grabbing the new files, please let me know immediately if you run into any problems.
Re: Product Extra Fields for text, pdfs and flash
Hi,
Thanks for the great mod. I am using it to show an advice centre in a sidebox. I have a problem though if anybody can help me? The sidebox was working fine until I put it in the same column as another sidebox, doing that causes the entire page layout to mess up.
I'm not very good with coding so I am thinking I have messed up the code in the sidebox template file.
Can anybody tell me how to put this code into a sidebox template file to make it work please?:
PHP Code:
<div class="files">
<?php if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) {
echo '<div class="filesHead">'.TEXT_PRODUCT_MORE_INFO.'</div><ul>';
}?>
<?php if($extra_field!='') {
echo '<li>'.$extra_field . '</li>';
} ?>
<?php if(isset($products_video_link)) {
echo '<li>'.$products_video_link . '</li>';
} ?>
<?php if(isset($products_file_1_link)) {
echo '<li>'.$products_file_1_link . '</li>';
} ?>
<?php if(isset($products_file_2_link)) {
echo '<li>'.$products_file_2_link . '</li>';
} ?>
<?php if(isset($products_file_3_link)) {
echo '<li>'.$products_file_3_link. '</li>';
} ?>
<?php if(isset($products_file_4_link)) {
echo '<li>'.$products_file_4_link;
}
if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) {
echo '</ul>';
}
?>
</div>
I am using the editable sidebox module as a template, so here is the template I need to insert it into:
PHP Code:
<?php
/**
* editable sidebox - allows a sidebox editable with the define pages editor to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-08-10 kuroi $
*/
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
// this is where the content that you have via the Admin is pulled in.
$content .= file_get_contents($define_sidebox);
$content .= '</div>';
?>
Thanks
Re: Product Extra Fields for text, pdfs and flash
If it was working before you moved it then perhaps you need to look at the other sideboxes. Sounds like something is missing a div tag and I don't see that in the code you've posted.
Re: Product Extra Fields for text, pdfs and flash
Hi
Yeah, that's what I thought originally. So I turned off and on the sideboxes, including standard zen cart sideboxes, and it doesn't work with any of the sideboxes. I also had a look at the stylesheet to see if there are any problems there, but there is nothing amiss.
I know the sidebox templates follow a different format from what I have read, it doesn't just work by copying and pasting the product_info template code that you kindly provided, but I am having a hard time translating it into the sidebox template.
This is the code that I came up with:
PHP Code:
<?php
/**
* editable sidebox - allows a sidebox editable with the define pages editor to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-08-10 kuroi $
*/
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content = file_get_contents($define_sidebox);
$content .= '<div class="adbox">'.$extra_field .'</div>';
$content .= '<div class="adbox">' .$current_categories_description_sub .'</div>' ;
$content .= '<div class="adbox">'.$products_file_1_link . '</div>' ;
$content .= '<div class="adbox">'.$products_file_2_link . '</div>' ;
$content .= '<div class="adbox">'.$products_file_3_link . '</div>' ;
$content .= '<div class="adbox">'.$products_file_4_link . '</div>' ;
// this is where the content that you have via the Admin is pulled in.
$content .= '</div>';
?>
But I have no idea if it is right, or has any errors? I just know that it breaks when I put the sidebox in the same column as any other sidebox.
Thanks
Re: Product Extra Fields for text, pdfs and flash
So you have never gotten the sidebox itself working, just the code on the product info page? You don't want that sidebox showing on any other page so that also requires a bit of coding otherwise it will show a blank box on other pages.
If the sidebox was showing correctly then it would not need editing. If you'll put it back where it was working, I can take a look at the page.
Re: Product Extra Fields for text, pdfs and flash
Hi,
Thanks for the help, I have managed to get it working now :smile: You was right about the div tag, there was an extra closing div tag in the source code, so I deleted the last div tag in the editable sidebox module and it is now working on the test site.
Thanks again
Re: Product Extra Fields for text, pdfs and flash
I just sent my newest version for approval. You can now display these extra fields on a tab if you are using Tabbed Products Pro v.1.10. If you want the files before they are approved, pm me.
Re: Product Extra Fields for text, pdfs and flash
I don't see anything referring to the admin directory.
I renamed the admin directory to my admin folder name as well as the custom template. My admin was no longer accessible, and have now restored from backup.
ZC1.5.4
Re: Product Extra Fields for text, pdfs and flash
When you say that the admin was "no longer accessible", what symptoms were you seeing? Were there any debug-log files generated?
Re: Product Extra Fields for text, pdfs and flash
Quote:
Originally Posted by
lat9
When you say that the admin was "no longer accessible", what symptoms were you seeing? Were there any debug-log files generated?
My admin crashed - it was like I had corrupted the admin directory and the "site" didn't exist. I didn't take a screenshot., sorry.
Where might I find the debug-log files?