Jump to content

Need help pulling/loading a different global .TPL


Guest pghtech

Recommended Posts

Guest pghtech

Since global/index.tpl file is used as the main container loading all other .tpl files, however you configure it to look stays static on all other pages you go to. If you wanted to change the over look when you go to a specific page (i.e. individual product details page), you would have to load a different global .tpl file (yes/no?).

Does anyone know how I can do this?

Can someone please explain to me how the cart.tpl takes over as the primary .tpl when you go to view the shopping cart.

I would like to implement the ability to go to a complete new primary .tpl when you view a product details.

To provide more details.

I would like to create another global template like cart.tpl and index.tpl that is loaded when you select "more" on a product.

I would assume there would be some type of reference in the main global/index.inc.php, and in the viewCat.inc.php.

I can create the .tpl file, but I am not sure what and where the PHP code goes.

Any help?

Link to comment
Share on other sites

Guest Brivtech

I am trying to figure out how you could call a different 'global' template.

Use a second skin, in cubecart, there is a box to choose skins, I'm not aware of third party modifications to improve this, as I don't get involved with other people's third party software (I write my own, and this is a grey area to me, as I've never needed to develop anything that is within the scope of this).

The premise is that I would like to change the page when you click on "more" to review a product details. Currently that product's details load in the index.tpl, and the index.tpl has its own look. So I figured the only way I could do this is by loading a completely different global/ .tpl.

I don't think you're approaching this right, to be honest, what you are explaining that you are trying to do is actually making me confused.

The product's details are within a content page, specifically: skins/skin_name/styleTemplates/content/viewProc.tpl

If you want to make changes to the reviews, this is the template file that does the work. The file you are referring to (index.tpl) is like a main holder page, for which the content page is included inside.

So, if you are trying to make changed to the product reviews, don't go anywhere near the global folder, you want the content folder instead. Sometimes, what you're looking for may also be in the boxes folder (Which are usually the smaller sections like category menus, basket summary, email subscription, etc.).

I simply don't understand the purpose of what you describe as wanting to create a new global template.

With regard to cart.tpl, this is a holder page for secure pages, mainly the shopping cart and checkout process, but also customer account pages. That's why there's a cart.tpl and an index.tpl.

Link to comment
Share on other sites

Guest pghtech

Brivtech:

Thanks for following up. To provide a clearing explanation:

I understand how the template system works (not so much the backend PHP) but how the global/index.tpl is the "main holder page" and within it, it calls a number of other templates. However, whatever look you customize the index.tpl template to look, your website will look like this on every page except the cart.tpl template. Which as the index.tpl template is also a global "main holder page" just like index.tpl.

My goal is to change completely the way the "holder page" looks when you go to an individual product details page. So unless there is a better way around this, I am going to have to create a completely different global "page holder" template that the viewProd.tpl template loads into.

As i used in my example, when you click on "View Basket" in the Shopping cart, it takes you to the Shopping cart which loads the "cart.tpl" at which time, the whole page is changed.

But how do I associate a new global template in the code to load the viewProd.tpl template in a new global template?

no one in this community understands how to achieve this?

Brivtech:

Thanks for following up. To provide a clearing explanation:

I understand how the template system works (not so much the backend PHP) but how the global/index.tpl is the "main holder page" and within it, it calls a number of other templates. However, whatever look you customize the index.tpl template to look, your website will look like this on every page except the cart.tpl template. Which as the index.tpl template is also a global "main holder page" just like index.tpl.

My goal is to change completely the way the "holder page" looks when you go to an individual product details page. So unless there is a better way around this, I am going to have to create a completely different global "page holder" template that the viewProd.tpl template loads into.

As i used in my example, when you click on "View Basket" in the Shopping cart, it takes you to the Shopping cart which loads the "cart.tpl" at which time, the whole page is changed.

But how do I associate a new global template in the code to load the viewProd.tpl template in a new global template?

So I have been doing some research and i think I am actually onto something, but I believe that it dictates what template it calls in the viewProd.tpl file where it has

_a=viewProd

in the link

<a href="index.php?_a=viewProd&amp;productId={PRODUCT_ID}" target="_self">




And possibly, if I run a statement such as:




if($_GET['_a'] == 'viewProd') {

 $body = new XTemplate ("global".CC_DS."product.tpl");

}

else {

 // load the default template

}

that I might be able to load a different template to show the individual products.

Can someone help me verify if this is the right direction?

Link to comment
Share on other sites

Guest Brivtech

This type of customisation is beyond the scope of this forum, so I guess that's why you're not getting much in the way of responses. Have you tried asking over at cubecartforums.org, where the third party modders and designers hang out? They may be able to help you better. This forum really only deals with the core software.

This is a support forum, and what you're asking for is more for help with customisation - That's not really support.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...