- Posts: 9
COMMUNITY FORUM
[SOLVED] Fulltext will not render on item layout
- 3by400
-
Topic Author
- Offline
- New Member
Link to page with issue - membersonlysupplements.com/index.php?option=com_k2&view=item&id=4:busting-creatine-myths-wide-open&Itemid=349
The introtext only is currently displaying even though the k2 default template's item.php indicates fulltext should display.
Here is the category item layout where I've forced fulltext for a demonstration in category_item.php - membersonlysupplements.com/index.php?option=com_k2&view=itemlist&layout=category&task=&id=&Itemid=349#.VC2zlOe0afm
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Looking at your page source it looks like you have entered the whole text into introtext and then you have entered just a paragraph into fulltext. Edit the item and fix it's contents. Click the "Read more" button on the point you want to split your text. Then go to the categories settings and tell K2 to show introtext in category listing and show both introtext and full text in item page.
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
I believe what you are seeing is my forced fulltext on the category layout, that I just placed there to demonstrate that fulltext does actually exist in category_item.php.
See screenshot of textboxes....
Update
Also, I have verified this: the item is inheriting the item view from the category and the category is set to show both introtext and fulltext on the item layout view. I also at one point tried to force the fulltext in item.php and the fullltext still would not render.
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Both items on that page are only displaying the fulltext in the item page. Check again the category settings.
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
I realize that on the category view all text is in the div with class "catItemIntroText", but that is only because I'm forcing the fulltext in category_item.php within that div temporarily.
The item pages are the issue - membersonlysupplements.com/index.php?option=com_k2&view=item&id=4:busting-creatine-myths-wide-open&Itemid=349
The fulltext will not render on the item page. I attached a screenshot in my previous post to prove that there is text in both the introtext box and in the fulltext box when editing the item. This is the introtext for that item:
"You’re probably curious as to whether or not it’s safe for you, mainly because it’s surrounded by misconceptions, myths, and even a few anatomy-related horror stories.
Gym goers may have heard of the word CREATINE being thrown around casually in the gym. One might think that it’s an illegal substance like steroids or something like a performance enhancing drug. You’re also probably curious as to whether or not it’s safe for you, mainly because it’s surrounded by misconceptions, myths, and even a few anatomy-related horror stories.
Let’s crack these myths wide open, shall we?"
Update
I also realize that the content on the item page is wrapped in a div with class "itemFullText" but the text showing is only the text in the introtext box. That is the problem.
Even when I modified item.php and added <?php echo $this->item->fulltext; ?> outside of the if/else the fulltext would still not display on the item page.
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
<?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; ?>
No matter what I do <?php echo $this->item->fulltext; ?> will not render on the item page, even if I place it somewhere before or after this if/else.
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
Any other ideas for what might be happening?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
<?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; ?>
Could you replace the code you sent us with this?
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
This is what its suppose to look like (category view) - membersonlysupplements.com/index.php?option=com_k2&view=itemlist&task=category&id=16:creatine&Itemid=349#.VDKJM-capTd
For some reason when the item layout gets itemFulltext its getting an incorrect result.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Also make sure that you have edited the settings for that particular item as well.
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
This issue is independent from the if statement that queries these parameters.
I can even eliminate the if statement entirely and just force the fulltext in item.php and I still get no fulltext on the item layout .. this is super strange.
I checked the database and I do have content in the fulltext field.
I'll be happy to provide you admin access if you want to take a look?
Update
Now on this page (membersonlysupplements.com/index.php?option=com_k2&view=item&id=4:busting-creatine-myths-wide-open&Itemid=349) I've eliminated the if statement and only have:
<div class="itemFullText">
<?php echo $this->item->fulltext; ?>
<br/><br/><strong>TESTING -- IS THIS FILE RENDERING THE ITEM PAGE? (components/com_k2/templates/default/item.php) -- TESTING</strong>
</div>
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- 3by400
-
Topic Author
- Offline
- New Member
- Posts: 9
Been a while, huh? We've been building this site so we took a break from this issue while we worked on some others areas of the site. We've finally circled back around to this issue and we've discovered the cause.
Our client had installed the jl_coupons_code plugin (Simple Coupons Code) and it was manipulating the k2 content in the onContentBeforeDisplay trigger, removing the fulltext from display. This is the code from the plugin where fulltext is eliminated:
case 'com_k2':
if($context == 'com_k2.item' || $context == 'com_k2.itemlist'){
$html = preg_replace_callback($regex, array('plgContentJL_Coupons_Code', 'renderCouponsCode'), $row->introtext);
}else{
return;
}
break;
We've disabled the plugin for now and the issue is resolved.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
I 'm really grateful that you posted the solution and the culprit :)
Please Log in or Create an account to join the conversation.