Keyword

How to add intro text beneath Intro Titles in Item

  • sambuqa
  • sambuqa's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119690 by sambuqa
Hi everyone!

I´m working with a template build in T3 Framework in Joomla 3.0 and K2. I have almost everything ready, but i need a small change that i don´t know how to do it.

I need to put a Intro Text beneath the Main Title in the ITEMS. I have enabled the option INTRO TEXT in the categorie and also i tried in each item individualy but it doesn´t display intro text, i asumed, that tie intro text was everithig above the READ MORE division in the edit windows, and the body of the article is everything beneath, but i coud asumed that wrong. Is there a way to enable a separate Text Field where i can put the intro text? Could be also that the template i´m using doesn´t have a intro text into account and i have to write code in the css file to add that field above the main title?

Well, i now that this probably sound like noob questions, but i´m traing hard to read and try everithing i could before y post something

So, any clues?

PD: Sorry about my english, i´m from Latin America =P

PD: i uploaded a image that explain what i need =)

Attachment not found

Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #119691 by Bill Rust
I just did something similar here - hunt.bwpcommunications.com/about-us

Where the intro text is directly below my title.

First you need to create the over-ride folder/file, and then edit item.php.

So create this folder - /templates/YOUR TEMPLATE NAME HERE/html/com_k2/default/

In this folder place a copy of iten.php from /components/com_k2/templates/default

So you now have a copy of item.php to edit, which will not get over-written if you update K2 later on.

Now go in to your new item.php file and find the intro-text code, mine starts at line 229.

Cut the code from that line and move it up under the item title code where you want it.

You may have to mess with some css, but this is how you can at least get the code moved.

Good luck :-)

Bill

Please Log in or Create an account to join the conversation.

  • sambuqa
  • sambuqa's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago - 10 years 11 months ago #119692 by sambuqa
Hi Bill, first of all, thanks for answer my post! I tried to do it, but for now it doesn´t work, here´s what i do, so maybe you can point me where did i screw it =P

I copied the file in the new folder and when i open it to edit the file, go to the line 229 and there was this:
<?php if(!empty($this->item->fulltext)): ?>
          <?php if($this->item->params->get('itemIntroText')): ?>
          <!-- Item introtext -->
          <div class="itemIntroText">
                <?php echo $this->item->introtext; ?>
          </div>
          <?php endif; ?>
          <?php if($this->item->params->get('itemFullText')): ?>
          <!-- Item fulltext -->
          <div class="itemFullText">
                <?php echo $this->item->fulltext; ?>
          </div>
          <?php endif; ?>
          <?php else: ?>
          <!-- Item text -->
          <div class="itemFullText">
                <?php echo $this->item->introtext; ?>
          </div>
          <?php endif; ?>

                <div class="clr"></div>

so i went up to where i want to put the intro text and insert this:
<?php if($this->item->params->get('itemFeaturedNotice') && $this->item->featured): ?>
                <!-- Featured flag -->
                <span>
                    <sup>
                            <?php echo JText::_('K2_FEATURED'); ?>
                     </sup>
                </span>
                <?php endif; ?>

           </h2>
          <?php endif; ?>
                
           <?php if($this->item->params->get('itemIntroText')): ?> // I ADD THIS
            <!-- Item introtext -->
            <span class="itemIntroText">
                    <?php echo $this->item->introtext; ?>
            </span>
            <?php endif; ?> // HERE ENDS WHAT I ADD
          
          <?php if($this->item->params->get('itemAuthor')): ?>
          <!-- Item Author -->
                <span class="itemAuthor">
                        <?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>&nbsp;
                        <?php if(empty($this->item->created_by_alias)): ?>
                        <a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
                        <?php else: ?>
                        <?php echo $this->item->author->name; ?>
                        <?php endif; ?>
                </span>
                <?php endif; ?>

So now it shows a text beneath the Title, but the text that it shows is the full text of the article, so what went wrong? I separate what i want for intro text with a READ MORE division in the editor, is that the way to enter the intro text o there is a diferent field? Or maybe it is a code error?

Again, thanks, and sorry but my basic english :P

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum