FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Moving quicklogin to header template
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Moving quicklogin to header template [message #23228] Wed, 09 March 2005 18:42 Go to next message
mrock is currently offline  mrock   United States
Messages: 28
Registered: March 2005
Karma: 0
Junior Member
Hi, I took this snippet from quicklogin.tmpl and added to the header template since I want login/password up near my logo.

{IF: __fud_real_user__}{TEMPLATE: quick_login_loged_in}{ELSE}
{TEMPLATE: quick_login_on}{END}
{IF: $logedin || $forum_info}{TEMPLATE: loged_in_list}{ENDIF}

But I get this error upon saving the header template:

"Undefined template: "TEMPLATE" inside "quick_login_loged_in"

I tried adding {TEMPLATE: quicklogin.tmpl} but that did not work so I am a little lost. Any ideas?



[Updated on: Wed, 09 March 2005 18:42]

Report message to a moderator

Re: Moving quicklogin to header template [message #23229 is a reply to message #23228] Wed, 09 March 2005 18:56 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
To include files you need to put {REF: filename.tmpl} nea the top of the template file.

FUDforum Core Developer
Re: Moving quicklogin to header template [message #23232 is a reply to message #23229] Wed, 09 March 2005 19:18 Go to previous messageGo to next message
mrock is currently offline  mrock   United States
Messages: 28
Registered: March 2005
Karma: 0
Junior Member
I tried {REF:quicklogin.tmpl} but get

No such tag: REF -> quicklogin.tmpl

Before I go any further is this the correct way of moving the login/password box without creating any issues?
Re: Moving quicklogin to header template [message #23233 is a reply to message #23232] Wed, 09 March 2005 19:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
there has to be a space between REF: and the filename.
Take a look at index.tmpl for references on how to do it correctly.


FUDforum Core Developer
Re: Moving quicklogin to header template [message #23234 is a reply to message #23233] Wed, 09 March 2005 19:43 Go to previous messageGo to next message
mrock is currently offline  mrock   United States
Messages: 28
Registered: March 2005
Karma: 0
Junior Member
I have tried it every way including cut/paste directy from index.tmpl. But still get 'No such tag: REF -> quicklogin.tmpl' upon saving.

I am in template editor --> Header.tmpl -->Header --> adding following code to very first line.

{REF: quicklogin.tmpl}

Save

'No such tag: REF -> quicklogin.tmpl'
Re: Moving quicklogin to header template [message #23235 is a reply to message #23234] Wed, 09 March 2005 20:39 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
To add references to other files you cannot use the template editor. You need to add those manually and they must be present near the top of the file.

FUDforum Core Developer
Re: Moving quicklogin to header template [message #23236 is a reply to message #23228] Wed, 09 March 2005 20:49 Go to previous messageGo to next message
mrock is currently offline  mrock   United States
Messages: 28
Registered: March 2005
Karma: 0
Junior Member
I was able to use variables in usercp template in header template
and thought I could do the same with login/password variables.

But what you are saying is it cannot be done with login/password variables unless I edit the template directly outside of the template editor?

thx

-- Mike
Re: Moving quicklogin to header template [message #23237 is a reply to message #23236] Wed, 09 March 2005 20:57 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
What you want to do cannot be done via the template editor, since the template editor only allows you to edit existing template content. It does not allow you to make templates reference other files, which is what is needed in this case.

You download header.tmpl and your editor of choice add REF line mentioned.


FUDforum Core Developer
Re: Moving quicklogin to header template [message #23240 is a reply to message #23237] Thu, 10 March 2005 00:35 Go to previous messageGo to next message
mrock is currently offline  mrock   United States
Messages: 28
Registered: March 2005
Karma: 0
Junior Member
Ilia wrote on Wed, 09 March 2005 15:57

What you want to do cannot be done via the template editor, since the template editor only allows you to edit existing template content. It does not allow you to make templates reference other files, which is what is needed in this case.

You download header.tmpl and your editor of choice add REF line mentioned.


All I want to do is move the login/password that appears at the bottom of the forum and move it to the top of the forum. I am not using outside files or code other than what you provided in the program.

If I edit the templates manually the changes do not show up since if I understand this correctly, the template editor compiles the templates all into index.php.

If after I make a change to header.tmpl manually and then use the template editor it will blow up again since it does not recognize the changes I made manually.

So how do manual changes I make to the templates show up? Must I stop using the template editor altogether and only edit index.php directly?

Thanks again.





Re: Moving quicklogin to header template [message #23241 is a reply to message #23240] Thu, 10 March 2005 01:03 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
After making any manual changes, you need to go into the Template Manager control panel and click the "rebuild" link.

FUDforum Core Developer
Re: Moving quicklogin to header template [message #23242 is a reply to message #23228] Thu, 10 March 2005 02:02 Go to previous messageGo to next message
JamesS is currently offline  JamesS   United States
Messages: 275
Registered: July 2002
Location: Atlanta, GA
Karma: 0
Senior Member
FUDforum doesn't have globally defined template objects. Every object is locally defined in the files that make up the template for that specific page. I believe that is what you are having a hard time understanding.
icon14.gif  Re: Moving quicklogin to header template [message #23248 is a reply to message #23228] Thu, 10 March 2005 07:27 Go to previous message
mrock is currently offline  mrock   United States
Messages: 28
Registered: March 2005
Karma: 0
Junior Member
Yes and was unsure why some things I took from other templates worked while some would not. But I think I have a handle on it now. I edited the templates manually and thanks to Ilia implemented the changes with the Theme Management-->Rebuild theme feature.

It turns out I ended up just adding the following snippets into the header template. (which the template editor will accept anyway)

Added menu:

<a class="UserControlPanel" href="{TEMPLATE: usercp_lnk3}"><img src="{THEME_IMAGE_ROOT}/top_home.png" alt="{MSG: home}" /> {MSG: home}</a>&nbsp;&nbsp;&nbsp;{TEMPLATE-DATA: private_msg} {IF: ($FUD_OPT_1 & 8388608 || (_uid && $FUD_OPT_1 & 4194304) || $usr->users_opt & 1048576)}{TEMPLATE: member_search}{ENDIF}&nbsp;&nbsp;{IF: $FUD_OPT_1 & 16777216}{TEMPLATE: u_forum_search}{ENDIF}&nbsp;&nbsp;<a class="UserControlPanel" accesskey="h" href="{TEMPLATE: usercp_lnk2}"><img src="{THEME_IMAGE_ROOT}/icon_mini_faq.gif" alt="{MSG: faq}" /> {MSG: faq}</a>&nbsp;&nbsp;{IF: __fud_real_user__}{TEMPLATE: usercp_usercp}{ELSE}{TEMPLATE: register}{END}
&nbsp;&nbsp;{IF: $is_a}{TEMPLATE: admin_control_panel}{ENDIF}

Added login/logout:

{IF: __fud_real_user__}{TEMPLATE: logout}{ELSE}{TEMPLATE: register}{END}

{IF: __fud_real_user__}&nbsp;{ELSE}<form name="quick_login_form" method="post" action="{ROOT}?t=login"{FUNC: ($GLOBALS['FUD_OPT_3'] & 256 ? ' autocomplete="off"' : '')}>{DEF: _hs}
Login: <input class="SmallText" type="text" name="quick_login" size=18>&nbsp;&nbsp;
Password: <input class="SmallText" type="password" name="quick_password" size=18>
&nbsp;<input type="submit" class="button" name="quick_login_submit" value="{MSG: quicklogin_login_btn}">
</form>
{END}
{IF: __fud_real_user__}&nbsp;{ELSE}
<input type="checkbox" checked name="quick_use_cookies" value="1"> Remember me? (use cookies){END}

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to show topic title in last message info on index?
Next Topic: mouseover on threads within forums
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 21:04:48 GMT 2024

Total time taken to generate the page: 0.02229 seconds