bbPress2 BBCode & Content Limiting

Community Forums Forums Design Tips and Tricks bbPress2 BBCode & Content Limiting

This topic is: resolved

This topic contains 8 replies, has 2 voices, and was last updated by  SoZo 1 year, 5 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #16842

    alex2k5
    Participant
    Post count: 28

    http://wordpress.org/extend/plugins/bbpress-bbcode/

    I am using this plugin.  Necessary because we get a lot of content from vbulletin formatted submissions.  It allows us to post bbcode, shortcode like formatting in posts, and display as HTML.

    Whenever I use a Genesis widget with content limiting, not only is the formatting stripped, but the text/info inside the tag is gone as well.

    Example:

    The [URL="http://www.facebook.com/"]Company Facebook Page[/URL] has been updated with the next piece of information.

    Winds up looking like this when the content limiting is in effect:

    The has been updated with the next piece of information.

    We use the more tag, not excerpts, so I’d like to continue using the limiting functionality of the widgets if possible.

    Any suggestions?

    #16856

    SoZo
    Moderator
    Post count: 1573

    If you’re using the more tag then you can set the widget to the full content. Setting a content limit or excerpt strips out all HTML.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #16909

    alex2k5
    Participant
    Post count: 28

    In a default situation, does it strip out the text between opening and closing HTML tags as well? Or just the HTML within brackets?

    For many of the blocked layouts, using the more tag won’t work. They only work well when every block is roughly the same dimensions. Our text content, even with the more tag, is different per post. That’s why I wanted to use the limiter. I don’t prefer, but can live with HTML being stripped. However, the inner text of the HTML tags need to show up or else the teaser text is unusable.

    I am in the process of migrating to WordPress from another CMS system, so I have a lot of pre-existing content not created with these features in mind. Trying to make it work within the Genesis framework as much as I can.

    Thanks for the reply.

    #16913

    SoZo
    Moderator
    Post count: 1573

    it should just be removing the HTML tags only, nothing between them. Maybe it’s what your using for the shortcode.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #16922

    alex2k5
    Participant
    Post count: 28

    Ahh, so it’s the plugin then. Is there a way using hooks to tell genesis or the genesis plugin to process the html using that bbcode plugin before running it’s sanitizing process?

    #16927

    SoZo
    Moderator
    Post count: 1573

    You could try this and use a content limit

    [php]add_filter(‘get_the_content_limit_allowedtags’, ‘child_allowtags’);
    function child_allowtags() {
    return ‘<script>,<style>,<b>,<br>,<em>’; //add the tags you want here
    }[/php]

    Or I found this for the excerpt


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #16955

    alex2k5
    Participant
    Post count: 28

    I did find and try that option you posted earlier, adding [B] and [URL] and variants to the ones there, but it did not work.

    I will look at the options in your link now.

    Thanks a lot, appreciate the quick responses.

    #17103

    alex2k5
    Participant
    Post count: 28

    Figured it out. The excerpt, and even that custom code you linked to, strips out shortcode before processing. In that custom code you linked to, commenting out

    //$text = strip_shortcodes( $text );

    Gets the desired result. I may run into issues later if I start using shortcode early on in the post content, but for now, seems to do the trick.

    Thanks for the help!

    #17107

    SoZo
    Moderator
    Post count: 1573

    You’re welcome :)


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘bbPress2 BBCode & Content Limiting’ is closed to new replies.