Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:53:42+00:00 2026-06-02T13:53:42+00:00

Having a bit of a problem. Trying to assign a template variable within a

  • 0

Having a bit of a problem. Trying to assign a template variable within a smarty 3 template file but it just doesnt seem to register it.

I know I can use this in the controller:

$this->data['myVar'] = 'something';

Dont want to use that. I have tried this:

{assign var="myVar" value="something" noache}

But for some reason it just doesnt seem to work.

The template this is being used in is extending another template.

I have tried setting the variable scope to global.

The other weird thing is even if i try and assign a variable which is then just being outputted just below, it still returns empty as if the assign method is broken all together. No errors though.

I know some might consider it bad practise to assign in smarty but my reasoning for this is it would allow me to specify my meta info in the template. This means when carrying out any meta tweaks they can be done in the template rather than someone going into my controllers.

Hope someone can shed some light,

Thanks for reading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:53:44+00:00Added an answer on June 2, 2026 at 1:53 pm

    Not sure why the problem occured but instead ended up using the Smarty 3 {block}{/block} tags as I was extending a master template anyway. This created the desired functionality.

    Hope this helps someone else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to script Dice's Coefficient, but I'm having a bit of a problem
I'm having a bit of a problem with Web Deploy I just can't seem
I am having a bit of a problem, I am trying to get a
I'm having a bit of a problem trying to get touchesBegan to respond to
Having a bit of problem with some syntax trying to insert HTML after an
I'm having a bit of a problem. I am trying to create an IRC
Coming from Win32, I am having bit of an issue or a problem trying
I'm having a bit of a problem trying to refine/refactor a LINQ to Entities
So i'm having a bit of a problem trying to compare two strings declared
I'm having a bit of an odd problem while trying to compile some code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.