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

How to add custom html to homepage only?

 
Closed Thread
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-17-2017, 10:26 AM
 
ftorres ftorres is offline
 

Newbie
  
Join Date: May 2016
Posts: 5
 

Default How to add custom html to homepage only?

Hi everyone, I asked this on Stackoverflow but still no answers.

I'm developing an X-Cart 5 site and need to add custom html on the homepage (a.k.a. storefront).

Using the X-Cart development documentation, I created a custom module and added the modifications to the Crisp White template using the @ListChild directive inside my TWIG files.

But, since I used ListChild with list=center.bottom , my custom module shows on every page. We want the code to appear only on the home page.

I have several questions:

1.Which @ListChild values can I use to display the module only on homepage?

2.Is there a website where I can see a list of all the available @ListChild values? I searched in X-Cart documentation and can't find a list of available ListChild positions.

3.If it's not possible using ListChild, I know we can query the current page inside the template. How to test if the current page is the homepage?

Thanks for all the help.
__________________
xcart v5.3.3.4 [linux]
  #2  
Old 11-17-2017, 12:47 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,199
 

Default Re: How to add custom html to homepage only?

https://forum.x-cart.com/showthread.php?t=75705
https://forum.x-cart.com/showthread.php?t=73877
__________________
Steve Stoyanov
CFLSystems.com
Web Development

The following user thanks cflsystems for this useful post:
qualiteam (11-26-2017)
  #3  
Old 11-17-2017, 01:13 PM
 
ftorres ftorres is offline
 

Newbie
  
Join Date: May 2016
Posts: 5
 

Default Re: How to add custom html to homepage only?


@cflsystems Thank you. I tried inserting the code found in that thread and still doesn't work. Here is my twig file code, maybe I'm writing something incorrectly

Code:
{## # Home Module 3 # # @ListChild (list="center.bottom", weight="600") #} {if:getTarget()=#main#} <div class="module-cta-full-container container-fluid"> <div class="row cta-row-module-control"> <div class="col-md-12 cta-module-full-col"> <div class="img-cta-wrapper"><a href="#"><img src="images/content/discount-product.jpg"></a></div> </div> </div> </div> {end:}
__________________
xcart v5.3.3.4 [linux]
  #4  
Old 11-17-2017, 03:24 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,199
 

Default Re: How to add custom html to homepage only?

You are trying smarty code while 5.3.x uses twig

This is the thread to follow

https://forum.x-cart.com/showthread.php?t=75705

The other one you can use as a reference what other targets can be used
__________________
Steve Stoyanov
CFLSystems.com
Web Development

The following 2 users thank cflsystems for this useful post:
ftorres (11-20-2017), qualiteam (11-26-2017)
  #5  
Old 11-20-2017, 05:24 AM
 
ftorres ftorres is offline
 

Newbie
  
Join Date: May 2016
Posts: 5
 

Default Re: How to add custom html to homepage only?

@cflsystems Thank you. My mistake. It worked perfectly now!
__________________
xcart v5.3.3.4 [linux]
Closed Thread
   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 09:18 AM.

   

 
X-Cart forums © 2001-2020