Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Search found 198 matches
Smarty Forum Index
Author Message
  Topic: Total of "Row Numbers" in tpl? (Hiring/Paid)
bsmither

Replies: 4
Views: 544

PostForum: Help Wanted (commercial)   Posted: Fri Jan 04, 2019 1:28 am   Subject: Total of "Row Numbers" in tpl? (Hiring/Paid)
See also:
https://www.smarty.net/docs/en/language.function.foreach.tpl#foreach.property.total
  Topic: how to use isset without generating notice ?
bsmither

Replies: 5
Views: 377

PostForum: General   Posted: Sun Dec 16, 2018 8:03 am   Subject: how to use isset without generating notice ?
Let's try a few variants and see which works. Even though PHP understands $$varname, we need to check to determine if Smarty parses it that way.

Also, break apart the statement so that the error ge ...
  Topic: Prestashop 1.7 and layout
bsmither

Replies: 2
Views: 585

PostForum: Frameworks   Posted: Sat Dec 01, 2018 12:32 am   Subject: Prestashop 1.7 and layout
I would try this:

<div class="category-cover">
<img src=
"{$category.image.large.url|default:'url_of_cat_id_1_large_image'}"
alt=
"& ...
  Topic: Can i display the config label when entry is not existing ?
bsmither

Replies: 4
Views: 554

PostForum: General   Posted: Mon Oct 22, 2018 3:59 pm   Subject: Can i display the config label when entry is not existing ?
I am not aware of any specific Smarty setting, but if you are willing to go the extra step, this may work:
{$variable|default:"<strong>{ldelim}variable{rdelim} ...
  Topic: Comment inside literal
bsmither

Replies: 2
Views: 387

PostForum: General   Posted: Tue Oct 16, 2018 1:22 am   Subject: Comment inside literal
Unless there is more than what you posted, I do not see any actual javascript or actual CSS. Actual javascript and CSS could have tight braces which is the cause for the use of {literal} is necessary. ...
  Topic: File Exists not working
bsmither

Replies: 8
Views: 564

PostForum: General   Posted: Fri Oct 12, 2018 8:59 am   Subject: File Exists not working
Do you have any editing capability to the PHP code?

If so, then where $asset is assigned:
$smarty->assign('asset',whatever_function());could be a good place to check if the imag ...
  Topic: File Exists not working
bsmither

Replies: 8
Views: 564

PostForum: General   Posted: Thu Oct 11, 2018 7:56 pm   Subject: File Exists not working
I'm going to guess that $asset is a string that, for the purposes of the <img> tag, is a path relative to the web site's doc_root (public_html).

As such, this will be different than what the ...
  Topic: Using if else statement
bsmither

Replies: 8
Views: 700

PostForum: General   Posted: Wed Sep 19, 2018 9:34 pm   Subject: Using if else statement
<li{if $smarty.request.kpi} active{/if}>

See:
https://www.smarty.net/docs/en/language.variables.smarty.tpl#language.variables.smarty.request
  Topic: Loop over variables from within a template
bsmither

Replies: 2
Views: 438

PostForum: General   Posted: Fri Sep 14, 2018 6:11 pm   Subject: Loop over variables from within a template
I have no experience at solving your specific approach.

My solution is to add {debug} to the end of the template I want to troubleshoot. See:
https://www.smarty.net/docs/en/language.function.debug ...
  Topic: I want urgent help
bsmither

Replies: 6
Views: 655

PostForum: General   Posted: Sun Sep 09, 2018 5:37 pm   Subject: I want urgent help
where put this code , I am useing PHP Melody script

$Smarty->assign('META_GENRE',$product
Ideally, you would be asking that in the community-supported Melody forums.
  Topic: I want urgent help
bsmither

Replies: 6
Views: 655

PostForum: General   Posted: Sat Sep 08, 2018 9:58 pm   Subject: I want urgent help
In your code, you will have this:
$Smarty->assign('META_GENRE',$product['genre']);
// where $product['genre'] is the 'genre' column of this
// database record

The temp ...
  Topic: Update my Smarty
bsmither

Replies: 6
Views: 497

PostForum: General   Posted: Thu Sep 06, 2018 11:42 pm   Subject: Update my Smarty
It is possible.
https://github.com/smarty-php/smarty/releases/tag/v3.1.32

Just to CYA, rename the project's current Smarty folder to something else.

Unzip. There is a shortcut file in the /libs ...
  Topic: Performance of my site
bsmither

Replies: 6
Views: 482

PostForum: General   Posted: Thu Sep 06, 2018 11:31 pm   Subject: Performance of my site
I, too, from a number of versions ago, had complaints about very slow performance and blamed Smarty (as revealed by cachegrind).

However, the latest version or three really is very much faster. (C ...
  Topic: Downloads Page Clarification
bsmither

Replies: 0
Views: 515

PostForum: Documentation   Posted: Thu Sep 06, 2018 4:44 pm   Subject: Downloads Page Clarification
Currently, on the Downloads page:

Requirements:
Smarty 3.x: PHP 5.2+
Smarty 2.x: PHP 4 or 5


Actually, Smarty 2.6.29+ requires PHP 5.

Suggest:

Requirements:
Smarty 3.x: PHP 5.2+
Smart ...
  Topic: Parse error : Smarty.class.php on line 575 with smarty-2.6
bsmither

Replies: 3
Views: 809

PostForum: Installation and Setup   Posted: Thu Sep 06, 2018 5:00 am   Subject: Parse error : Smarty.class.php on line 575 with smarty-2.6
We may ask that you develop in Smarty 3, as the latest version will show which line of the template is causing the error.

Until then, it will be onerous to look through the templates looking for a ...
 
Page 1 of 14 Goto page 1, 2, 3 ... 12, 13, 14  Next
All times are GMT
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP