Keyword

Auto introtext and tag stripping

  • trogladyte
  • trogladyte's Avatar Topic Author
  • Offline
  • Senior Member
More
8 years 1 week ago #153653 by trogladyte
Auto introtext and tag stripping was created by trogladyte
I have introtext set at 150 words and stripping set to exclude p.em and a href. It was working fine a week ago, but now isn't and I haven't changed anything, except upgraded to Joomla 3.5.1.

Fulltext has stripping turned off, yet it was stripping hyperlinks out. I added a href to INTROTEXT and now K2 happily displays links in the fulltext. Makes no sense.

Tried to add an image showing my settings but Add File doesn't work. Settings are:

Introtext HTML Cleanup - Yes
HTML tags NOT to strip: p.em.a href
HTML tags TO BE stripped - <empty>
Fulltext HTML cleanup - No
Both next fields are empty.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 6 days ago #153663 by Krikor Boghossian
Replied by Krikor Boghossian on topic Auto introtext and tag stripping
Can you remove the word limit and try again?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • trogladyte
  • trogladyte's Avatar Topic Author
  • Offline
  • Senior Member
More
8 years 6 days ago #153676 by trogladyte
Replied by trogladyte on topic Auto introtext and tag stripping
As expected, I now get full articles instead of introtext, but the articles keep their formatting. Now turning strip HTML on or off does nothing to the display - I get the same output either way.

An additional thing that has occurred since we've been adding a bunch of test posts that we didn't see earlier. We have 2 leading articles set then revert to 2 column display for 4 more articles (2 x 2) then pagination. On the next page it shows articles in the same format - 2 leading with 4 in a 2 x 2 format. We had expected it would continue the 2 column on pages 2+.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 5 days ago #153711 by Krikor Boghossian
Replied by Krikor Boghossian on topic Auto introtext and tag stripping
Introtext word limit, by default will strip all tags so there won't be any unclosed HTML tags (broken layout).

You can apply a word limit via a code snippet in your overrides to enforce a wordlimit without stripping the tags.

The functions you need to use are
K2HelperUtilities::characterLimit or,
K2HelperUtilities::wordLimit, an example with the item's title can be found here: www.joomlaworks.net/forum/k2-en/17656-parameter-for-maximum-caracter-in-the-title#62142

As for the pagination, Each page will display the same set of leading/ primary/ secondary items etc..

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • trogladyte
  • trogladyte's Avatar Topic Author
  • Offline
  • Senior Member
More
8 years 5 days ago #153724 by trogladyte
Replied by trogladyte on topic Auto introtext and tag stripping
Thanks Krikor. Where do I place that override code?

I'm still confused about how K2 works in regard introtext. It seems you're saying that it strip all HTML from the whole article if it's turned on. Yet, in the full text, <p>, <em> and more appear fine, but, in my case, it had completely removed <a href...> from the full text, and this was right at the bottom of a very long article, well away from the 150 word introtext cut off. So this action makes no logical sense.

I added a href to tags NOT to be stripped from introtext, and then the links appeared in full text. Again, this makes no sense. I was specifying tags not to be stripped in the introtext portion, not full text.

Lastly, though I have :

Introtext HTML Cleanup - Yes
HTML tags NOT to strip: p.em.a href

the p and em are now being stripped (since upgrading to Joomla 3.5.1) from introtext.

Basically, K2 does not seem to be performing its tasks as the labels and settings appear to say it should.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 days ago #153789 by Krikor Boghossian
Replied by Krikor Boghossian on topic Auto introtext and tag stripping
The override code has to be placed in the category-item.php file.
Info on locating and overriding the file can be found here:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

Now, If you choose a limit, ALL tags are being stripped. It is better to manually speficy an introtext manually using the read more or by using two separate editors.

To be specific, the best way to ensure that you have control over your content is to set an introtext manually and have the tags stiped in the Introtext HTML Cleanup options.

Finally if no introtext is being specified, then the entire text is treated as fulltext. I think this is the cause of the confusion.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • trogladyte
  • trogladyte's Avatar Topic Author
  • Offline
  • Senior Member
More
8 years 2 days ago #153800 by trogladyte
Replied by trogladyte on topic Auto introtext and tag stripping
I gave up on introtext. It just doesn't work how I expect it to and I've spent far too long on trying to get it to work. I've told the client they have to use manually inserted pagebreaks.

However, this now produces a problem. Perhaps there's a setting for this - I've looked and couldn't find it. ckdev.info/twt/things-to-do/eat/chefs-restaurants/item/35-yet-another-test On this page you can see the text before the manual pagebreak highlighted in a larger font. I can live with that, though I don't like it, though I'm sure many do.

The problem is the PB was inserted mid-sentence and now the sentence is split. It makes the article disjointed and aesthetically unpleasing. If I could have it my way, I'm like to get rid of the over-size text highlighting, and make it flow properly just liek a Joomla pagebreak does.

Is this possible?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 1 day ago #153841 by Krikor Boghossian
Replied by Krikor Boghossian on topic Auto introtext and tag stripping
This is the code that produces the larger font-size:
div.itemIntroText {
    color: #444;
    font-size: 16px;
    line-height: 24px;
    padding: 4px 0 12px 0;
}

You can change the font-size to match the one used in your fulltext.
As for the break, <div> and <p> tags are being generated so the user should use PB when a sentence ends.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum