1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to reuse ACP Variables in Templates?

Discussion in 'XenForo Development Discussions' started by Marcus, Jan 3, 2014.

  1. Marcus

    Marcus Well-Known Member

    I want to setup my adsystem in ACP like

    Rectangle html code: ..................... ($var1)
    Superbanner html code: ............... ($var2)

    Now how could I use these code in my templates in the most elegant way? Is there something like {raw:acp $var1} ?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    You might need to start again on this one...

    What is $var1 and where is it set? How is it set? What does it contain?
    Is it in an option? What do you mean by "ACP variable"? Style property?

    What templates? Public templates?
     
  3. Marcus

    Marcus Well-Known Member

    Yes, I want to set an acp option in admin.php?options

    variable1:
    ______________________
    (___ means the admin can enter one text string here)

    variable2:
    ______________________

    The templates would be public templates, as my advertisements would be displayed to the public.

    Is there an option to display acp variables within templates? It would be most elegant.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    {$xenOptions.option_id} is the template syntax for displaying the value of options in templates.

    {xen:raw $xenOptions.option_id} will allow the raw HTML to be processed.
     
    HWS, Marcus and xf_phantom like this.
  5. Marcus

    Marcus Well-Known Member

    Thank you so much. Unbelievable, I thought there should not be a way to directly display the variable value within templates. I am so happy you helped me here. Thanks!
     

Share This Page