|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
cyletech Smarty n00b
Joined: 06 Feb 2012 Posts: 1
|
Posted: Mon Feb 06, 2012 5:53 pm Post subject: how to display specific section of a file? |
|
|
hello dear,
i am new with smarty. i installed and i am using but i need to display a specific section of a file. let me say more.
this is the content of my file:
Code: | <div></div>
[IF:logged]logged in[/IF]
[IF:notlogged]not logged in[/IF]
<div></div> |
now by my template engine, i can display only [IF:notlogged]...[/IF] section and after and before it but not other sections. for example i want to display the [IF:notlogged]...[/IF] section, so, the output will be:
Code: | <div></div>
not logged in
<div></div> |
i want to do this by smarty, can i do that using it ?
thank you so much |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Feb 06, 2012 6:05 pm Post subject: |
|
|
Code: | <div></div>
{if $logged}
logged in
{else}
not logged in
{/if}
<div></div> |
Make sure $logged is assigned to the template. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|