CMS MADE SIMPLE FORGE

SEOTools2

 

[#8651] smarty compile error

avatar
Created By: Metamorphose (metamorphose)
Date Submitted: Sat Nov 17 08:50:01 -0500 2012

Assigned To: Prue Rowland (psy)
Version: None
CMSMS Version: 1.11.2
Severity: Minor
Resolution: Won't Fix
State: Open
Summary:
smarty compile error
Detailed Description:
Hi Prue

For the "Text for auto-generated descriptions" I use following

{if $description}{$description|strip_tags|truncate:200:"...":true}{elseif
$page_alias=='shop'}Some default-text for page shop!{else}Page contains:
{keywords}{/if}

This works in the release 1.1.1 but in the SVN version 1.2 I getting a smarty
compile error. In 1.2 it works only without the quotes around the word shop by
the page_alias.

Kind Regards
Metamorphose


History

Comments
avatar
Date: 2012-11-18 14:39
Posted By: Prue Rowland (psy)

This apostrophe's around the page_alias are pure smarty, nothing to do with
SEOTools2 and I cannot see why it wouldn't work???

However, I think {keywords} should be {$keywords}.  Keywords is a var, not a
plugin.
      
avatar
Date: 2012-11-18 15:59
Posted By: Metamorphose (metamorphose)

Hi Prue

You're right, {$keywords} are correct and is a mistake by me, but this is not
what smarty have problem it. With SEOTools2 V1.1.1 it works, with SEOTools2 V1.2
the smarty instruction string, I think is converted before sending to smarty.

My string
{if $description}{$description|strip_tags|truncate:200}{elseif
$page_alias=='shop'}Das Naturhandwerk-Atelier für alle Naturfreunde!{else}Seite
enthält: {$keywords}{/if}

gives smarty error

Syntax Error in template "14985dcb5c065fec82faa914c7fc9a63c8a3a36e"  on line 1
"{if $description}{$description|strip_tags|truncate:200}{elseif
$page_alias=='shop'}Das Naturhandwerk-Atelier für alle
Naturfreunde!{else}Seite enthält: {$keywords}{/if}"  - Unexpected "&"

My quotes are converted to entities ' but, I repeat, only in V1.2
      
avatar
Date: 2012-11-18 16:24
Posted By: Prue Rowland (psy)

OK, I see the problem now however I'm not sure if it can be fixed???? Many
people use apostrophes in the text of their descriptions.  This feature was
added so that such text would be correctly converted.

eg

{if $description}{$description|strip_tags|truncate:200}{elseif
$page_alias==shop}My company's other text goes here!{else}What's the matter:
{$keywords}{/if}
      
avatar
Date: 2012-11-18 17:05
Posted By: Metamorphose (metamorphose)

No problem for me when it cannot be fixed. It works in my site without the
quotes. Kind Regards
      
Updates

Updated: 2012-11-28 16:05
resolution_id: 5 => 8

Updated: 2012-11-18 14:39
resolution_id: => 5