1
loukaum
A slide appearing only on the first page
  • 2011/8/16 21:28

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


I have a slideshow on my theme:

<{includeq file="$theme_name/slideshow.html"}>

Is there any smarty template to only show it on the home page (the first page acessed)?

Thanks in advance!
Resized Image

2
Mamba
Re: A slide appearing only on the first page
  • 2011/8/16 21:45

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Hmm, maybe you can check for:

<{$xoops_pagetitle}>

or

<{$xoops_url}

and compare it the value that should be there for the Home page, and if yes, then display the slide.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

3
andrax
Re: A slide appearing only on the first page
  • 2011/8/16 22:17

  • andrax

  • Just popping in

  • Posts: 60

  • Since: 2010/9/10


Hi loukaum,

Try this...
<{if $smarty.server.PHP_SELF=='/index.php'}>
    <{
includeq file="$theme_name/slideshow.html"}>
<{/if}>
Luiz Carlos (Andrax)
"whoever wants to become great among you must be your servant" – Jesus
http://guxbrasil.org
http://about.me/LuizCerqueira

4
loukaum
Re: A slide appearing only on the first page
  • 2011/8/16 23:12

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


Quote:

andrax wrote:
Hi loukaum,

Try this...
<{if $smarty.server.PHP_SELF=='/index.php'}>
    <{
includeq file="$theme_name/slideshow.html"}>
<{/if}>


Based on Mamba suggestion I was trying to make a hook with a custom block positioned in the home, but your code worked just fine! Thanks a lot man.

:)
Resized Image

5
ijtzib
Re: A slide appearing only on the first page
  • 2011/9/8 20:48

  • ijtzib

  • Just popping in

  • Posts: 13

  • Since: 2008/5/5 1


im using the InsBusie theme...but it not working..The image not appearing in the homepage and it still appears in other pages without the image.
this is the code:



<{if $smarty.server.PHP_SELF=='/index.php'}>
<{includeq file="$theme_name/slideshow.html"}>
<{/if}>




Should I put the code somewhere else..what i doing wrong??

Any assistance please

thankx..

6
andrax
Re: A slide appearing only on the first page
  • 2011/9/9 2:52

  • andrax

  • Just popping in

  • Posts: 60

  • Since: 2010/9/10


Hi ijtzib,

Try add the following line, just after the tag in the file theme.html,
<{assign var=theme_name value=$xoTheme->folderName}>


I believe that this solves your problem
Luiz Carlos (Andrax)
"whoever wants to become great among you must be your servant" – Jesus
http://guxbrasil.org
http://about.me/LuizCerqueira

7
kerkyra
Re: A slide appearing only on the first page
  • 2011/9/9 12:00

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i think you should check this
Quote:

<{if $smarty.server.PHP_SELF=='/index.php' && $xoops_dirname=="system"}>
<{includeq file="$theme_name/slideshow.html"}>
<{/if}>


make sure you check that xoops_dirname == your first page module directory

If you havent got one then use "system" like in my example, otherwise use the module's folder name.

I'm not sure if this will be visible or not in the selected module's first page as well.
whttp://www.guidemap.gr - Beta is out...

8
ijtzib
Re: A slide appearing only on the first page
  • 2011/9/9 16:54

  • ijtzib

  • Just popping in

  • Posts: 13

  • Since: 2008/5/5 1


Still not working.....

This is my theme.html file...

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<{$xoops_sitename}><{if $xoops_pagetitle !=''}> - <{$xoops_pagetitle}><{/if}>

















<{php}>
global $xoTheme;
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
$xoTheme->addScript('js/jquery.cycle.all.min.js');
$xoTheme->addScript('js/superfish.js');
$xoTheme->addScript('js/hoverIntent.js');
$xoTheme->addScript('js/jquery.bgiframe.min.js');
$header = empty($GLOBALS['xoopsOption']['xoops_module_header']) ? $this->get_template_vars('xoops_module_header') : $GLOBALS['xoopsOption']['xoops_module_header'];
$this->assign('xoops_module_header', $xoTheme->renderMetas(null, true) . $header);
<{/php}>
<{$xoops_module_header}>




<{assign var=theme_name value=$xoTheme->folderName}>
<{assign var=theme_name value=$xoTheme->folderName|cat:'/tpl'}>





<{$xoops_sitename}>









<{if $smarty.server.PHP_SELF=='/index.php' && $xoops_dirname=="system"}>
<{includeq file="$theme_name/slideshow.html"}>
<{/if}>






<{if $xoBlocks.canvas_left}>



<{foreach item=block from=$xoBlocks.canvas_left}>

<{$block.title}>


<{$block.content}>

<{/foreach}>


<{/if}>

<{if $xoBlocks.canvas_left and $xoBlocks.canvas_right}>

<{else}><{if $xoBlocks.canvas_left or $xoBlocks.canvas_right}>

<{else}>

<{/if}><{/if}>
<{if $xoBlocks.page_topleft or $xoBlocks.page_topcenter or $xoBlocks.page_topright}>


<{foreach item=block from=$xoBlocks.page_topleft}>

<{$block.title}>


<{$block.content}>

<{/foreach}>



<{foreach item=block from=$xoBlocks.page_topright}>

<{$block.title}>


<{$block.content}>

<{/foreach}>



<{foreach item=block from=$xoBlocks.page_topcenter}>

<{$block.title}>


<{$block.content}>

<{/foreach}>

<{/if}>

<{if $xoops_contents && ($xoops_contents != '') }>

<{$xoops_contents}>

<{/if}>
<{if $xoBlocks.page_bottomleft or $xoBlocks.page_bottomcenter or $xoBlocks.page_bottomright}>


<{foreach item=block from=$xoBlocks.page_bottomleft}>

<{$block.title}>


<{$block.content}>

<{/foreach}>



<{foreach item=block from=$xoBlocks.page_bottomright}>

<{$block.title}>


<{$block.content}>

<{/foreach}>



<{foreach item=block from=$xoBlocks.page_bottomcenter}>

<{$block.title}>


<{$block.content}>

<{/foreach}>

<{/if}>

<{if $xoBlocks.canvas_right}>



<{foreach item=block from=$xoBlocks.canvas_right}>

<{$block.title}>


<{$block.content}>

<{/foreach}>


<{/if}>












ANY other suggestion to assist me...?

Thanks!

9
XooperDooper
Re: A slide appearing only on the first page

Hey Ijtzib, did you get it sorted in the end and do you have a link to show us the page?

10
Yurdal
Re: A slide appearing only on the first page
  • 2011/12/7 15:43

  • Yurdal

  • Friend of XOOPS

  • Posts: 386

  • Since: 2005/3/27


I have used this code in theme.html, this works for sure

<{if $smarty.server.PHP_SELF=='/index.php'}> HTML CODE HERE <{/if}>

Login

Who's Online

342 user(s) are online (215 user(s) are browsing Support Forums)


Members: 0


Guests: 342


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits