How to show something ONLY in the homepage (main.tpl)

Hello,



I’m trying to show Flash content in the homepage only by inserting it in main.tpl (adding it from the admin section won’t work because it contains tags…)



I tried both:


[QUOTE]{*** if homepage - BEGIN ***}

[COLOR=“Red”]{if $content == “homepage”}[/COLOR]


....

[COLOR="red"][B]{/if}[/B][/COLOR]
{*** if homepage - END ***}[/QUOTE]

and:

[QUOTE]{*** if homepage - BEGIN ***}
[COLOR="red"][B]{if $current_url == "$index_script"}[/B][/COLOR]

....

[COLOR="red"][B]{/if}[/B][/COLOR]
{*** if homepage - END ***}[/QUOTE]


None of them worked. It'd be awesome if somebody could help with this.

btw, where is the [B]central.tpl[/B] file? I couldn't find it in 2.0...

Go to the admin controls.



Select “Design–>Design mode”



Click on “Enable Customization mode”



Then click on “View Storefront in customization mode”



Click on the block you want to modify.



In your case, it is:



views/index/index.tpl





```php {$lang.text_welcome}

{capture name=“mainbox_title”}{$lang.welcome}{/capture}



{hook name=“index:index”}

{/hook} ```

Thanks hykit,



I just placed the code between the and and it worked, it only shows in the homepage now…

[quote name=‘gugga7’]Thanks hykit,



I just placed the code between the and and it worked, it only shows in the homepage now…[/QUOTE]



In the main.tpl (cs-cart 2.0.4) I wrote:



[HTML]

{hook name=“index:main_content”}



{if $content == “homepage”}

Hallo homepage!


{/if}

{include file=“top.tpl”}



{/hook}

[/HTML]



It doesn’t work. I want a script right above the top.tpl.

How should I do this?

Yeah trying this too and not working either.



I am trying to do this in the top.tpl…would this make a difference?

Try:

{if $controller == 'index'}



I know I am going to sound like a broken record, but you can use the index:main_content hook so that your changes are not overwritten by future upgrades.



Bob

Awesome, that worked. Thanks jobosales:!: