Login

flag-uk
SOLUTIONS - DEVELOPER
HomeDocumentationHow To? /  Create your own introtext content template
Create your own introtext content template Print E-mail
This great tutorial is written by Robin Lindström alias Divining official moderator on jSeblod CCK forums. Many thanks.

About index2

The index2.php is simply a template file used to control listings (or previews, or intros - there are actually kinda endless of possibility's if you just use your imagination) . An example is when you create an menulink showing articles of an selected category using the 'Category Blog Layout' menu item - with index2.php you can control which elements that should appear, and the placement of them.

Another example is when you use an module to present your article intros, it's the same there - the quick presentation is all an result of index2.php.

So - lets begin!

Step 1 - the first steps to your own template.
1) Logon to the administration backend and head to the 'Content type manager'.
2) Find your 'Content type' and tick the checkbox.
3) Scroll down, at the bottom of the 'Content type manager'-page you will find a feature called 'Template generator'.
4) By default the 'Template generator' dropdown will be set to 'Content', and as that is what you want leave it there and click the 'Generate'-button.

Now you will be prompted by the browser about what to do with 'your_template.zip', just save it where you can find it - then extract it.

1) Open up the extracted folder.
2) Locate and open templateDetails.xml in your favorite editor (if you don't have any XHTML & CSS experience I would recommend Dreamweaver, otherwise Coda (by Panic, Mac only))
3) Add the following line under <!-- CSS -->:
<filename>css/style.css</filename>

4) Add the following line under <filename>index.php</filename>
<filename>index2.php</filename>

5) Save and close templateDetails.xml
6) Create a new file in the template root directory named 'index2.php'
7) Add the following information to the top of your 'index2.php' file:
<?php
// No Direct Access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>

<?php
/**
* Init jSeblod Process Object { !Important; !Required; }
**/
$jSeblod = clone $this;
?>

<?php
// Add CSS
$document =& JFactory::getDocument();
$document->addStyleSheet( $this->baseurl.'/templates/'.$this->template.'/css/style.css' );
?>

8) Now we have the basics done. Lets move on to making your selected content appears as an "article preview".


Step 2 - Let your creativity flow!
1) Open up the templates 'index.php' - here you will find all available content fields, example:
<?php echo $jSeblod->YOUR FIELD NAME->value; ?>

2) Copy the the fields that you want to show on your 'Article preview page' (in your case the 'Blog Layout Page').
3) Paste the desired fields into your 'index2.php', and start creating 'div's to hold your content in place, ex:
<div align="center" class="cck_content">
<div class="cck_title"><h5><?php echo $jSeblod->YOUR TITLE FIELD->value; ?></h5></div>
<div class="cck_author">By: <?php echo $this->content->author ?></div>
<div class="cck_category"><em><?php echo $this->content->category ?></em></div>
<?php echo $jSeblod->nm_button_read->value; ?>
</div>

4) Save your 'index2.php' and upload your new theme via jSeBlod Template manager.
5) Go to your 'Content type' and assign your new 'Content template'.
6) Check on the category layout page (this assumes that you have filtered the results down to the category using the template - and that you are using the previously mentioned parameters).

If you where using the 'default content' template before - the 'article mainpage' might look a little different. If you don't want to have your custom style to the mainpage - then you have to copy and replace your templates 'index.php' from with the one from the 'Default content' template.

Also - I told you to add an line for the CSS to load, when you are ready to style it using CSS. Just create your style.css and place it in the templates 'css' folder.

That's it! Now play around a bit and explore the endless possibility's of jSeBlod-CCK!

Please don't hesitate to add in your questions, if you have any, below

Best regards
Divining
 

Comments  

 
0 #15 nugrop11 2010-08-23 06:21
I am fixed follow mr belgor . :lol:
It work

fixed
if (JRequest::getV ar('view', '') == 'article' ) {
in index.php

Best Regards
 
 
0 #14 nugrop11 2010-08-22 16:43
my templates use 2 file.
index.php use full bolg
index2.php use into blog
but index.php not use.
run index2.php only in my templates.
 
 
0 #13 jSeblod - Bes 2010-08-16 22:30
Hi kennethbutton,

Yes of course and thanks a lot.

And thanks to share your packs on the JED: extensions.joomla.org/

Best Regards
 
 
0 #12 kennethbutton 2010-08-07 08:40
I am so impressed with the jseblod I am going to promote this in the first ever Classic Car Open Source classified and community here in the States. Joomla and jseblod are the only reason it will happen and people will be made aware... I am going to create specialized forms for specific classic and collector cars and make sure to have them all on source force. Can I make my name on these as well since my classic car specific forms will be on it? For your information jseblod - I went with you because you showed up and answered questions in a forum showing professionalism beyond anyone else. If I can ever be of assistance to you - please feel free to contact me at www.e-motorclassics.com or classiccarshd.org when it is built.
 
 
0 #11 Zabava 2010-08-06 19:54
Quote:
5) Go to your 'Content type' and assign your new 'Content template'.

My own content template will assign to only one Content type.
I understand correctly?
What can I do to assign new blog template to my category in case of the category contains several content types articles?
Best regards.
 
 
0 #10 kermit796 2010-08-05 16:33
Same for me, can't display index.php
thanks for help.
[edit]
see jseblod-cck.com/.../...
and save your articles again.[/edit]
Note : Must add the read more field in content and this tuto :)
 
 
+1 #9 zagirova 2010-07-02 13:45
I've only index2.php running. No full article is dispaying.
 
 
+2 #8 simonron 2010-06-29 11:26
I am having a lot of trouble - so far nothing works - for example:-
When I try to create a template using the above method I get -'An error has occurred.' which is no help at all. Can you help?
I have set access to the admin and component folder to 777 - but that changed nothing.
 
 
-1 #7 tselofan11 2010-05-23 13:23
Hi. I made copy of Default_content template, and create in it index2.php. But then only index2.php run always. Thanks.
 
 
0 #6 slotpro 2010-05-04 16:46
Quoting factoria:
take to show an error in the feed on your site exactly introductory texts.

twitpic.com/1kyt7u

thanks for the explanation


your can use Ninja RSS Syndicator feed your article see link bit.ly/d1WT6t
 
 
0 #5 factoria 2010-05-04 14:26
take to show an error in the feed on your site exactly introductory texts.

twitpic.com/1kyt7u

thanks for the explanation
 
 
0 #4 odd8888 2010-05-01 15:23
Thank you very much for this explanation and for the great possibility of jSeblod.
I am new and i followed the step of the "how to" but I don't know how to import the new template modified :
Quote:
4) Save your 'index2.php' and upload your new theme via jSeBlod Template manager.

Can you explane it with more details.
Thank you a lot for your help.
 

Add comment


Security code
Refresh

Copyright © 2008-2009 Seblod. All rights reserved.

Login On jSeblod CCK website



S5 Register



*
*
*
*
*

Fields marked with an asterisk (*) are required.