The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu Nov 15, 2007 2:40 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Apr 05, 2007 1:32 pm
Posts: 44
I add code in the components/com_content/views/article/tmpl/default.php on lline 115 after

ike this:
Code:
<?php if ($this->countModules("user11")) { ?>
   <jdoc:include type="modules" name="user11" style="xhtml" />
<?php } ?>


But it's wrong! somebody can tell me how can to do it ?

_________________
http://joomlavisually.com/


Last edited by haiwasnm on Thu Nov 15, 2007 2:42 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 3:02 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 12, 2005 2:45 am
Posts: 1916
Location: Toowoomba, Australia
Have a quick look in the rhuk_milkyway template xml.  You'll see an xml node like:

Code:
   <positions>
      <position>breadcrumbs</position>
      <position>left</position>
      <position>right</position>
      <position>top</position>
      <position>user1</position>
      <position>user2</position>
      <position>user3</position>
      <position>user4</position>
      <position>footer</position>
      <position>debug</position>
      <position>syndicate</position>
   </positions>


Just add your new positions to the list.

Hope this helps.

_________________
Andrew Eddie - Tweet @AndrewEddie
<><
http://learn.theartofjoomla.com - Joomla 1.6 training videos!
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 4:41 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Apr 05, 2007 1:32 pm
Posts: 44
Thank you!

Code:
<td valign="top" colspan="2">
<div align="center">
add a new module with position user9
</div>

<?php if (isset ($this->article->toc)) : ?>
   <?php echo $this->article->toc; ?>
<?php endif; ?>
<?php echo $this->article->text; ?>


Quote:
add a new module with position user9


here how can I add node ?

_________________
http://joomlavisually.com/


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 4:45 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 12, 2005 2:45 am
Posts: 1916
Location: Toowoomba, Australia
Are you assigning a module to your new positions?

_________________
Andrew Eddie - Tweet @AndrewEddie
<><
http://learn.theartofjoomla.com - Joomla 1.6 training videos!
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 4:50 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Apr 05, 2007 1:32 pm
Posts: 44
yes , I assigning a new module ipositions in template now

I want to add a new module node in components/com_content/views/article/tmpl/default.php

_________________
http://joomlavisually.com/


Last edited by haiwasnm on Thu Nov 15, 2007 4:56 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 4:56 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 12, 2005 2:45 am
Posts: 1916
Location: Toowoomba, Australia
Oh, you want to load a "module" from your article layout.  Is that correct?

_________________
Andrew Eddie - Tweet @AndrewEddie
<><
http://learn.theartofjoomla.com - Joomla 1.6 training videos!
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 5:00 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Apr 05, 2007 1:32 pm
Posts: 44
masterchief wrote:
Oh, you want to load a "module" from your article layout.  Is that correct?


yes , right!
want to load a new module in article layout before the article text.
But I unknown how to do it with Joomla1.5.

_________________
http://joomlavisually.com/


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 5:07 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 12, 2005 2:45 am
Posts: 1916
Location: Toowoomba, Australia
Right, sorry.  I misread what you wanted.

To load a module position within a layout your can do this:

Code:
   <?php
      $document   = &JFactory::getDocument();
      $renderer   = $document->loadRenderer( 'modules' );
      $options   = array( 'style' => 'raw' );

      echo $renderer->render( 'position_name', $options, null);
   ?>


Change the "style" to whatever you need (most likely raw, but could be xhtml), and change the position_name to the actually module position, eg user9.

Does that help?

_________________
Andrew Eddie - Tweet @AndrewEddie
<><
http://learn.theartofjoomla.com - Joomla 1.6 training videos!
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 5:22 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Apr 05, 2007 1:32 pm
Posts: 44
sorry , I upload to Joomla1.5 today , can't uses something.

I make it like this:
Code:
<td valign="top" colspan="2">
<div align="center">
<?php
$document = &JFactory::getDocument();
$renderer = $document->loadRenderer( 'modules' );
$options = array( 'style' => 'raw' );

echo $renderer->render( 'user9', $options, null);
?>
</div>

<?php if (isset ($this->article->toc)) : ?>
   <?php echo $this->article->toc; ?>
<?php endif; ?>
<?php echo $this->article->text; ?>
</td>
</tr>


I unknown ' Change the "style" to whatever you need (most likely raw, but could be xhtml) ' mains.

so this user9 position can't display

Troubled you, I' sorry ! I need your help! Please.

_________________
http://joomlavisually.com/


Last edited by haiwasnm on Thu Nov 15, 2007 5:32 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 6:52 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 14948
Location: **Translation Matters**
Have you also added the position user9 into the template.xml, as Andrew explained above?

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr · GMT +1
Multilanguage in 1.7: http://help.joomla.org/files/EN-GB_mult ... torial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Thu Nov 15, 2007 1:25 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Apr 05, 2007 1:32 pm
Posts: 44
infograf768 wrote:
Have you also added the position user9 into the template.xml, as Andrew explained above?

yes ,I also added the position user9 into the template.xml

_________________
http://joomlavisually.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group