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: 11366

  • 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.10 | 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:

<div class="slideshow">
<div id="slider">
<{if $smarty.server.PHP_SELF=='/index.php'}>
<{includeq file="$theme_name/slideshow.html"}>
<{/if}>
</div>
<div class="slider-ctrl">
<a href="#" id="btn_prev">Prev</a>
<a href="#" id="btn_next">Next</a>
</div>
</div>

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 <head> 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.
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...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><{$xoops_sitename}><{if $xoops_pagetitle !=''}> - <{$xoops_pagetitle}><{/if}></title>
<!-- Meta Tags -->
<meta name="Description" content="<{$xoops_meta_description}>" />
<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<meta name="keywords" content="<{$xoops_pagetitle}>,<{$xoops_meta_keywords}>" />
<meta name="rating" content="<{$xoops_meta_rating}>" />
<meta name="author" content="<{$xoops_meta_author}>" />
<meta name="copyright" content="<{$xoops_meta_copyright}>" />
<meta name="generator" content="<{$smarty.const.META_GENER}>" />
<meta name="robots" content="<{$xoops_meta_robots}>" />
<meta name="revisit-after" content="<{$smarty.const.META_REV_AFT}>" />
<!-- Styles/Relations -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="<{xoAppUrl backend.php}>" />
<link rel="stylesheet" type="text/css" media="print" href="<{xoImgUrl otherCss/print.css}>"/>
<link rel="alternate stylesheet" type="text/css" media="screen" href="<{xoImgUrl otherCss/highcontrast.css}>" title="zoom" rev="zoom"/>
<link rel="stylesheet" type="text/css" media="all" href="<{xoImgUrl style.css}>" />
<!-- JS -->
<{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}>
<!--[if lt IE 7]>
<script src="<{xoImgUrl js/unitpngfix.js}>" type="text/javascript"></script>
<![endif]-->
<!--[if lt IE 8]>
<script src="<{xoImgUrl js/IE8.js}>" type="text/javascript"></script>
<![endif]-->
<script type="text/javascript">
$(document).ready(function() {
//Slideshow
$('#slider').cycle({
fx: 'scrollVert',
timeout: 5500,
next: '#btn_next',
prev: '#btn_prev'
});
//Slideshow Ctrl
$('.slideshow').mouseover(
function () { $('.slider-ctrl').show(); }
);
$('.slideshow').mouseout(
function () { $('.slider-ctrl').hide(); }
);
//Panel Ctrl
$('#panel-ctrl').click(function () {
$('#panel').slideToggle('slow');
$('#panel-ctrl').toggleClass('close');
});
//Superfish
jQuery('ul.sf-menu').superfish({
animation: {height:'show'},
delay: 200,
});
});
</script>
<!-- Smarty Assign -->
<{assign var=theme_name value=$xoTheme->folderName}>
<{assign var=theme_name value=$xoTheme->folderName|cat:'/tpl'}>
</head>
<body class="xo-page">
<div class="wrapper">
<!--- Header -->
<div class="container_12">
<td id="headerlogo"><a href="<{xoAppUrl /}>" title="<{$xoops_sitename}>"><img src="<{xoImgUrl logo.png}>" alt="<{$xoops_sitename}>" /></a></td>

<div class="grid_8"></div>
<div class="clear"></div>
</div>
<!-- Navbar -->
<div id="navbar">
<ul class="sf-menu">
<{includeq file="$theme_name/navmenu.html"}>
<div class="clear"></div>
</ul>
<div class="clear"></div>
</div>

<div class="slideshow">
<div id="slider">
<{if $smarty.server.PHP_SELF=='/index.php' && $xoops_dirname=="system"}>
<{includeq file="$theme_name/slideshow.html"}>
<{/if}>
</div>
<div class="slider-ctrl">
<a href="#" id="btn_prev">Prev</a>
<a href="#" id="btn_next">Next</a>
</div>
</div>
<div class="separator"></div>
<!-- Content -->
<div id="content" class="container_12">
<{if $xoBlocks.canvas_left}>
<!-- Left Blocks -->
<div class="grid_3">
<div class="left-block">
<{foreach item=block from=$xoBlocks.canvas_left}>
<div class="left-block-content">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
</div>
<{/if}>
<!-- Center Blocks -->
<{if $xoBlocks.canvas_left and $xoBlocks.canvas_right}>
<div class="grid_6">
<{else}><{if $xoBlocks.canvas_left or $xoBlocks.canvas_right}>
<div class="grid_9">
<{else}>
<div class="grid_12">
<{/if}><{/if}>
<{if $xoBlocks.page_topleft or $xoBlocks.page_topcenter or $xoBlocks.page_topright}>
<!-- Center Top Left -->
<div class="center-top-left">
<{foreach item=block from=$xoBlocks.page_topleft}>
<div class="center-top-left-block">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
<!-- Center Top Right -->
<div class="center-top-right">
<{foreach item=block from=$xoBlocks.page_topright}>
<div class="center-top-right-block">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
<!-- Center Top Center -->
<div class="center-top-center">
<{foreach item=block from=$xoBlocks.page_topcenter}>
<div class="center-top-center-block">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
<{/if}>
<!-- Content -->
<{if $xoops_contents && ($xoops_contents != '') }>
<div class="xo-content">
<{$xoops_contents}>
</div>
<{/if}>
<{if $xoBlocks.page_bottomleft or $xoBlocks.page_bottomcenter or $xoBlocks.page_bottomright}>
<!-- Center Bottom Left -->
<div class="center-bottom-left">
<{foreach item=block from=$xoBlocks.page_bottomleft}>
<div class="center-bottom-left-block">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
<!-- Center Bottom Right -->
<div class="center-bottom-right">
<{foreach item=block from=$xoBlocks.page_bottomright}>
<div class="center-bottom-block">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
<!-- Center Bottom Center -->
<div class="center-bottom-center">
<{foreach item=block from=$xoBlocks.page_bottomcenter}>
<div class="center-bottom-center-block">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
<{/if}>
</div>
<{if $xoBlocks.canvas_right}>
<!-- Right Blocks -->
<div class="grid_3">
<div class="right-block">
<{foreach item=block from=$xoBlocks.canvas_right}>
<div class="right-block-content">
<h2><{$block.title}></h2>
<{$block.content}>
</div>
<{/foreach}>
</div>
</div>
<{/if}>
<div class="clear"></div>
</div>
<div class="container_12">
<div class="footer">
<a href="http://twitter.com/yourname" title="Twitter"><img src="<{xoImgUrl img/twitter.png}>" alt="" /></a>
<a href="<{xoAppUrl backend.php}>" title="RSS"><img src="<{xoImgUrl img/rss.png}>" alt="" /></a>
<a href="http://php.net" title="Written in PHP"><img src="<{xoImgUrl img/php.png}>" alt="" /></a>
<a href="https://xoops.org.cn" title="Powered by XOOPS"><img src="<{xoImgUrl img/xoops.png}>" alt="" /></a>
<a href="http://insraq.me" title="Designed by INSRAQ"><img src="<{xoImgUrl img/insraq.png}>" alt="" /></a>
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>



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

198 user(s) are online (109 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

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

Latest GitHub Commits