Adding html into a view-assign

.tpl



{$test}





init.post php



$output=“

test

”;

$view->assign(‘test’,$output);



it doesnt parse the html…it outputs

test

not h1

anyway to include html ?

i need to actually

$output = file_get_contents($addondir.“/”.$file);



and file depends on current language…



so how can i make HTML be html in a view assign ?

The assign simply assigns the data to a variable…

I think the html is being detected and then encoded.

I think what you want to do in this case (you'll have to try it) is to do:

{$test|html_entity_decode}

same results… weird… how would you selectively include a html files then ?



or include a html file in the init.post controler ?

Your test case doesn't give same results for me so assuming you are doing something else.

Why aren't you using html blocks if all you're doing is wanting to display html?

basically doing an addon , that will add stuff to my skins, so no problem with updated… skin addons ;)



ok so i need to show a certain template file DEPENDING on REQUEST.sl

so in my add on / init.post.php i choose depending on language and then want to display that template…

Sorry, can't help you. That's not the way the cart was designed to work so we'd be hacking and that's not something I do.



If you have different langues, then using html blocks is the perfect solution in that it will adapt based on the language.

well then how can one use images with text in the images with the html block ? gett my drift ?



so it would use IMAGE1_FR.jpg or IMAGE1_EN.jpg depending on language



also #2



does this mean you can't SHOW a TEMPLATE (insert) from the addon ?



how does one include/show template in the content area from the addon dir ?

I don't know what “content area from the addon” means. Are you talking about the 'view' template for an addon (based on 'mode') or are you talking about something else? If talking about the view, then you need to read up on how to implement an addon and the relationship between the addon controller and the view template.



At first you wanted to know how to use html in a template variable. Gave you solution.

Then you switched to discussion about “html” from a file. Gave you solution.

Now you are discussing templates.



Unclear what problem you are really trying to solve it.



Too much of a moving target. Suggest in the future that you step back and describe the problem you are trying to solve.



Your “drift” implies that you want help implementing the way you conceive of doing it versus doing it within the architecture of the cart. Ive provided all the help/advice I can for this.

“At first you wanted to know how to use html in a template variable. Gave you solution.”

doesnt work for me…

{$test|html_entity_decode} in 3.0.3 still shows the html

“Then you switched to discussion about “html” from a file. Gave you solution.

If you have different langues, then using html blocks is the perfect solution in that it will adapt based on the language.”



well… yes html block could work with dictionary language items… BUT would not for graphics… how can a html block show a certain gfx depnding on language then ? if you can’t php/smarty in there…



as for the drift, im just trying to follow your chain of toughts… ;)

If you have your data already in language files, just use the different language files (copy/paste) for the content of the different language descriptions of the html block(s). I.e.

This is english.


for an English description and

hablomous Espanol


for Spanish

What are you talking about as far as "dictionary language items"? You said you had a separate file per language so that would be your source for the html block in each language. In the admin view of editing the block you'd simply change to Spanish versus English and enter the Spanish html.

oh doh…so simple…

I think that's what I was trying to say.

My first tendency is to over-complicate, then I have to step back and ask myself “what am I really trying to do?”

Hope it works for you.