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
It work
fixed
if (JRequest::getV ar('view', '') == 'article' ) {
in index.php
Best Regards
index.php use full bolg
index2.php use into blog
but index.php not use.
run index2.php only in my templates.
Yes of course and thanks a lot.
And thanks to share your packs on the JED: extensions.joomla.org/
Best Regards
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.
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 :)
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.
your can use Ninja RSS Syndicator feed your article see link bit.ly/d1WT6t
twitpic.com/1kyt7u
thanks for the explanation
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:
Can you explane it with more details.
Thank you a lot for your help.
RSS feed for comments to this post