CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#9028] extended template and header part not allow html5 header tag

avatar
Created By: Philippe Thomas (filto)
Date Submitted: Sat Mar 09 19:28:01 -0500 2013

Assigned To: Robert Campbell (calguy1000)
Version: None
CMSMS Version: None
Severity: Minor
Resolution: Fixed
State: Closed
Summary:
extended template and header part not allow html5 header tag
Detailed Description:
bug with Template inheritance if usining html5 tag <header> in extended
template:

like demonstrated here :

http://www.i-do-this.com/blog/86/Smarty-template-Inheritance-include-file-templates-and-template-resources-in-CMS-Made-Simple


include html5 <header>...</header> in extended tpl

result: tpl are no complided but excuted one by one


if <header>...</header> is included in block with append function in an extended
tpl
result error code ...unmatch bloc


solved using variable in master template and apply it in extended template

or

removing change made in core from 1.11.2 for header part detection

lib/classe/class.CMSPageTemplateResource.php

Line 117 (for cmsms 1.11.4)

$pos = stripos($tpl->content,'<head');

restored to:

$pos = stripos($tpl->content,'<head>');


But i'll like to know why exactly you have changed this line and consequences in
the rest of the code.

Thanks


History

Comments
avatar
Date: 2013-03-09 21:26
Posted By: Robert Campbell (calguy1000)

Okay, we will have to fix this for CMSMS 1.11.5
btw.  the reason it's '<head'  and not '<head>'  is because the <head> tag may
have attributes like <head profile="...">
      
avatar
Date: 2013-03-10 04:58
Posted By: Philippe Thomas (filto)

Thank you for the information.

This small bug has nothing dramatic, and i don't think it could make troubles to
many persons.
It needed severals particular conditions to obtain it and we can easily avoid it
by using a variable.


It was just for informing you about it.

Thank you again for all your efforts and your brillant modules.
      
avatar
Date: 2013-03-10 19:28
Posted By: Philippe Thomas (filto)

While waiting for next release 1.11.5 it maybe better to solve it like this:

near L117 :

$pos = stripos($tpl->content,'<head');
if( $pos === FALSE ) return;

L117 become :

$pos = stripos($tpl->content,'<head>');
if( $pos === FALSE ) $pos = stripos($tpl->content,'<head '); //white space
prevent "header" to be matched
if( $pos === FALSE ) return;

or L117 become : (a litle less flexible)

$pos = stripos($tpl->content,'<head>');
if( $pos === FALSE ) $pos = stripos($tpl->content,'<head profile');
if( $pos === FALSE ) return;
      
avatar
Date: 2013-03-17 00:11
Posted By: Robert Campbell (calguy1000)

Actually, this should do the trick:

$pos = stripos($tpl->content,'<head');
$pos2 = stripos($tpl->content,'<header');
if( $pos === FALSE || $pos == $pos2 ) return;
      
avatar
Date: 2013-05-19 18:25
Posted By: Tapio Löytty (Stikki)

Fixed in 1.11.6

Patch applied by: calguy1000
      
Updates

Updated: 2013-08-23 13:54
cmsms_version_id: 29887 => -1
state: Open => Closed

Updated: 2013-05-19 18:25
resolution_id: 5 => 7

Updated: 2013-03-09 21:26
resolution_id: => 5