Fork me on GitHub

Search

Donat-O-Meter

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

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap By Captcha cell cent chronolabs Clicks content CĂN demo docek download Dresses evden eve facebook Fat floor Food for free Gateway Google Guide herre Home Honeypot Human HỘ IP iPhone jQuery Language Law Legal List log Loss mobile module modules Monster new newbb news NHÀ online PARK Payment phone PHP Prevention profile project Protector publisher RESIDENCE responsive review Rights rmcommon security Sentry Signatures Signed site Smartphone Smoking Solution Spam Studio tdmcreate template The Theme themes web weight Wishcraft xoops Xortify XPayment

New Users

Registering user

# 137911

mydarkglobe

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  |  Register To Post



#1 Posted on: 2011/8/16 16:28 A slide appearing only on the first page
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!

Top


Resized Image
loukaum
Joined:
2003/11/1 18:24
From Sin City, Brasil
Group:
Registered Users
Posts: 61
(Show More) (Show Less)


#2 Posted on: 2011/8/16 16:45 Re: A slide appearing only on the first page
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.


Top


Please support XOOPS & DONATE
Use 2.5.7 | Debugging | Requests | Bugs
Mamba
Joined:
2004/4/23 13:58
From Ohio, USA
Group:
Webmaster
Registered Users
Designer Group
Posts: 8132
(Show More) (Show Less)


#3 Posted on: 2011/8/16 17:17 Re: A slide appearing only on the first page
Hi loukaum,

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


Top


Luiz Carlos (Andrax)
"whoever wants to become great among you must be your servant" – Jesus
http://guxbrasil.org
http://about.me/LuizCerqueira
andrax
Joined:
2010/9/10 2:52
From Salvador - Bahia - Brasil
Group:
Registered Users
Posts: 60
(Show More) (Show Less)


#4 Posted on: 2011/8/16 18:12 Re: A slide appearing only on the first page
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.

:)

Top


Resized Image
loukaum
Joined:
2003/11/1 18:24
From Sin City, Brasil
Group:
Registered Users
Posts: 61
(Show More) (Show Less)


#5 Posted on: 2011/9/8 15:48 Re: A slide appearing only on the first page
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..


Top

ijtzib
Joined:
2008/5/5 9:38
Group:
Registered Users
Posts: 13
(Show More) (Show Less)


#6 Posted on: 2011/9/8 21:52 Re: A slide appearing only on the first page
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

Top


Luiz Carlos (Andrax)
"whoever wants to become great among you must be your servant" – Jesus
http://guxbrasil.org
http://about.me/LuizCerqueira
andrax
Joined:
2010/9/10 2:52
From Salvador - Bahia - Brasil
Group:
Registered Users
Posts: 60
(Show More) (Show Less)


#7 Posted on: 2011/9/9 7:00 Re: A slide appearing only on the first page
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.

Top


www.guidemap.gr - Beta is out...
kerkyra
Joined:
2005/2/14 15:55
From Athens
Group:
Registered Users
Posts: 535
(Show More) (Show Less)


#8 Posted on: 2011/9/9 11:54 Re: A slide appearing only on the first page
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!

Top

ijtzib
Joined:
2008/5/5 9:38
Group:
Registered Users
Posts: 13
(Show More) (Show Less)


#9 Posted on: 2011/12/7 5:56 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?

Top

XooperDooper
Joined:
2011/12/7 5:49
From Blackpool
Group:
BANNED Users
Posts: 1
(Show More) (Show Less)


#10 Posted on: 2011/12/7 9:43 Re: A slide appearing only on the first page
I have used this code in theme.html, this works for sure

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

Top

Yurdal
Joined:
2005/3/27 13:59
Group:
Registered Users
Posts: 263
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]