Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Calling an HTML Scroll Bar, NEED php help

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-06-2003, 08:51 PM
 
lyle lyle is offline
 

Member
  
Join Date: Aug 2003
Posts: 11
 

Default Calling an HTML Scroll Bar, NEED php help

This is INSIDE my MAIN home.php

<IFRAME width="460" height="395" frameborder="yes" scrolling="auto" name="iframe" SRC="insert.php"></IFRAME>


now insert php has the call :
{include file="customer/home_main.tpl"}

this ISNT displaying, all I get is just the text inside the scrollbox...

HOW can I make a call to the template from this text/html box???

Ive been messing with this for far too long
thanks!
Reply With Quote
  #2  
Old 08-07-2003, 03:04 AM
  kpayne's Avatar 
kpayne kpayne is offline
 

X-Adept
  
Join Date: Dec 2002
Location: Firetanksoftware.com
Posts: 469
 

Default

Can you post the code for insert.php and / or a link to the site in question?
__________________
X-cart Featured Products Manager from http://www.firetanksoftware.com - Put your products where you want, how you want.
Reply With Quote
  #3  
Old 08-07-2003, 06:45 AM
 
lyle lyle is offline
 

Member
  
Join Date: Aug 2003
Posts: 11
 

Default

hey thanks
well the insert.php really has nothing, {include file="customer/home_main.tpl"} is the main part of it... the site is www.hempgirlz.com/xcart/customer/home.php

thing is im not sure what shape that page will be in Im making all kinds of changes etc

it *should* be there though and the reason I need the scroll bar is obvious when you get there I need all the items and functions to fit in my graphically driven site
ty!!!
Reply With Quote
  #4  
Old 08-07-2003, 07:30 AM
  kpayne's Avatar 
kpayne kpayne is offline
 

X-Adept
  
Join Date: Dec 2002
Location: Firetanksoftware.com
Posts: 469
 

Default

Well, "insert.php" is a php script, not a smarty template. You're trying to use smarty syntax outside of a smarty script.

Read up on the forums about smarty and you should be able to figure it out. If not, you can always post questions.

It's actually somewhat complex to get a new page with smarty to work like you're wanting it to. I, personally, would suggest finding a better solution, or posting in the smarty area of the forum exactly what look / functionality you're going for and seeing if anyone else has some examples.

I hope this helps!
__________________
X-cart Featured Products Manager from http://www.firetanksoftware.com - Put your products where you want, how you want.
Reply With Quote
  #5  
Old 08-07-2003, 08:53 AM
 
lyle lyle is offline
 

Member
  
Join Date: Aug 2003
Posts: 11
 

Default

kk
thanks and before i go too far into the depths of smarty stuff (really gotta get this site up

does this hold any water? am i on the right path at all with this post?
__________________________________________________ ______
AJ
Member



Joined: 17 Oct 2002
Posts: 25
Location: Marietta, Ohio
Posted: Fri Nov 22, 2002 11:35 am Post subject:

--------------------------------------------------------------------------------

Since I haven't seen anyone post a solution on this, I'll post a couple methods I'm using.

To include a php file in a Smarty .tpl file, just do this:

{include_php file="/pathtofile/file.php"}

This seems to work pretty well, assuming you don't need to use any variables from Smarty.

You can also use actual PHP code too! Just do it like this:

{php}
php code goes here;
{/php}

For this to work, you have to set the $php_handling variable to SMARTY_PHP_ALLOW in /Smarty-2.1.1/Smarty.class.php.

Hope that helps someone out there. Took me forever to figure it out. Now, if someone can tell me how to pass a Smarty-defined variable to an included PHP script, I'd love to hear it!
Reply With Quote
  #6  
Old 08-07-2003, 09:54 AM
 
lyle lyle is offline
 

Member
  
Join Date: Aug 2003
Posts: 11
 

Default

all im really trying to do is pull
customer/home_main.tpl into a scrollable document within my actual page

how is this best accomplished?
thanks
Reply With Quote
  #7  
Old 08-07-2003, 09:47 PM
 
slimmedia slimmedia is offline
 

Member
  
Join Date: May 2003
Posts: 23
 

Default

You're on the right track but you were trying to cut out too many steps.

Your IFRAME is calling "insert.php". So what you need to do is take most of the code from /customer/home.php and paste it into "insert.php". Then include a different smarty template instead of "customer/home.tpl".

Based on x-cart version 3.4.4, insert.php would look like this:
Code:
require "../smarty.php"; require "../config.php"; @include "./https.php"; require "./auth.php"; require "../include/categories.php"; if (!empty($cat)) require "./products.php"; require "./featured_products.php"; if($active_modules["Bestsellers"]) include "../modules/Bestsellers/bestsellers.php"; if(!empty($current_category)) $location = $category_location; # # Assign Smarty variables and show template # $smarty->assign("main","catalog"); $smarty->assign("location",$location); $smarty->display("customer/just_the_middle.tpl");

Note that the last line is all I changed.

Then you need to setup a special template for this purpose. I've named it "just_the_middle.tpl" and put it in the "customer" directory. I took the code from "customer/home.tpl" and cut out all the stuff you don't want. Here's the code of "just_the_middle.tpl" (once again, this is based on version 3.4.4).

Code:
{ config_load file="$skin_config" } <html> <head> <title>Some title</title> { include file="meta.tpl" } <link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}"> </head> <body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"> {include file="customer/home_main.tpl"} </body> </html>

I haven't tested it, but that ought to do it. Good luck.
Reply With Quote
  #8  
Old 08-08-2003, 06:48 AM
 
lyle lyle is offline
 

Member
  
Join Date: Aug 2003
Posts: 11
 

Default

hey thanks a lot was gettin discouraged bigtime
I appreciate your time and now im gonna go try this!

_____________________


Worked like a charm took me 30 seconds to make this work after spending about 8 hours on it!

thanks again
Reply With Quote
  #9  
Old 08-08-2003, 07:07 AM
 
lyle lyle is offline
 

Member
  
Join Date: Aug 2003
Posts: 11
 

Default

i guess now some crafty href calls as all my links are reopening in that small IFRAME window
hmm new cans of worms at every corner...

I like learning, and I sure didnt know jack about this last week ...
Reply With Quote
  #10  
Old 08-08-2003, 07:20 AM
 
slimmedia slimmedia is offline
 

Member
  
Join Date: May 2003
Posts: 23
 

Default

If you're going to do your whole site inside an IFRAME it may be easier just to have your IFRAME call /customer/home.php and then save the "just_the_middle.tpl" as "/customer/home.tpl".
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:40 AM.

   

 
X-Cart forums © 2001-2020