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

show only block the home

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 09-04-2015, 09:32 AM
 
inkprime inkprime is offline
 

Newbie
  
Join Date: Jul 2012
Posts: 6
 

Default show only block the home

Hello.

I am developing a new skin for xcart 5, what I need it is to show a block just before the general footer, but is only visible on the main page, but can not find one anywhere to create such conditional sentence.

I appreciate your help, and sorry for my English
Reply With Quote
  #2  
Old 09-04-2015, 11:39 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: show only block the home

This is how you can check if it is the home page:
PHP Code:
if (\XLite::getController()->getTarget() == \XLite::TARGET_DEFAULT) {
...

__________________
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 09-04-2015, 11:46 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: show only block the home

And this is how you can inject your template or widget class between the main area and the footer:
PHP Code:
@ListChild (list="layout.main.center"weight="400"

Or you can use "center.bottom" list instead of "layout.main.center".
__________________
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
  #4  
Old 09-04-2015, 11:55 AM
 
inkprime inkprime is offline
 

Newbie
  
Join Date: Jul 2012
Posts: 6
 

Default Re: show only block the home

So where you should put these codes in order to do what I want?

I tried using a center_bottom.tpl, but has not worked for me

Thank you very much for your help
Reply With Quote
  #5  
Old 09-07-2015, 01:47 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: show only block the home

You should:
1. Create a custom module
2. Add a new template file (if the block is plain HTML), or a new widget class with its own set of templates files (.tpl, .css, .js - when needed).
3. Add the @ListChild directive to the comments in the file - this will add this file into the specified list on the next site re-deploy
4. Add isVisible() method and put the page-checking logic there (so it will return false if the page is not the home)
__________________
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 10:37 PM.

   

 
X-Cart forums © 2001-2020