Help - Search - Members - Calendar
Full Version: Template Customizing
Big Red Spark Forums > Big Red Spark.com Forums > Unit Command Climate Assessment and Survey System (UCCASS)
bucky
USSASS seems pretty awesome so far.

I've worked with smarty templates in the past, but the default template is not documented very well.

Here is what I'm trying to achieve.

I don't want users to see "edit survey" "admin" or "create new survey" if there are no public surveys. I don't mind manually going to /admin.php to log in...

without documenting the template, any experts out there know how to form an if (logged in) then show logout... else nothing arround the Edit surveys and login logout areas?

I sorta figured it out...

The logout was within some code, which I think tests login status...

CODE
{section name="logout" loop=1 show=$show.logout}        {/section}


I simply moved this code so it enclosed the entire table row Edit Surveys... and the admin login...

Everything shows up if you are logged in, if not, nothing.
JHolmes763
That's what I would have recommended. Glad you figured it out, though. Sorry for the lack of documentation. smile.gif

John
rex2
QUOTE(bucky @ Jul 2 2009, 10:26 AM) *

<quote>
I don't want users to see "edit survey" "admin" or "create new survey" if there are no public surveys. I don't mind manually going to /admin.php to log in...

without documenting the template, any experts out there know how to form an if (logged in) then show logout... else nothing arround the Edit surveys and login logout areas?

I sorta figured it out...

The logout was within some code, which I think tests login status...

CODE
{section name="logout" loop=1 show=$show.logout}        {/section}


I simply moved this code so it enclosed the entire table row Edit Surveys... and the admin login...

Everything shows up if you are logged in, if not, nothing.


Would you might posting the entire relevant new section? I'm not a PHP programmer, and guessing
the required syntax did not work. Thanks.

John, UCCASS is the best free survey tool out there, IMO. Thank you much for your selfless work.

Thanks,

-rex2
JHolmes763
I'm only on a phone now, so I can't post the code. In the .tpl files in the templates/ directory you can wrap any HTML code in the "section" tags shown to hide it for anyone that's not logged in.

{section ... }
<HTML code here>
{/section}
rex2
QUOTE(JHolmes763 @ Aug 8 2009, 11:14 AM) *

I'm only on a phone now, so I can't post the code. In the .tpl files in the templates/ directory you can wrap any HTML code in the "section" tags shown to hide it for anyone that's not logged in.

{section ... }
<HTML code here>
{/section}


Hi John,

Ah! That's enough info. For anyone else who wants to hide the Edit stuff, only two lines need
to be added to:templates/Default/available_surveys.tpl

Change the templates/Default/available_surveys.tpl file to read:
CODE

{section name="logout" loop=1 show=$show.logout}  #added this line
  <tr>
    <td class="whitebox">Edit Surveys</td>
[...]
      <a href="{$conf.html}/docs/index.html">Documentation</a> ]
    </td>
  </tr>
{/section}                                                            #added this line
</table>      


Thanks for the help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.