Forum


  • Actual situation: all bbarea fields have now
    <p></p>
    tags around text (you can manually change it to
    <div> </div>,
    but reductact tags are still there)

    Why is it problem?

    If your markup is for example (problems with W3C validation):

    <h3>{CMENUBODY} </h3> - Error: Element p not allowed as child of element h3 in this context.

    OR
    <p class="featured-desc">{CMENUBODY}</p> - Error: No p element in scope but a p end tag seen.

    So what to do? Override core CMENUBODY shortcode in theme shortcodes.

    1. add add theme_shortcodes class $override variable (before _construct() )

    var $override = true;

    1. add new method:
    function sc_cmenubody($parm='')
    {
        $sc   = e107::getScBatch('page', null, 'cpage');
        $data = $sc->getVars();                
        $text =  e107::getParser()->toHTML(vartrue($data['menu_text'],''), true, 'BODY');  
        $text =  str_replace(array("<!-- bbcode-html-start --><p>","</p><!-- bbcode-html-end -->"), "", $text);
        return $text; 
    }	

    It's done. Just remember that all CMENUBODY is now without
    <p></p>
    tags, so you need to use
    <p>{CMENUBODY}</p>
    anywhere in template

     

Moderator(s):
Welcome
Username or Email:

Password:







[ ]
[ ]
[ ]
Forum Statistics
Total posts:  13
Topics:  11
Forum replies:  2
Forum thread views:  4114
Average posts per day:  0
Online
  • Guests: 1
  • Members: 0
  • Members: 20
  • Newest Member: petra
  • Most ever online: 38
    Guests: 38 Members: 0 on Wednesday 03 August 2016 - 01:21:08