Jump to content

Define smarty template from hook


Recommended Posts

Hi all. This is what I'm trying to do.

First, want to make a hook that runs on all pages and gathers a specific information from the logged in user

Second, I want to define a smarty variable depending on the information gathered.

And last I want to insert just a variable name in my template o show that information.

 

Example: a "happy bday addon"

1) From a hook/module, check if today user birth date. It it's true, then define smarty variable $bday = "happy birthday, dear user". Else $bday = "Not your birthday"

2) Just add {$bday} in footer.tpl and get my message shown.

 

Questions:

- how do I hook every page? maybe using "ClientAreaPage" hook point?

- how can I define a smarty template from my hook so I can use it later in my templates?

 

Thanks all.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated