View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002534 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2011-02-17 12:06 | 2012-12-07 14:29 |
Reporter | webtools | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 4.5.0_beta3 | ||||
Summary | 0002534: parseThroughSmarty doesn`t work proper | ||||
Description | 1) parseThroughSmarty doesn't work with categories and articles This error could be within other calls, too. "Artikelbeschreibung und Kategorienbeschreibung mit Smarty ausführen" is checked. Filling oxartextends->oxlongdesc or oxcategories->oxlongdes with Variables doesn`t work. Nothing happens. The Values aren`t replaced. To reproduce it, is really simple: Use some Variables within the oxlongdesc. Nothing happens at the front-end. The variables are ignored! 2) startProfile("parseThroughSmarty"); is started 2 Times. a) within function parseThroughSmarty every time b) at the assign-method of oxcategory.php Is this right? | ||||
Tags | Products | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
Reminder sent to: webtools Hi, Could you please tell the eShop version, where you found this issue? Best regards, |
|
Hi, I checked with PE4.4.5 and CE 4.4.6 I don`t think that it is dependent from the Shop-Versions. Only take on oder 2 Variables, put them via Admin in one longdesc-field an check whether you see the data of the varibale within the front-end. |
|
Reminder sent to: webtools Did you try to reproduce on demoshop? Cant reproduce, everything works for me. Can you paste what smarty code you want to embed/execute? |
|
??? Use for example [{ $product->oxarticles__oxtitle->value}] as variable and put it into the longdesc-field of any article. Nothing happens. |
|
Ah, yes. This problem is known and can't be simply fixed. I could not reproduce it, because i used more general variable "$oViewConf" for testing. There is two ways to fix the problem you mention: 1. use view product getter if possible e.g. details: [{assign var="_product" value=$oView->getProduct() }] [{ $_product->oxarticles__oxtitle->value}] 2. use [{eval}] directly in template. We are working on more general solution |
|
Changes: - introduced [{oxeval var=(accepts oxField/string)}] smarty function, which should be called in templates to process long descriptions containing smarty tags; - long description fields are not automaticaly processed by smarty, thus saving from non admin does not break original content; - introduced new getters which returns smarty processed long description data: oxNews::getLongDesc(); oxArticle::getLongDesc(); oxCategory::getLongDesc(); |
|
could please show me 1 complete-working example for the version before 4.5? Thanks! |
|
Reminder sent to: webtools 1. switch off "Artikelbeschreibung und Kategorienbeschreibung mit Smarty ausführen" is checked. 2. Edit templates and change affected areas with [{eval var=$product->oxarticles__oxtitle->value}]. |
|
??? Switching on or off? I think you mean ON? I don`t want to edit a template. I only want to put for example [{eval var=$product->oxarticles__oxtitle->value}] within the longdesc as admin. Perhaps you undestand it better like this. I wan`t to write a module which works with text-blocks which can be saved within the cms of the shop. So with the help of an extra field, I want to declare which text-block is used AS product-description. Within the text-block I want to use e.g. [{eval var=$product->oxarticles__oxtitle->value}] But the Step before using variables within the oxlongdesc doesn`t work. |
|
Reminder sent to: webtools sorry, just copy pasted your text. Generally in oxid < 4.5.0 parsing of smarty tags must be switched OFF and actions must be applied from templates side to solve problem you mention. Will try to explain the reason why [{ $product->oxarticles__oxtitle->value}] value is not available in your case. Parsing of long description is done immediatelly after product is loaded, means that special utility class loads smarty object, passes current view/view config objects to it, assigns long description and calls smarty function which generates content as SEPARATE template (where "product" parameter is not available, like it would be in the middle of standard details template). So in version 4.5 we simply removed this autoprocessing of long descriptions and moved it to templates, where all needed parameters is available. Thus saving additional resources. In your very custom case you can workaround the problem by: - writing module for details or other view, where this long description is loaded and implement product getter; - edit product long description and assign missing variable [{assign var="product" value=$oView->getCustomeProduct('product_id') }] |