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

Completely custom home page (front page)

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 06-28-2016, 01:33 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Completely custom home page (front page)

I would like to completely customize my home/front page. I want to retain the main layout of the website (i.e., still use customer/en/body.tpl), but I want to remove the sidebar, add banners/slideshows, rotating quotes, etc. How can I get the front page to use a custom template file instead of having it be just another category list page?
__________________
X-Cart version 5.2
Reply With Quote
  #2  
Old 06-29-2016, 11:11 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Completely custom home page (front page)

I guess you mean the default/en/body.tpl template.

In X-Cart 5 there is no a single template that determines the layout.
You can find most of templates that affect the layout under the skins/default/en/layout directory.

main.center.left.tpl and main.center.right.tpl are the two that display sidebars. But instead of changing the templates, you should use isSidebarFirstVisible() and isSidebarSecondVisible() methods in your module (check how these methods are used to hide sidebars during checkout).

Other templates (and widgets) get inserted into the page through @ListChild declaration.
You may find this article useful - it explains how to find what templates/widgets appear on the page and how to alter them or add new ones: http://kb.x-cart.com/display/XDD/Step+2+-+applying+design+changes
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 07-27-2016, 03:27 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Re: Completely custom home page (front page)

Thanks for the reply. I understand how to edit templates, but I simply cannot find a template file for the home (front) page. I tried changing main.tpl, body.tpl, and welcome.tpl, but none of those affect only the home page. From what I can tell, the front page is just a special category page, which means that if I edit the categories page template, I will be editing every category's page.

Bottom line: How can I define a custom template for only the home page of the site, and no other page?
__________________
X-Cart version 5.2
Reply With Quote
  #4  
Old 07-27-2016, 08:53 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Completely custom home page (front page)

You can check if it is the home page from your custom template:
https://forum.x-cart.com/showthread.php?t=73877

But the better way would be checking this in a widget class that renders the template (if there is one) and changing the template path returned in getDefaultTemplate() method accordingly.

You may also check this article:
http://kb.x-cart.com/display/XDD/How+to+find+out+what+page+is+currently+running
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may 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 02:38 AM.

   

 
X-Cart forums © 2001-2020