Syntax error in GCB / unrecognized tag [opgelost]

Nederlandse ondersteuning voor CMS Made Simple

Moderator: velden

Post Reply
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Syntax error in GCB / unrecognized tag [opgelost]

Post by Gregor »

Hallo,

Onderstaande code heb ik in een GCB 'SocialMedia' gezet. Plaats ik de GCB-tag {global_content name='SocialMedia'} in de template van de blog, dan werkt dat probleemloos. Echter, als ik diezelfde tag in de page-tamplate zet, dan leidt dat tot fouten.

De code:

Code: Select all

{capture assign=sourcetitle}{$entry->title|escape}{/capture} {capture assign=sourceurl}{$entry->detail_url}{/capture} {socialbookmarker sourcetitle=$sourcetitle sourceurl=$sourceurl brands='twitter, facebook, digg, stumbleupon, delicious'}
<div><br />
<h5>Deel dit artikel</h5>
 {Twitter action="tweet"} 
{literal}
<__script__ type="text/javascript" src="http://connect.facebook.net/nl_NL/all.js#xfbml=1"></__script>{/literal}
 {if isset($canonical)} 
 {elseif isset($content_obj)} 
{/if} <br />
{if $socialbookmarker|@count gt 0}
<ul class="socialbookmarker">{foreach from=$socialbookmarker item=item}
<li class="{$item->brand}"><a title="{$item->brand|ucfirst}: {$item->sourcetitle|escape}" href="{$item->destinationurl|escape}">{$item->brand|ucfirst}</a></li>
{/foreach}</ul>
{/if}</div>
<br />
De fouten die ik krijg als ik deze tag in de page-template zet, dan krijg ik deze meldingen:
string(146) "Smarty error: [in globalcontent:SocialMedia line 1]: syntax error: unrecognized tag: $entry->title|escape (Smarty_Compiler.class.php, line 446)" string(124) "Smarty error: [in globalcontent:SocialMedia line 1]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(144) "Smarty error: [in globalcontent:SocialMedia line 1]: syntax error: unrecognized tag: $entry->detail_url (Smarty_Compiler.class.php, line 446)" string(124) "Smarty error: [in globalcontent:SocialMedia line 1]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(139) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag: $item->brand (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(147) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag: $item->brand|ucfirst (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(152) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag: $item->sourcetitle|escape (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(155) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag: $item->destinationurl|escape (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(147) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag: $item->brand|ucfirst (Smarty_Compiler.class.php, line 446)" string(125) "Smarty error: [in globalcontent:SocialMedia line 12]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"

Het zal vast iets kleins zijn ;) maar wat??

Iemand die hier een oplossing voor heeft?

Gregor
Last edited by Gregor on Thu Jan 19, 2012 9:03 pm, edited 1 time in total.
deactivated010521

Re: Syntax error in GCB / unrecognized tag

Post by deactivated010521 »

----------
Last edited by deactivated010521 on Tue Mar 12, 2013 6:03 pm, edited 1 time in total.
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

Dat leergeld had ik al eens betaald Arnoud ;) dus ik had wysiwyg uitgezet in de editor. Idd alle ASCII tekens omgezet.

Edit: de voorgestelde setting staat ook zo ingesteld.

Als ik nu kijk, dan wordt alleen de opsomming van de diverse SM niet meegenomen, maar wellicht zit dat in de css. Kijk ik na.

Gregor
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

Ik ben even aan het proberen geweest, op de ene pagina verschijnt de opsomming wel en op de andere pagina niet, ter voorbeeld (onderaan pagina):

Wel
http://www.uisge-beatha.eu/logboek/270/ ... trijd.html

Niet
http://www.uisge-beatha.eu/test.html#main

In de code van de pagina waar het niet verschijnt, daar staat ook geen opsomming:

Code: Select all

<div>
    <br/>
    <h5>Deel dit artikel</h5>
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a><__script__ type="text/javascript" src="http://platform.twitter.com/widgets.js"></__script>
<__script__ src="http://connect.facebook.net/nl_NL/all.js#xfbml=1"></__script>
   <fb:like href="http://www.uisge-beatha.eu/test.html"  show_faces="false"></fb:like>
<br/>
           <ul class="socialbookmarker">
                  <li class=""><a href="" title=": "></a></li>
               </ul>
        </div>
    <br/>

Iemand enig idee?

Gregor
deactivated010521

Re: Syntax error in GCB / unrecognized tag

Post by deactivated010521 »

----------
Last edited by deactivated010521 on Tue Mar 12, 2013 6:03 pm, edited 1 time in total.
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

De code is als volgt:

Code: Select all

{strip}
{capture assign=sourcetitle}{$entry->title|escape}{/capture}
{* capture assign=sourceurl}{root_url}/logboek/{$entry->id}/{/capture *}
{capture assign=sourceurl}{root_url}/{$smarty.get.page}{/capture}
{socialbookmarker sourcetitle=$sourcetitle sourceurl=$sourceurl brands='facebook, twitter, linkedin'}
{/strip}

sourceurl: {$sourceurl} <br/>
sourceurl: {$sourcetitle} <br/>
{socialbookmarker sourcetitle=$sourcetitle sourceurl=$sourceurl brands='twitter, facebook, digg, stumbleupon, delicious'}

<pre>
{$socialbookmarker|@print_r}
</pre>

    <div>
    <br/>
    <h5>Deel dit artikel</h5>
{* cgfb_like *}
{Twitter action="tweet"}
{literal}<__script__ src="http://connect.facebook.net/nl_NL/all.js#xfbml=1"></__script>{/literal}
{if isset($canonical)}
   <fb:like href="{$entry->canonical}"  show_faces="false"></fb:like>
{elseif isset($content_obj)}
   <fb:like href="{$content_obj->GetURL()}"  show_faces="false"></fb:like>
{/if}
<br/>
    {if $socialbookmarker|@count gt 0}
       <ul class="socialbookmarker">
       {foreach from=$socialbookmarker item=item}
           <li class="{$item->brand}"><a href="{$item->destinationurl|escape}" title="{$item->brand|ucfirst}: {$item->sourcetitle|escape}">{$item->brand|ucfirst}</a></li>
       {/foreach}
        </ul>
    {/if}
    </div>
    <br/>
{* socialbookmarker *}
In de test-pagina verschijnt het volgende:
sourceurl: http://www.uisge-beatha.eu/test.html
sourceurl:
error1
http://www.uisge-beatha.eu/test.html

Op de pagina waar het werkt:
http://www.uisge-beatha.eu/logboek/274/ ... ating.html
Daar zie je dus wel de inhoud.

Heel raar. Zou er in de page-template iets kunnen zijn? Want de template voor de testpagina is een nieuwe die nog in opbouw is.
deactivated010521

Re: Syntax error in GCB / unrecognized tag

Post by deactivated010521 »

----------
Last edited by deactivated010521 on Tue Mar 12, 2013 6:03 pm, edited 1 time in total.
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

Cache geleegd, pag. bezocht en de melding blijft ongewijzigd. Waar denk je dat de error zit?
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

Op de Homepage werkt het. Idem op de pagina's die voor cgblog worden gebruikt, maar de pagina's met twee kolommen die ik vanuit het menu aanroep, daar gaat het mis ???
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

Wat in de variabelen opvalt:
Dat alleen sourceurl is gevuld in de 2-kolommen pagina's, behalve als het een cgblog-pagina is of, i.g.v. een 3 kolommen pagina, de homepage.

Edit: lang zoeken en ik zie niet waarom of wat het onderscheid in de pagina's maakt. Kan het met de canonical instelling iets van doen hebben?
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

In de config.php debug aangezet. Levert bijzondere resultaten op.... De variabelen geven dit terug:
rooturl:
Notice: Undefined index: root_url in /home/efacti/public_html/uisge-beatha.eu/tmp/templates_c/%%54^546^5464CB98%%globalcontent%3ASocialMedia.php on line 8

sourcetitle:
Notice: Undefined index: entry in /home/efacti/public_html/uisge-beatha.eu/tmp/templates_c/%%54^546^5464CB98%%globalcontent%3ASocialMedia.php on line 5

Notice: Trying to get property of non-object in /home/efacti/public_html/uisge-beatha.eu/tmp/templates_c/%%54^546^5464CB98%%globalcontent%3ASocialMedia.php on line 5

sourceurl: http://www.uisge-beatha.eu/archief/Work ... erdam.html
Bovenaan de pagina staat de melding:
Notice: Undefined index: canonical in /home/efacti/public_html/uisge-beatha.eu/tmp/templates_c/%%90^908^9081762D%%template%3A22.php on line 15
De array geeft terug:
Array
(
[0] => stdClass Object
(
[brand] => twitter
[sourcetitle] => br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
[sourceurl] => http://www.uisge-beatha.eu/archief/Work ... erdam.html
[destinationurl] => http://twitter.com/home?status=br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr: http://www.uisge-beatha.eu/archief/Work ... erdam.html
)

[1] => stdClass Object
(
[brand] => facebook
[sourcetitle] => br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
[sourceurl] => http://www.uisge-beatha.eu/archief/Work ... erdam.html
[destinationurl] => http://www.facebook.com/share.php?u=htt ... .html&t=br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
)

[2] => stdClass Object
(
[brand] => linkedin
[sourcetitle] => br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
[sourceurl] => http://www.uisge-beatha.eu/archief/Work ... erdam.html
[destinationurl] => http://www.linkedin.com/shareArticle?mi ... erdam.html
)

[3] => stdClass Object
(
[brand] => digg
[sourcetitle] => br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
[sourceurl] => http://www.uisge-beatha.eu/archief/Work ... erdam.html
[destinationurl] => http://digg.com/submit?phase=2&url=http ... l&title=br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
)

[4] => stdClass Object
(
[brand] => stumbleupon
[sourcetitle] => br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
[sourceurl] => http://www.uisge-beatha.eu/archief/Work ... erdam.html
[destinationurl] => http://www.stumbleupon.com/refer.php?ur ... l&title=br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
)

[5] => stdClass Object
(
[brand] => delicious
[sourcetitle] => br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
[sourceurl] => http://www.uisge-beatha.eu/archief/Work ... erdam.html
[destinationurl] => http://del.icio.us/post?url=http://www. ... l&title=br bNoticeb: Undefined index: entry in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr br bNoticeb: Trying to get property of nonobject in bhomeefactipublichtmluisgebeathaeutmptemplatesc545465464CB98globalcontent3ASocialMediaphpb on line b5bbr
)

)
1
Het goede nieuws is wel, dat de opsomming nu wel verschijnt....

Gauw de debug weer false zetten....
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

Ter aanvulling, in de config.php staat o.m.:

Code: Select all

$config['db_prefix'] = 'cms_';
$config['persistent_db_conn'] = '1';
$config['use_adodb_lite'] = true;
$config['root_url'] = 'http://www.uisge-beatha.eu';
$config['ssl_url'] = 'https://www.uisge-beatha.eu';
$config['root_path'] = '/home/efacti/public_html/uisge-beatha.eu';
$config['admin_dir'] = 'admin';
$config['previews_path'] = '/home/efacti/public_html/uisge-beatha.eu/tmp/cache';
$config['uploads_path'] = '/home/efacti/public_html/uisge-beatha.eu/uploads';
$config['uploads_url'] = 'http://www.uisge-beatha.eu/uploads';
$config['max_upload_size'] = 1000000;
$config['default_upload_permission'] = '664';
$config['use_smarty_php_tags'] = false;
$config['auto_alias_content'] = true;
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
$config['query_var'] = 'page';
$config['image_manipulation_prog'] = 'GD';
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';
$config['image_uploads_path'] = '/home/efacti/public_html/uisge-beatha.eu/uploads/images';
$config['image_uploads_url'] = 'http://www.uisge-beatha.eu/uploads/images';
$config['ssl_uploads_url'] = 'https://www.uisge-beatha.eu/uploads';
$config['locale'] = '';
$config['default_encoding'] = '';
$config['admin_encoding'] = 'utf-8';
$config['set_names'] = false;
$config['wiki_url'] = 'http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel';
?>
deactivated010521

Re: Syntax error in GCB / unrecognized tag

Post by deactivated010521 »

----------
Last edited by deactivated010521 on Tue Mar 12, 2013 6:03 pm, edited 1 time in total.
deactivated010521

Re: Syntax error in GCB / unrecognized tag

Post by deactivated010521 »

----------
Last edited by deactivated010521 on Tue Mar 12, 2013 6:03 pm, edited 1 time in total.
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Syntax error in GCB / unrecognized tag

Post by Gregor »

Om de oplossing van Arnoud met anderen te delen, hierbij de code zoals deze in de GCB is opgenomen:

Code: Select all

{strip}
{if $entry->title != ''}{capture assign=sourcetitle}{$entry->title|escape}{/capture}
{else}
{capture assign=_title}{title}{/capture}
{capture assign=sourcetitle}{$_title|escape}{/capture}
{/if}
{* capture assign=sourceurl}{root_url}/logboek/{$entry->id}/{/capture *}
{capture assign=sourceurl}{root_url}/{$smarty.get.page}{/capture}
{socialbookmarker sourcetitle=$sourcetitle sourceurl=$sourceurl brands='facebook, twitter, linkedin'}
{/strip}

    <div>
    <br/>
    <h5>Deel dit artikel</h5>
{* cgfb_like *}
{Twitter action="tweet"}
{literal}<__script__ src="http://connect.facebook.net/nl_NL/all.js#xfbml=1"></__script>{/literal}
{if isset($canonical)}
   <fb:like href="{$entry->canonical}"  show_faces="false"></fb:like>
{elseif isset($content_obj)}
   <fb:like href="{$content_obj->GetURL()}"  show_faces="false"></fb:like>
{/if}
<br/>
    {if $socialbookmarker|@count gt 0}
       <ul class="socialbookmarker">
       {foreach from=$socialbookmarker item=item}
           <li class="{$item->brand}"><a href="{$item->destinationurl|escape}" title="{$item->brand|ucfirst}: {$item->sourcetitle|escape}">{$item->brand|ucfirst}</a></li>
       {/foreach}
        </ul>
    {/if}
    </div>
    <br/>
{* socialbookmarker *}
Met dank aan Arnoud voor het oplossen van dit vraagstuk!
Post Reply

Return to “Dutch - Nederlands”