-
AuthorPosts
-
May 5, 2014 at 7:00 am #197399
Please help me with this.
I created a custom template. attached files are index.php, templateDetails.xml
The following file is index.php and templateDetails.xml file attached.When i make my template as default, the content doesn’t showing.
Suppose, default template is “protostar”, when we make “Beez3” as default the content displaying but positions are different.What i want is the content should be display when i active created custom template.
How to do it. Please reply.
index.php
—————–
<?php
/**
* @version Simplicity 1.0
* @copyright Copyright (C) 2011 Virtuosi Media.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/defined(‘_JEXEC’) or die;
/* The following line loads the MooTools JavaScript Library */
JHTML::_(‘behavior.framework’, false);/* The following line gets the application object for things like displaying the site name */
$app = JFactory::getApplication();/* Template variables */
$logoFile = $this->params->get(‘logoFile’);
$sitename = $app->getCfg(‘sitename’);$interactText = $this->params->get(‘interactText’);
$templateColor = $this->params->get(‘templateColor’);$showAuthor = $this->params->get(‘showAuthor’);
$showEmail = $this->params->get(‘showEmail’);
$showFacebook = $this->params->get(‘showFacebook’);
$showRSS = $this->params->get(‘showRSS’);
$showTwitter = $this->params->get(‘showTwitter’);$emailUrl = $this->params->get(’emailURL’);
$facebookUrl = $this->params->get(‘facebookURL’);
$rssUrl = $this->params->get(‘rssURL’);
$twitterUrl = $this->params->get(‘twitterURL’);// Logo file or site title param
if ($this->params->get(‘logoFile’))
{
$logo = ‘<img id=”logo” src=”‘. JUri::root() . $this->params->get(‘logoFile’) .'” alt=”‘. $sitename .'” />’;
}
elseif ($this->params->get(‘sitetitle’))
{
$logo = ‘<span class=”site-title” title=”‘. $sitename .'”>’. htmlspecialchars($this->params->get(‘sitetitle’)) .'</span>’;
}
else
{
$logo = ‘<span class=”site-title” title=”‘. $sitename .'”>’. $sitename .'</span>’;
}
?><?php echo ‘<?’; ?>xml version=”1.0″ encoding=”<?php echo $this->_charset ?>”?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”<?php echo $this->language; ?>” lang=”<?php echo $this->language; ?>” dir=”<?php echo $this->direction; ?>” >
<head>
<jdoc:include type=”head” />
<link rel=”stylesheet” href=”<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/default.css” type=”text/css” />
<link rel=”stylesheet” href=”<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/<?php echo $templateColor;?>.css” type=”text/css” />
<link rel=”shortcut icon” href=”favicon.ico” type=”image/x-icon” />
</head>
<body><div>
<a href=”<?php echo $this->baseurl; ?>”>
<?php echo $logo;?> <?php if ($this->params->get(‘sitedescription’)) { echo ‘<div>’. htmlspecialchars($this->params->get(‘sitedescription’)) .'</div>’; } ?>
</a>
</div><div id=”topBar”>
<div id=”topWrapper”>
<?php if($this->countModules(‘topNav’)) : ?>
<div id=”topNav”>
<jdoc:include type=”modules” name=”topNav” style=”xhtml”/>
</div>
<?php endif; ?>
<?php if($this->countModules(‘search’)) : ?>
<div id=”search”>
<jdoc:include type=”modules” name=”search” style=”xhtml”/>
</div>
<?php endif; ?><?php if ($this->countModules(‘position-1’)) : ?>
<nav class=”navigation” role=”navigation”>
<jdoc:include type=”modules” name=”position-1″ style=”none” />
</nav>
<?php endif; ?></div>
</div>
<div id=”mainContainer”>
<div id=”mainWrapper”>
<div id=”main”>
<?php if($this->countModules(‘mainTop’)) : ?>
<jdoc:include type=”modules” name=”main” style=”xhtml”/>
<?php endif; ?>
<jdoc:include type=”component” />
<?php if($this->countModules(‘mainBottom’)) : ?>
<jdoc:include type=”modules” name=”main” style=”xhtml”/>
<?php endif; ?>
</div><div id=”aside” class=”span3″>
<!– Begin Right Sidebar –>
<jdoc:include type=”modules” name=”position-7″ style=”well” />
<!– End Right Sidebar –>
</div><div id=”sidebar”>
<?php if (($showRSS == 0)||($showFacebook == 0)||($showTwitter == 0)||($showEmail == 0)):?>
<?php if (!empty($interactText)):?>
<h2><?php echo $interactText; ?></h2>
<?php endif; ?>
<ul id=”interact”>
<?php if (($showRSS == 0)&&(!empty($rssUrl))):?>
<li><a href=”<?php echo $rssUrl; ?>” class=”rss”></a></li>
<?php endif; ?>
<?php if (($showFacebook == 0)&&(!empty($facebookUrl))):?>
<li><a href=”<?php echo $facebookUrl; ?>” class=”facebook”></a></li>
<?php endif; ?>
<?php if (($showTwitter == 0)&&(!empty($twitterUrl))):?>
<li><a href=”http://twitter.com/<?php echo $twitterUrl; ?>” class=”twitter”></a></li>
<?php endif; ?>
<?php if (($showEmail == 0)&&(!empty($emailUrl))):?>
<li><a href=”<?php echo $emailUrl; ?>” class=”email”></a></li>
<?php endif; ?>
</ul>
<?php endif; ?>
<?php if($this->countModules(‘sidebar’)) : ?>
<jdoc:include type=”modules” name=”sidebar” style=”xhtml”/>
<?php endif; ?>
</div><div id=”footer”>
<?php if($this->countModules(‘footer’)) : ?>
<jdoc:include type=”modules” name=”footer” style=”xhtml”/>
<?php endif; ?>
</div>
<div id=”copyright”>
<p>©<?php echo date(‘Y’); ?> <?php echo $app->getCfg(‘sitename’); ?>.
<?php if ($showAuthor == 0):?>
<a href=”#”>Simplicity – A Joomla Blog Template</a> was designed and created by <a href=”http://www.clicksandlikes.com/”>rjillella</a>.
<?php endif; ?>
</p></div>
</div>
</div></body>
</html>templateDetails.xml
—————————
<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE install PUBLIC “-//Joomla! 1.6//DTD template 1.0//EN” “http://www.joomla.org/xml/dtd/1.6/template-install.dtd”>
<extension version=”1.6″ type=”template” client=”site”>
<name>simplicity</name>
<creationDate>03/28/11</creationDate>
<author>Virtuosi Media</author>
<authorEmail>contact@virtuosimedia.com</authorEmail>
<authorUrl>http://www.virtuosimedia.com/</authorUrl>
<copyright>Copyright (C) 2011 Virtuosi Media.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.0.0</version>
<description>Simplicity is a simple, clean blog template for Joomla 1.6 created by Virtuosi Media, Inc.</description>
<files>
<folder>css</folder>
<folder>images</folder>
<folder>language</folder>
<filename>index.php</filename>
<filename>index.html</filename>
<filename>favicon.ico</filename>
<filename>templateDetails.xml</filename>
<filename>template_preview.png</filename>
<filename>template_thumbnail.png</filename>
</files>
<positions>
<position>position-1</position>
<position>position-2</position>
<position>position-3</position>
<position>position-7</position>
<position>topNav</position>
<position>search</position>
<position>mainTop</position>
<position>mainBottom</position>
<position>sidebar</position>
<position>footer</position>
</positions>
<languages folder=”language”>
<language tag=”en-GB”>en-GB/en-GB.tpl_simplicity.ini</language>
</languages>
<config>
<fields name=”params”>
<fieldset name=”advanced”>
<field name=”templateColor” type=”list” default=”gray” label=”TPL_SIMPLICITY_TEMPLATE_COLOR” description=”” filter=”word”>
<option value=”gray”>TPL_SIMPLICITY_TEMPLATE_COLOR_GRAY</option>
<option value=”red”>TPL_SIMPLICITY_TEMPLATE_COLOR_RED</option>
<option value=”blue”>TPL_SIMPLICITY_TEMPLATE_COLOR_BLUE</option>
<option value=”lime”>TPL_SIMPLICITY_TEMPLATE_COLOR_LIME</option>
<option value=”purple”>TPL_SIMPLICITY_TEMPLATE_COLOR_PURPLE</option>
</field><field name=”logoFile” class=”” type=”media” default=””
label=”TPL_PROTOSTAR_LOGO_LABEL”
description=”TPL_PROTOSTAR_LOGO_DESC” /></fieldset>
</fields>
</config>
</extension>wingly Friendwingly
- Join date:
- February 2014
- Posts:
- 310
- Downloads:
- 0
- Uploads:
- 87
- Thanks:
- 80
- Thanked:
- 83 times in 48 posts
May 5, 2014 at 8:35 am #533554Ok i finally got back to my city and my office, i need some time to finish other things today, but ițll get back at your question a bit later on today. i hope in 4-5 hours. And i’ll take a look
1 user says Thank You to wingly for this useful post
wingly Friendwingly
- Join date:
- February 2014
- Posts:
- 310
- Downloads:
- 0
- Uploads:
- 87
- Thanks:
- 80
- Thanked:
- 83 times in 48 posts
wingly Friendwingly
- Join date:
- February 2014
- Posts:
- 310
- Downloads:
- 0
- Uploads:
- 87
- Thanks:
- 80
- Thanked:
- 83 times in 48 posts
May 6, 2014 at 6:47 am #533731Dear @rjillella;
in order to create Joomla template only these 2 files are not enough. These 2 files are a MUST, but both of them should be written in a code under the purpose of your template; These two files that you have attached have no errors that i could see. So the problem is not in these two files but what they are doing. In these files you create different blocks and position that have a certain CSS property assigned; You need to define those css either directly in these files or create a separate folder like “css” create needed files there, define the css variables and tell what they do; Also make sure that index.php has the custom css file and folder defined.
In your case in index.php we can see the following code:
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/default.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/<?php echo $templateColor;?>.css" type="text/css" />THis part of the code makes us understand that this index php is looking for css files in the folder called css and tries to open default.css and “the current template color”.css; So without css files and their correct definition i doubt that something would be displayed in your template; So if you copied the index.php and template details you also need to copy the css and other files that are linked to the template and then customize them as you wish.
So here are the 2 guides that i personally like about creating custom template:
Short Guide (Quicky) and More detailed Step by Step;
p.s. Dear rjillella – a thread with questions like this is completely not a JA issue; You can also post this kind of questions also on different forums of Joomla developers and search on the internet for answers. Cause as long as it’s beyond the Costumer support of JA i can not promise you that i will reply to you fast or that my reply will have a full answer or solution as these type of questions are on lowest priority; Hope you understand and thank you.
-
AuthorPosts
This topic contains 7 replies, has 2 voices, and was last updated by wingly 10 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum