loukaum loukaum
  • Just popping in
  • Just popping in
  • Joined: 2003/11/1 19:24
  • From Sin City, Brasil
  • Group: Registered Users
  • Posts: 61
  • Posted on: 2011/8/16 17:28
A slide appearing only on the first page #1
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
Mamba Mamba
  • Moderator
  • Moderator
  • Joined: 2004/4/23 14:58
  • From Ohio, USA
  • Group: Webmaster Registered Users Designer Group Super Moderator
  • Posts: 10293
  • Posted on: 2011/8/16 17:45
Re: A slide appearing only on the first page #2
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.
Please support XOOPS & DONATE
Use 2.5.8 | Debug | Requests | Bugs
andrax andrax
  • Just popping in
  • Just popping in
  • Joined: 2010/9/10 3:52
  • From Salvador - Bahia - Brasil
  • Group: Registered Users
  • Posts: 60
  • Posted on: 2011/8/16 18:17
Re: A slide appearing only on the first page #3
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
loukaum loukaum
  • Just popping in
  • Just popping in
  • Joined: 2003/11/1 19:24
  • From Sin City, Brasil
  • Group: Registered Users
  • Posts: 61
  • Posted on: 2011/8/16 19:12
Re: A slide appearing only on the first page #4
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
ijtzib ijtzib
  • Just popping in
  • Just popping in
  • Joined: 2008/5/5 10:38
  • Group: Registered Users
  • Posts: 13
  • Posted on: 2011/9/8 16:48
Re: A slide appearing only on the first page #5
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..
andrax andrax
  • Just popping in
  • Just popping in
  • Joined: 2010/9/10 3:52
  • From Salvador - Bahia - Brasil
  • Group: Registered Users
  • Posts: 60
  • Posted on: 2011/9/8 22:52
Re: A slide appearing only on the first page #6
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
kerkyra kerkyra
  • Just can't stay away
  • Just can't stay away
  • Joined: 2005/2/14 16:55
  • From Athens
  • Group: Registered Users
  • Posts: 553
  • Posted on: 2011/9/9 8:00
Re: A slide appearing only on the first page #7
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...
ijtzib ijtzib
  • Just popping in
  • Just popping in
  • Joined: 2008/5/5 10:38
  • Group: Registered Users
  • Posts: 13
  • Posted on: 2011/9/9 12:54
Re: A slide appearing only on the first page #8
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="http://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!
XooperDooper XooperDooper
  • Just popping in
  • Just popping in
  • Joined: 2011/12/7 6:49
  • From Blackpool
  • Group: BANNED Users
  • Posts: 1
  • Posted on: 2011/12/7 6:56
Re: A slide appearing only on the first page #9
Hey Ijtzib, did you get it sorted in the end and do you have a link to show us the page?
Yurdal Yurdal
  • Friend of XOOPS
  • Friend of XOOPS
  • Joined: 2005/3/27 14:59
  • Group: Registered Users
  • Posts: 306
  • Posted on: 2011/12/7 10:43
Re: A slide appearing only on the first page #10
I have used this code in theme.html, this works for sure

<{if $smarty.server.PHP_SELF=='/index.php'}> HTML CODE HERE <{/if}>
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team